| 929 | } |
| 930 | |
| 931 | void KDiff3App::slotEditPaste() |
| 932 | { |
| 933 | slotStatusMsg(i18n("Inserting clipboard contents...")); |
| 934 | |
| 935 | if(m_pMergeResultWindow->isVisible()) |
| 936 | { |
| 937 | m_pMergeResultWindow->pasteClipboard(false); |
| 938 | } |
| 939 | else |
| 940 | { |
| 941 | if(canContinue()) |
| 942 | { |
| 943 | QString error; |
| 944 | bool do_init = false; |
| 945 | |
| 946 | if(m_pDiffTextWindow1->hasFocus()) |
| 947 | { |
| 948 | m_sd1->setData(QApplication::clipboard()->text(QClipboard::Clipboard)); |
| 949 | const QStringList& errors = m_sd1->getErrors(); |
| 950 | if(!errors.isEmpty()) |
| 951 | error = m_sd1->getErrors()[0]; |
| 952 | |
| 953 | do_init = true; |
| 954 | } |
| 955 | else if(m_pDiffTextWindow2->hasFocus()) |
| 956 | { |
| 957 | m_sd2->setData(QApplication::clipboard()->text(QClipboard::Clipboard)); |
| 958 | const QStringList& errors = m_sd2->getErrors(); |
| 959 | if(!errors.isEmpty()) |
| 960 | error = m_sd2->getErrors()[0]; |
| 961 | |
| 962 | do_init = true; |
| 963 | } |
| 964 | else if(m_pDiffTextWindow3->hasFocus()) |
| 965 | { |
| 966 | m_sd3->setData(QApplication::clipboard()->text(QClipboard::Clipboard)); |
| 967 | const QStringList& errors = m_sd3->getErrors(); |
| 968 | if(!errors.isEmpty()) |
| 969 | error = m_sd3->getErrors()[0]; |
| 970 | |
| 971 | do_init = true; |
| 972 | } |
| 973 | |
| 974 | if(!error.isEmpty()) |
| 975 | { |
| 976 | KMessageBox::error(m_pOptionDialog, error); |
| 977 | } |
| 978 | |
| 979 | if(do_init) |
| 980 | { |
| 981 | mainInit(m_totalDiffStatus); |
| 982 | } |
| 983 | } |
| 984 | } |
| 985 | |
| 986 | slotStatusMsg(i18n("Ready.")); |
| 987 | } |
| 988 |
nothing calls this directly
no test coverage detected