Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 789330 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/DefaultFileAccessJobHandler.cpp (-29 / +29 lines)
Lines 29-36 bool DefaultFileAccessJobHandler::stat(short detail, bool bWantToWrite) Link Here
29
                                       bWantToWrite ? KIO::StatJob::DestinationSide : KIO::StatJob::SourceSide,
29
                                       bWantToWrite ? KIO::StatJob::DestinationSide : KIO::StatJob::SourceSide,
30
                                       detail, KIO::HideProgressInfo);
30
                                       detail, KIO::HideProgressInfo);
31
31
32
    chk_connect(pStatJob, &KIO::StatJob::result, this, &DefaultFileAccessJobHandler::slotStatResult);
32
    connect(pStatJob, &KIO::StatJob::result, this, &DefaultFileAccessJobHandler::slotStatResult);
33
    chk_connect(pStatJob, &KIO::StatJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
33
    connect(pStatJob, &KIO::StatJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
34
34
35
    ProgressProxy::enterEventLoop(pStatJob, i18n("Getting file status: %1", mFileAccess->prettyAbsPath()));
35
    ProgressProxy::enterEventLoop(pStatJob, i18n("Getting file status: %1", mFileAccess->prettyAbsPath()));
36
36
Lines 79-88 bool DefaultFileAccessJobHandler::get(void* pDestBuffer, long maxLength) Link Here
79
        m_bSuccess = false;
79
        m_bSuccess = false;
80
        mFileAccess->setStatusText(QString());
80
        mFileAccess->setStatusText(QString());
81
81
82
        chk_connect(pJob, &KIO::TransferJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
82
        connect(pJob, &KIO::TransferJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
83
        chk_connect(pJob, &KIO::TransferJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
83
        connect(pJob, &KIO::TransferJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
84
        chk_connect(pJob, &KIO::TransferJob::data, this, &DefaultFileAccessJobHandler::slotGetData);
84
        connect(pJob, &KIO::TransferJob::data, this, &DefaultFileAccessJobHandler::slotGetData);
85
        chk_connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong)));
85
        connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong)));
86
86
87
        ProgressProxy::enterEventLoop(pJob, i18n("Reading file: %1", mFileAccess->prettyAbsPath()));
87
        ProgressProxy::enterEventLoop(pJob, i18n("Reading file: %1", mFileAccess->prettyAbsPath()));
88
        return m_bSuccess;
88
        return m_bSuccess;
Lines 119-128 bool DefaultFileAccessJobHandler::put(const void* pSrcBuffer, long maxLength, bo Link Here
119
        m_bSuccess = false;
119
        m_bSuccess = false;
120
        mFileAccess->setStatusText(QString());
120
        mFileAccess->setStatusText(QString());
121
121
122
        chk_connect(pJob, &KIO::TransferJob::result, this, &DefaultFileAccessJobHandler::slotPutJobResult);
122
        connect(pJob, &KIO::TransferJob::result, this, &DefaultFileAccessJobHandler::slotPutJobResult);
123
        chk_connect(pJob, &KIO::TransferJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
123
        connect(pJob, &KIO::TransferJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
124
        chk_connect(pJob, &KIO::TransferJob::dataReq, this, &DefaultFileAccessJobHandler::slotPutData);
124
        connect(pJob, &KIO::TransferJob::dataReq, this, &DefaultFileAccessJobHandler::slotPutData);
125
        chk_connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong)));
125
        connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong)));
126
126
127
        ProgressProxy::enterEventLoop(pJob, i18n("Writing file: %1", mFileAccess->prettyAbsPath()));
127
        ProgressProxy::enterEventLoop(pJob, i18n("Writing file: %1", mFileAccess->prettyAbsPath()));
128
        return m_bSuccess;
128
        return m_bSuccess;
Lines 192-199 bool DefaultFileAccessJobHandler::mkDirImp(const QString& dirName) Link Here
192
    {
192
    {
193
        m_bSuccess = false;
193
        m_bSuccess = false;
194
        KIO::SimpleJob* pJob = KIO::mkdir(dir.url());
194
        KIO::SimpleJob* pJob = KIO::mkdir(dir.url());
195
        chk_connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
195
        connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
196
        chk_connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
196
        connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
197
197
198
        ProgressProxy::enterEventLoop(pJob, i18n("Making folder: %1", dirName));
198
        ProgressProxy::enterEventLoop(pJob, i18n("Making folder: %1", dirName));
199
        return m_bSuccess;
199
        return m_bSuccess;
Lines 214-221 bool DefaultFileAccessJobHandler::rmDirImp(const QString& dirName) Link Here
214
    {
214
    {
215
        m_bSuccess = false;
215
        m_bSuccess = false;
216
        KIO::SimpleJob* pJob = KIO::rmdir(fa.url());
216
        KIO::SimpleJob* pJob = KIO::rmdir(fa.url());
217
        chk_connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
217
        connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
218
        chk_connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
218
        connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
219
219
220
        ProgressProxy::enterEventLoop(pJob, i18n("Removing folder: %1", dirName));
220
        ProgressProxy::enterEventLoop(pJob, i18n("Removing folder: %1", dirName));
221
        return m_bSuccess;
221
        return m_bSuccess;
Lines 230-237 bool DefaultFileAccessJobHandler::removeFile(const QUrl& fileName) Link Here
230
    {
230
    {
231
        m_bSuccess = false;
231
        m_bSuccess = false;
232
        KIO::SimpleJob* pJob = KIO::file_delete(fileName, KIO::HideProgressInfo);
232
        KIO::SimpleJob* pJob = KIO::file_delete(fileName, KIO::HideProgressInfo);
233
        chk_connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
233
        connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
234
        chk_connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
234
        connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
235
235
236
        ProgressProxy::enterEventLoop(pJob, i18n("Removing file: %1", FileAccess::prettyAbsPath(fileName)));
236
        ProgressProxy::enterEventLoop(pJob, i18n("Removing file: %1", FileAccess::prettyAbsPath(fileName)));
237
        return m_bSuccess;
237
        return m_bSuccess;
Lines 246-253 bool DefaultFileAccessJobHandler::symLink(const QUrl& linkTarget, const QUrl& li Link Here
246
    {
246
    {
247
        m_bSuccess = false;
247
        m_bSuccess = false;
248
        KIO::CopyJob* pJob = KIO::link(linkTarget, linkLocation, KIO::HideProgressInfo);
248
        KIO::CopyJob* pJob = KIO::link(linkTarget, linkLocation, KIO::HideProgressInfo);
249
        chk_connect(pJob, &KIO::CopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
249
        connect(pJob, &KIO::CopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
250
        chk_connect(pJob, &KIO::CopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
250
        connect(pJob, &KIO::CopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
251
251
252
        ProgressProxy::enterEventLoop(pJob,
252
        ProgressProxy::enterEventLoop(pJob,
253
                                      i18n("Creating symbolic link: %1 -> %2", FileAccess::prettyAbsPath(linkLocation), FileAccess::prettyAbsPath(linkTarget)));
253
                                      i18n("Creating symbolic link: %1 -> %2", FileAccess::prettyAbsPath(linkLocation), FileAccess::prettyAbsPath(linkTarget)));
Lines 270-278 bool DefaultFileAccessJobHandler::rename(const FileAccess& destFile) Link Here
270
        int permissions = -1;
270
        int permissions = -1;
271
        m_bSuccess = false;
271
        m_bSuccess = false;
272
        KIO::FileCopyJob* pJob = KIO::file_move(mFileAccess->url(), destFile.url(), permissions, KIO::HideProgressInfo);
272
        KIO::FileCopyJob* pJob = KIO::file_move(mFileAccess->url(), destFile.url(), permissions, KIO::HideProgressInfo);
273
        chk_connect(pJob, &KIO::FileCopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
273
        connect(pJob, &KIO::FileCopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
274
        chk_connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong)));
274
        connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong)));
275
        chk_connect(pJob, &KIO::FileCopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
275
        connect(pJob, &KIO::FileCopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
276
276
277
        ProgressProxy::enterEventLoop(pJob,
277
        ProgressProxy::enterEventLoop(pJob,
278
                                      i18n("Renaming file: %1 -> %2", mFileAccess->prettyAbsPath(), destFile.prettyAbsPath()));
278
                                      i18n("Renaming file: %1 -> %2", mFileAccess->prettyAbsPath(), destFile.prettyAbsPath()));
Lines 313-321 bool DefaultFileAccessJobHandler::copyFile(const QString& inDest) Link Here
313
    int permissions = (mFileAccess->isExecutable() ? 0111 : 0) + (mFileAccess->isWritable() ? 0222 : 0) + (mFileAccess->isReadable() ? 0444 : 0);
313
    int permissions = (mFileAccess->isExecutable() ? 0111 : 0) + (mFileAccess->isWritable() ? 0222 : 0) + (mFileAccess->isReadable() ? 0444 : 0);
314
    m_bSuccess = false;
314
    m_bSuccess = false;
315
    KIO::FileCopyJob* pJob = KIO::file_copy(mFileAccess->url(), dest.url(), permissions, KIO::HideProgressInfo|KIO::Overwrite);
315
    KIO::FileCopyJob* pJob = KIO::file_copy(mFileAccess->url(), dest.url(), permissions, KIO::HideProgressInfo|KIO::Overwrite);
316
    chk_connect(pJob, &KIO::FileCopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
316
    connect(pJob, &KIO::FileCopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
317
    chk_connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong)));
317
    connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong)));
318
    chk_connect(pJob, &KIO::FileCopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
318
    connect(pJob, &KIO::FileCopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
319
319
320
    ProgressProxy::enterEventLoop(pJob,
320
    ProgressProxy::enterEventLoop(pJob,
321
                                  i18n("Copying file: %1 -> %2", mFileAccess->prettyAbsPath(), dest.prettyAbsPath()));
321
                                  i18n("Copying file: %1 -> %2", mFileAccess->prettyAbsPath(), dest.prettyAbsPath()));
Lines 387-400 bool DefaultFileAccessJobHandler::listDir(t_DirectoryList* pDirList, bool bRecur Link Here
387
        m_bSuccess = false;
387
        m_bSuccess = false;
388
        if(pListJob != nullptr)
388
        if(pListJob != nullptr)
389
        {
389
        {
390
            chk_connect(pListJob, &KIO::ListJob::entries, this, &DefaultFileAccessJobHandler::slotListDirProcessNewEntries);
390
            connect(pListJob, &KIO::ListJob::entries, this, &DefaultFileAccessJobHandler::slotListDirProcessNewEntries);
391
            chk_connect(pListJob, &KIO::ListJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
391
            connect(pListJob, &KIO::ListJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult);
392
            chk_connect(pListJob, &KIO::ListJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
392
            connect(pListJob, &KIO::ListJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded);
393
            chk_connect(pListJob, &KIO::ListJob::infoMessage, &pp, &ProgressProxyExtender::slotListDirInfoMessage);
393
            connect(pListJob, &KIO::ListJob::infoMessage, &pp, &ProgressProxyExtender::slotListDirInfoMessage);
394
394
395
            // This line makes the transfer via fish unreliable.:-(
395
            // This line makes the transfer via fish unreliable.:-(
396
            /*if(mFileAccess->url().scheme() != QLatin1String("fish")){
396
            /*if(mFileAccess->url().scheme() != QLatin1String("fish")){
397
                chk_connect( pListJob, static_cast<void (KIO::ListJob::*)(KJob*,qint64)>(&KIO::ListJob::percent), &pp, &ProgressProxyExtender::slotPercent);
397
                connect( pListJob, static_cast<void (KIO::ListJob::*)(KJob*,qint64)>(&KIO::ListJob::percent), &pp, &ProgressProxyExtender::slotPercent);
398
            }*/
398
            }*/
399
399
400
            ProgressProxy::enterEventLoop(pListJob,
400
            ProgressProxy::enterEventLoop(pListJob,
(-)a/src/difftextwindow.cpp (-18 / +18 lines)
Lines 266-286 void DiffTextWindow::setupConnections(const KDiff3App* app) Link Here
266
{
266
{
267
    Q_ASSERT(qobject_cast<DiffTextWindowFrame*>(parent()) != nullptr);
267
    Q_ASSERT(qobject_cast<DiffTextWindowFrame*>(parent()) != nullptr);
268
268
269
    chk_connect(this, &DiffTextWindow::firstLineChanged, dynamic_cast<DiffTextWindowFrame*>(parent()), &DiffTextWindowFrame::setFirstLine);
269
    connect(this, &DiffTextWindow::firstLineChanged, dynamic_cast<DiffTextWindowFrame*>(parent()), &DiffTextWindowFrame::setFirstLine);
270
    chk_connect(this, &DiffTextWindow::newSelection, app, &KDiff3App::slotSelectionStart);
270
    connect(this, &DiffTextWindow::newSelection, app, &KDiff3App::slotSelectionStart);
271
    chk_connect(this, &DiffTextWindow::selectionEnd, app, &KDiff3App::slotSelectionEnd);
271
    connect(this, &DiffTextWindow::selectionEnd, app, &KDiff3App::slotSelectionEnd);
272
    chk_connect(this, &DiffTextWindow::scrollDiffTextWindow, app, &KDiff3App::scrollDiffTextWindow);
272
    connect(this, &DiffTextWindow::scrollDiffTextWindow, app, &KDiff3App::scrollDiffTextWindow);
273
    chk_connect_q(this, &DiffTextWindow::finishRecalcWordWrap, app, &KDiff3App::slotFinishRecalcWordWrap);
273
    connect(this, &DiffTextWindow::finishRecalcWordWrap, app, &KDiff3App::slotFinishRecalcWordWrap, Qt::QueuedConnection);
274
274
275
    chk_connect(this, &DiffTextWindow::finishDrop, app, &KDiff3App::slotFinishDrop);
275
    connect(this, &DiffTextWindow::finishDrop, app, &KDiff3App::slotFinishDrop);
276
276
277
    chk_connect(this, &DiffTextWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg);
277
    connect(this, &DiffTextWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg);
278
278
279
    chk_connect(app, &KDiff3App::showWhiteSpaceToggled, this, static_cast<void (DiffTextWindow::*)(void)>(&DiffTextWindow::update));
279
    connect(app, &KDiff3App::showWhiteSpaceToggled, this, static_cast<void (DiffTextWindow::*)(void)>(&DiffTextWindow::update));
280
    chk_connect(app, &KDiff3App::showLineNumbersToggled, this, static_cast<void (DiffTextWindow::*)(void)>(&DiffTextWindow::update));
280
    connect(app, &KDiff3App::showLineNumbersToggled, this, static_cast<void (DiffTextWindow::*)(void)>(&DiffTextWindow::update));
281
    chk_connect(app, &KDiff3App::doRefresh, this, &DiffTextWindow::slotRefresh);
281
    connect(app, &KDiff3App::doRefresh, this, &DiffTextWindow::slotRefresh);
282
    chk_connect(app, &KDiff3App::selectAll, this, &DiffTextWindow::slotSelectAll);
282
    connect(app, &KDiff3App::selectAll, this, &DiffTextWindow::slotSelectAll);
283
    chk_connect(app, &KDiff3App::copy, this, &DiffTextWindow::slotCopy);
283
    connect(app, &KDiff3App::copy, this, &DiffTextWindow::slotCopy);
284
284
285
    connections.push_back(KDiff3App::allowCopy.connect(boost::bind(&DiffTextWindow::canCopy, this)));
285
    connections.push_back(KDiff3App::allowCopy.connect(boost::bind(&DiffTextWindow::canCopy, this)));
286
    connections.push_back(KDiff3App::getSelection.connect(boost::bind(&DiffTextWindow::getSelection, this)));
286
    connections.push_back(KDiff3App::getSelection.connect(boost::bind(&DiffTextWindow::getSelection, this)));
Lines 1859-1866 DiffTextWindowFrame::DiffTextWindowFrame(QWidget* pParent, const QSharedPointer< Link Here
1859
    d = new DiffTextWindowFrameData(this, pOptions, winIdx);
1859
    d = new DiffTextWindowFrameData(this, pOptions, winIdx);
1860
    d->mSourceData = psd;
1860
    d->mSourceData = psd;
1861
    setAutoFillBackground(true);
1861
    setAutoFillBackground(true);
1862
    chk_connect(d->getBrowseButton(), &QPushButton::clicked, this, &DiffTextWindowFrame::slotBrowseButtonClicked);
1862
    connect(d->getBrowseButton(), &QPushButton::clicked, this, &DiffTextWindowFrame::slotBrowseButtonClicked);
1863
    chk_connect(d->getFileSelectionField(), &QLineEdit::returnPressed, this, &DiffTextWindowFrame::slotReturnPressed);
1863
    connect(d->getFileSelectionField(), &QLineEdit::returnPressed, this, &DiffTextWindowFrame::slotReturnPressed);
1864
1864
1865
    d->m_pDiffTextWindow = new DiffTextWindow(this, pOptions, winIdx);
1865
    d->m_pDiffTextWindow = new DiffTextWindow(this, pOptions, winIdx);
1866
    d->m_pDiffTextWindow->setSourceData(psd);
1866
    d->m_pDiffTextWindow->setSourceData(psd);
Lines 1887-1893 DiffTextWindowFrame::DiffTextWindowFrame(QWidget* pParent, const QSharedPointer< Link Here
1887
    pHL2->addWidget(d->m_pTopLine, 0);
1887
    pHL2->addWidget(d->m_pTopLine, 0);
1888
    d->m_pEncoding = new EncodingLabel(i18n("Encoding:"), psd, pOptions);
1888
    d->m_pEncoding = new EncodingLabel(i18n("Encoding:"), psd, pOptions);
1889
    //EncodeLabel::EncodingChanged should be handled asyncroniously.
1889
    //EncodeLabel::EncodingChanged should be handled asyncroniously.
1890
    chk_connect_q((EncodingLabel*)d->m_pEncoding, &EncodingLabel::encodingChanged, this, &DiffTextWindowFrame::slotEncodingChanged);
1890
    connect((EncodingLabel*)d->m_pEncoding, &EncodingLabel::encodingChanged, this, &DiffTextWindowFrame::slotEncodingChanged, Qt::QueuedConnection);
1891
1891
1892
    d->m_pLineEndStyle = new QLabel(i18n("Line end style:"));
1892
    d->m_pLineEndStyle = new QLabel(i18n("Line end style:"));
1893
    pHL2->addWidget(d->m_pEncoding);
1893
    pHL2->addWidget(d->m_pEncoding);
Lines 1926-1933 void DiffTextWindowFrame::init() Link Here
1926
1926
1927
void DiffTextWindowFrame::setupConnections(const KDiff3App* app)
1927
void DiffTextWindowFrame::setupConnections(const KDiff3App* app)
1928
{
1928
{
1929
    chk_connect(this, &DiffTextWindowFrame::fileNameChanged, app, &KDiff3App::slotFileNameChanged);
1929
    connect(this, &DiffTextWindowFrame::fileNameChanged, app, &KDiff3App::slotFileNameChanged);
1930
    chk_connect(this, &DiffTextWindowFrame::encodingChanged, app, &KDiff3App::slotEncodingChanged);
1930
    connect(this, &DiffTextWindowFrame::encodingChanged, app, &KDiff3App::slotEncodingChanged);
1931
    d->mSourceData->setupConnections();
1931
    d->mSourceData->setupConnections();
1932
}
1932
}
1933
1933
Lines 2103-2109 void EncodingLabel::insertCodec(const QString& visibleCodecName, QTextCodec* pCo Link Here
2103
        if(currentTextCodecEnum == CodecMIBEnum)
2103
        if(currentTextCodecEnum == CodecMIBEnum)
2104
            pAction->setChecked(true);
2104
            pAction->setChecked(true);
2105
        pMenu->addAction(pAction);
2105
        pMenu->addAction(pAction);
2106
        chk_connect(pAction, &QAction::triggered, this, &EncodingLabel::slotSelectEncoding);
2106
        connect(pAction, &QAction::triggered, this, &EncodingLabel::slotSelectEncoding);
2107
        codecEnumList.append(CodecMIBEnum);
2107
        codecEnumList.append(CodecMIBEnum);
2108
    }
2108
    }
2109
}
2109
}
(-)a/src/directorymergewindow.cpp (-9 / +9 lines)
Lines 68-74 class StatusInfo : public QDialog Link Here
68
        m_pTextEdit->setWordWrapMode(QTextOption::NoWrap);
68
        m_pTextEdit->setWordWrapMode(QTextOption::NoWrap);
69
        m_pTextEdit->setReadOnly(true);
69
        m_pTextEdit->setReadOnly(true);
70
        QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Close, this);
70
        QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Close, this);
71
        chk_connect(box, &QDialogButtonBox::rejected, this, &QDialog::accept);
71
        connect(box, &QDialogButtonBox::rejected, this, &QDialog::accept);
72
        pVLayout->addWidget(box);
72
        pVLayout->addWidget(box);
73
    }
73
    }
74
74
Lines 639-646 DirectoryMergeWindow::DirectoryMergeWindow(QWidget* pParent, const QSharedPointe Link Here
639
    d = new DirectoryMergeWindowPrivate(this);
639
    d = new DirectoryMergeWindowPrivate(this);
640
    setModel(d);
640
    setModel(d);
641
    setItemDelegate(new DirMergeItemDelegate(this));
641
    setItemDelegate(new DirMergeItemDelegate(this));
642
    chk_connect(this, &DirectoryMergeWindow::doubleClicked, this, &DirectoryMergeWindow::onDoubleClick);
642
    connect(this, &DirectoryMergeWindow::doubleClicked, this, &DirectoryMergeWindow::onDoubleClick);
643
    chk_connect(this, &DirectoryMergeWindow::expanded, this, &DirectoryMergeWindow::onExpanded);
643
    connect(this, &DirectoryMergeWindow::expanded, this, &DirectoryMergeWindow::onExpanded);
644
644
645
    d->m_pOptions = pOptions;
645
    d->m_pOptions = pOptions;
646
646
Lines 3003-3014 void DirectoryMergeWindow::initDirectoryMergeActions(KDiff3App* pKDiff3App, KAct Link Here
3003
3003
3004
void DirectoryMergeWindow::setupConnections(const KDiff3App* app)
3004
void DirectoryMergeWindow::setupConnections(const KDiff3App* app)
3005
{
3005
{
3006
    chk_connect(this, &DirectoryMergeWindow::startDiffMerge, app, &KDiff3App::slotFileOpen2);
3006
    connect(this, &DirectoryMergeWindow::startDiffMerge, app, &KDiff3App::slotFileOpen2);
3007
    chk_connect(selectionModel(), &QItemSelectionModel::selectionChanged, app, &KDiff3App::slotUpdateAvailabilities);
3007
    connect(selectionModel(), &QItemSelectionModel::selectionChanged, app, &KDiff3App::slotUpdateAvailabilities);
3008
    chk_connect(selectionModel(), &QItemSelectionModel::currentChanged, app, &KDiff3App::slotUpdateAvailabilities);
3008
    connect(selectionModel(), &QItemSelectionModel::currentChanged, app, &KDiff3App::slotUpdateAvailabilities);
3009
    chk_connect(this, static_cast<void (DirectoryMergeWindow::*) (void)>(&DirectoryMergeWindow::updateAvailabilities), app, &KDiff3App::slotUpdateAvailabilities);
3009
    connect(this, static_cast<void (DirectoryMergeWindow::*) (void)>(&DirectoryMergeWindow::updateAvailabilities), app, &KDiff3App::slotUpdateAvailabilities);
3010
    chk_connect(this, &DirectoryMergeWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg);
3010
    connect(this, &DirectoryMergeWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg);
3011
    chk_connect(app, &KDiff3App::doRefresh, this, &DirectoryMergeWindow::slotRefresh);
3011
    connect(app, &KDiff3App::doRefresh, this, &DirectoryMergeWindow::slotRefresh);
3012
}
3012
}
3013
3013
3014
void DirectoryMergeWindow::updateAvailabilities(bool bMergeEditorVisible, bool bDirCompare, bool bDiffWindowVisible,
3014
void DirectoryMergeWindow::updateAvailabilities(bool bMergeEditorVisible, bool bDirCompare, bool bDiffWindowVisible,
(-)a/src/guiutils.h (-2 / +2 lines)
Lines 28-34 namespace GuiUtils { Link Here
28
28
29
       theAction = ac->addAction(actionName);
29
       theAction = ac->addAction(actionName);
30
       theAction->setText(text);
30
       theAction->setText(text);
31
       chk_connect(theAction, &QAction::triggered, receiver, slot);
31
       QObject::connect(theAction, &QAction::triggered, receiver, slot);
32
       return theAction;
32
       return theAction;
33
   }
33
   }
34
34
Lines 43-49 namespace GuiUtils { Link Here
43
      KToggleAction* theAction = new KToggleAction(ac);
43
      KToggleAction* theAction = new KToggleAction(ac);
44
      ac->addAction( actionName, theAction );
44
      ac->addAction( actionName, theAction );
45
      theAction->setText( text );
45
      theAction->setText( text );
46
      chk_connect( theAction, &KToggleAction::triggered, receiver, slot );
46
      QObject::connect( theAction, &KToggleAction::triggered, receiver, slot );
47
      return theAction;
47
      return theAction;
48
   }
48
   }
49
49
(-)a/src/kdiff3.cpp (-6 / +6 lines)
Lines 145-151 KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P Link Here
145
145
146
    // All default values must be set before calling readOptions().
146
    // All default values must be set before calling readOptions().
147
    m_pOptionDialog = new OptionDialog(m_pKDiff3Shell != nullptr, this);
147
    m_pOptionDialog = new OptionDialog(m_pKDiff3Shell != nullptr, this);
148
    chk_connect(m_pOptionDialog, &OptionDialog::applyDone, this, &KDiff3App::slotRefresh);
148
    connect(m_pOptionDialog, &OptionDialog::applyDone, this, &KDiff3App::slotRefresh);
149
149
150
    // This is just a convenience variable to make code that accesses options more readable
150
    // This is just a convenience variable to make code that accesses options more readable
151
    m_pOptions = m_pOptionDialog->getOptions();
151
    m_pOptions = m_pOptionDialog->getOptions();
Lines 303-309 KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P Link Here
303
    initStatusBar();
303
    initStatusBar();
304
304
305
    m_pFindDialog = new FindDialog(this);
305
    m_pFindDialog = new FindDialog(this);
306
    chk_connect(m_pFindDialog, &FindDialog::findNext, this, &KDiff3App::slotEditFindNext);
306
    connect(m_pFindDialog, &FindDialog::findNext, this, &KDiff3App::slotEditFindNext);
307
307
308
    autoAdvance->setChecked(m_pOptions->m_bAutoAdvance);
308
    autoAdvance->setChecked(m_pOptions->m_bAutoAdvance);
309
    showWhiteSpaceCharacters->setChecked(m_pOptions->m_bShowWhiteSpaceCharacters);
309
    showWhiteSpaceCharacters->setChecked(m_pOptions->m_bShowWhiteSpaceCharacters);
Lines 343-352 KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P Link Here
343
    //Warning: Make sure DirectoryMergeWindow::initActions is called before this point or we can crash when selectionChanged is sent.
343
    //Warning: Make sure DirectoryMergeWindow::initActions is called before this point or we can crash when selectionChanged is sent.
344
    m_pDirectoryMergeWindow->setupConnections(this);
344
    m_pDirectoryMergeWindow->setupConnections(this);
345
345
346
    chk_connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &KDiff3App::slotClipboardChanged);
346
    connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &KDiff3App::slotClipboardChanged);
347
    chk_connect_q(this, &KDiff3App::sigRecalcWordWrap, this, &KDiff3App::slotRecalcWordWrap);
347
    connect(this, &KDiff3App::sigRecalcWordWrap, this, &KDiff3App::slotRecalcWordWrap, Qt::QueuedConnection);
348
    connections.push_back(shouldContinue.connect(boost::bind(&KDiff3App::canContinue, this)));
348
    connections.push_back(shouldContinue.connect(boost::bind(&KDiff3App::canContinue, this)));
349
    chk_connect(this, &KDiff3App::finishDrop, this, &KDiff3App::slotFinishDrop);
349
    connect(this, &KDiff3App::finishDrop, this, &KDiff3App::slotFinishDrop);
350
350
351
    connections.push_back(allowCut.connect(boost::bind(&KDiff3App::canCut, this)));
351
    connections.push_back(allowCut.connect(boost::bind(&KDiff3App::canCut, this)));
352
    connections.push_back(allowCopy.connect(boost::bind(&KDiff3App::canCopy, this)));
352
    connections.push_back(allowCopy.connect(boost::bind(&KDiff3App::canCopy, this)));
Lines 354-360 KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P Link Here
354
    m_pDirectoryMergeWindow->initDirectoryMergeActions(this, actionCollection());
354
    m_pDirectoryMergeWindow->initDirectoryMergeActions(this, actionCollection());
355
355
356
    if(qApp != nullptr)
356
    if(qApp != nullptr)
357
        chk_connect(qApp, &QApplication::focusChanged, this, &KDiff3App::slotFocusChanged);
357
        connect(qApp, &QApplication::focusChanged, this, &KDiff3App::slotFocusChanged);
358
358
359
    delete KDiff3Shell::getParser();
359
    delete KDiff3Shell::getParser();
360
}
360
}
(-)a/src/kdiff3.h (-1 / +1 lines)
Lines 68-74 class ReversibleScrollBar : public QScrollBar Link Here
68
    {
68
    {
69
        m_pbRightToLeftLanguage = pbRightToLeftLanguage;
69
        m_pbRightToLeftLanguage = pbRightToLeftLanguage;
70
        m_realVal = 0;
70
        m_realVal = 0;
71
        chk_connect(this, &ReversibleScrollBar::valueChanged, this, &ReversibleScrollBar::slotValueChanged);
71
        connect(this, &ReversibleScrollBar::valueChanged, this, &ReversibleScrollBar::slotValueChanged);
72
    }
72
    }
73
    void setAgain() { setValue(m_realVal); }
73
    void setAgain() { setValue(m_realVal); }
74
74
(-)a/src/kdiff3_shell.cpp (-2 / +2 lines)
Lines 54-60 KDiff3Shell::KDiff3Shell(bool bCompleteInit) Link Here
54
54
55
        if(bCompleteInit)
55
        if(bCompleteInit)
56
            m_widget->completeInit(QString());
56
            m_widget->completeInit(QString());
57
        chk_connect(m_widget, &KDiff3App::createNewInstance, this, &KDiff3Shell::slotNewInstance);
57
        connect(m_widget, &KDiff3App::createNewInstance, this, &KDiff3Shell::slotNewInstance);
58
    }
58
    }
59
    else
59
    else
60
    {
60
    {
Lines 140-146 void KDiff3Shell::optionsConfigureToolbars() Link Here
140
140
141
    // use the standard toolbar editor
141
    // use the standard toolbar editor
142
    KEditToolBar dlg(factory());
142
    KEditToolBar dlg(factory());
143
    chk_connect(&dlg, &KEditToolBar::newToolBarConfig, this, &KDiff3Shell::applyNewToolbarConfig);
143
    connect(&dlg, &KEditToolBar::newToolBarConfig, this, &KDiff3Shell::applyNewToolbarConfig);
144
    dlg.exec();
144
    dlg.exec();
145
}
145
}
146
146
(-)a/src/mergeresultwindow.cpp (-47 / +47 lines)
Lines 76-87 MergeResultWindow::MergeResultWindow( Link Here
76
76
77
    m_pStatusBar = pStatusBar;
77
    m_pStatusBar = pStatusBar;
78
    if(m_pStatusBar != nullptr)
78
    if(m_pStatusBar != nullptr)
79
        chk_connect(m_pStatusBar, &QStatusBar::messageChanged, this, &MergeResultWindow::slotStatusMessageChanged);
79
        connect(m_pStatusBar, &QStatusBar::messageChanged, this, &MergeResultWindow::slotStatusMessageChanged);
80
80
81
    m_pOptions = pOptions;
81
    m_pOptions = pOptions;
82
    setUpdatesEnabled(false);
82
    setUpdatesEnabled(false);
83
83
84
    chk_connect(&m_cursorTimer, &QTimer::timeout, this, &MergeResultWindow::slotCursorUpdate);
84
    connect(&m_cursorTimer, &QTimer::timeout, this, &MergeResultWindow::slotCursorUpdate);
85
    m_cursorTimer.setSingleShot(true);
85
    m_cursorTimer.setSingleShot(true);
86
    m_cursorTimer.start(500 /*ms*/);
86
    m_cursorTimer.start(500 /*ms*/);
87
    m_selection.reset();
87
    m_selection.reset();
Lines 154-210 void MergeResultWindow::initActions(KActionCollection* ac) Link Here
154
154
155
void MergeResultWindow::connectActions() const
155
void MergeResultWindow::connectActions() const
156
{
156
{
157
    chk_connect(chooseAEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseAEverywhere);
157
    connect(chooseAEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseAEverywhere);
158
    chk_connect(chooseBEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseBEverywhere);
158
    connect(chooseBEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseBEverywhere);
159
    chk_connect(chooseCEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseCEverywhere);
159
    connect(chooseCEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseCEverywhere);
160
160
161
    chk_connect(chooseAForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedConflicts);
161
    connect(chooseAForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedConflicts);
162
    chk_connect(chooseBForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedConflicts);
162
    connect(chooseBForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedConflicts);
163
    chk_connect(chooseCForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedConflicts);
163
    connect(chooseCForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedConflicts);
164
164
165
    chk_connect(chooseAForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedWhiteSpaceConflicts);
165
    connect(chooseAForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedWhiteSpaceConflicts);
166
    chk_connect(chooseBForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedWhiteSpaceConflicts);
166
    connect(chooseBForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedWhiteSpaceConflicts);
167
    chk_connect(chooseCForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedWhiteSpaceConflicts);
167
    connect(chooseCForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedWhiteSpaceConflicts);
168
}
168
}
169
169
170
void MergeResultWindow::setupConnections(const KDiff3App* app)
170
void MergeResultWindow::setupConnections(const KDiff3App* app)
171
{
171
{
172
    chk_connect(app, &KDiff3App::cut, this, &MergeResultWindow::slotCut);
172
    connect(app, &KDiff3App::cut, this, &MergeResultWindow::slotCut);
173
    chk_connect(app, &KDiff3App::copy, this, &MergeResultWindow::slotCopy);
173
    connect(app, &KDiff3App::copy, this, &MergeResultWindow::slotCopy);
174
    chk_connect(app, &KDiff3App::selectAll, this, &MergeResultWindow::slotSelectAll);
174
    connect(app, &KDiff3App::selectAll, this, &MergeResultWindow::slotSelectAll);
175
175
176
    chk_connect(this, &MergeResultWindow::scrollMergeResultWindow, app, &KDiff3App::scrollMergeResultWindow);
176
    connect(this, &MergeResultWindow::scrollMergeResultWindow, app, &KDiff3App::scrollMergeResultWindow);
177
    chk_connect(this, &MergeResultWindow::sourceMask, app, &KDiff3App::sourceMask);
177
    connect(this, &MergeResultWindow::sourceMask, app, &KDiff3App::sourceMask);
178
    chk_connect(this, &MergeResultWindow::resizeSignal, app, &KDiff3App::setHScrollBarRange);
178
    connect(this, &MergeResultWindow::resizeSignal, app, &KDiff3App::setHScrollBarRange);
179
    chk_connect(this, &MergeResultWindow::resizeSignal, this, &MergeResultWindow::slotResize);
179
    connect(this, &MergeResultWindow::resizeSignal, this, &MergeResultWindow::slotResize);
180
180
181
    chk_connect(this, &MergeResultWindow::selectionEnd, app, &KDiff3App::slotSelectionEnd);
181
    connect(this, &MergeResultWindow::selectionEnd, app, &KDiff3App::slotSelectionEnd);
182
    chk_connect(this, &MergeResultWindow::newSelection, app, &KDiff3App::slotSelectionStart);
182
    connect(this, &MergeResultWindow::newSelection, app, &KDiff3App::slotSelectionStart);
183
    chk_connect(this, &MergeResultWindow::modifiedChanged, app, &KDiff3App::slotOutputModified);
183
    connect(this, &MergeResultWindow::modifiedChanged, app, &KDiff3App::slotOutputModified);
184
    chk_connect(this, &MergeResultWindow::updateAvailabilities, app, &KDiff3App::slotUpdateAvailabilities);
184
    connect(this, &MergeResultWindow::updateAvailabilities, app, &KDiff3App::slotUpdateAvailabilities);
185
    chk_connect(this, &MergeResultWindow::showPopupMenu, app, &KDiff3App::showPopupMenu);
185
    connect(this, &MergeResultWindow::showPopupMenu, app, &KDiff3App::showPopupMenu);
186
    chk_connect(this, &MergeResultWindow::noRelevantChangesDetected, app, &KDiff3App::slotNoRelevantChangesDetected);
186
    connect(this, &MergeResultWindow::noRelevantChangesDetected, app, &KDiff3App::slotNoRelevantChangesDetected);
187
    chk_connect(this, &MergeResultWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg);
187
    connect(this, &MergeResultWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg);
188
    //connect menu actions
188
    //connect menu actions
189
    chk_connect(app, &KDiff3App::showWhiteSpaceToggled, this, static_cast<void (MergeResultWindow::*)(void)>(&MergeResultWindow::update));
189
    connect(app, &KDiff3App::showWhiteSpaceToggled, this, static_cast<void (MergeResultWindow::*)(void)>(&MergeResultWindow::update));
190
    chk_connect(app, &KDiff3App::doRefresh, this, &MergeResultWindow::slotRefresh);
190
    connect(app, &KDiff3App::doRefresh, this, &MergeResultWindow::slotRefresh);
191
191
192
    chk_connect(app, &KDiff3App::autoSolve, this, &MergeResultWindow::slotAutoSolve);
192
    connect(app, &KDiff3App::autoSolve, this, &MergeResultWindow::slotAutoSolve);
193
    chk_connect(app, &KDiff3App::unsolve, this, &MergeResultWindow::slotUnsolve);
193
    connect(app, &KDiff3App::unsolve, this, &MergeResultWindow::slotUnsolve);
194
    chk_connect(app, &KDiff3App::mergeHistory, this, &MergeResultWindow::slotMergeHistory);
194
    connect(app, &KDiff3App::mergeHistory, this, &MergeResultWindow::slotMergeHistory);
195
    chk_connect(app, &KDiff3App::regExpAutoMerge, this, &MergeResultWindow::slotRegExpAutoMerge);
195
    connect(app, &KDiff3App::regExpAutoMerge, this, &MergeResultWindow::slotRegExpAutoMerge);
196
196
197
    chk_connect(app, &KDiff3App::goCurrent, this, &MergeResultWindow::slotGoCurrent);
197
    connect(app, &KDiff3App::goCurrent, this, &MergeResultWindow::slotGoCurrent);
198
    chk_connect(app, &KDiff3App::goTop, this, &MergeResultWindow::slotGoTop);
198
    connect(app, &KDiff3App::goTop, this, &MergeResultWindow::slotGoTop);
199
    chk_connect(app, &KDiff3App::goBottom, this, &MergeResultWindow::slotGoBottom);
199
    connect(app, &KDiff3App::goBottom, this, &MergeResultWindow::slotGoBottom);
200
    chk_connect(app, &KDiff3App::goPrevUnsolvedConflict, this, &MergeResultWindow::slotGoPrevUnsolvedConflict);
200
    connect(app, &KDiff3App::goPrevUnsolvedConflict, this, &MergeResultWindow::slotGoPrevUnsolvedConflict);
201
    chk_connect(app, &KDiff3App::goNextUnsolvedConflict, this, &MergeResultWindow::slotGoNextUnsolvedConflict);
201
    connect(app, &KDiff3App::goNextUnsolvedConflict, this, &MergeResultWindow::slotGoNextUnsolvedConflict);
202
    chk_connect(app, &KDiff3App::goPrevConflict, this, &MergeResultWindow::slotGoPrevConflict);
202
    connect(app, &KDiff3App::goPrevConflict, this, &MergeResultWindow::slotGoPrevConflict);
203
    chk_connect(app, &KDiff3App::goNextConflict, this, &MergeResultWindow::slotGoNextConflict);
203
    connect(app, &KDiff3App::goNextConflict, this, &MergeResultWindow::slotGoNextConflict);
204
    chk_connect(app, &KDiff3App::goPrevDelta, this, &MergeResultWindow::slotGoPrevDelta);
204
    connect(app, &KDiff3App::goPrevDelta, this, &MergeResultWindow::slotGoPrevDelta);
205
    chk_connect(app, &KDiff3App::goNextDelta, this, &MergeResultWindow::slotGoNextDelta);
205
    connect(app, &KDiff3App::goNextDelta, this, &MergeResultWindow::slotGoNextDelta);
206
206
207
    chk_connect(app, &KDiff3App::changeOverViewMode, this, &MergeResultWindow::setOverviewMode);
207
    connect(app, &KDiff3App::changeOverViewMode, this, &MergeResultWindow::setOverviewMode);
208
208
209
    connections.push_back(KDiff3App::allowCut.connect(boost::bind(&MergeResultWindow::canCut, this)));
209
    connections.push_back(KDiff3App::allowCut.connect(boost::bind(&MergeResultWindow::canCut, this)));
210
    connections.push_back(KDiff3App::allowCopy.connect(boost::bind(&MergeResultWindow::canCopy, this)));
210
    connections.push_back(KDiff3App::allowCopy.connect(boost::bind(&MergeResultWindow::canCopy, this)));
Lines 3084-3090 WindowTitleWidget::WindowTitleWidget(const QSharedPointer<Options>& pOptions) Link Here
3084
3084
3085
    //m_pBrowseButton = new QPushButton("...");
3085
    //m_pBrowseButton = new QPushButton("...");
3086
    //pHLayout->addWidget( m_pBrowseButton, 0 );
3086
    //pHLayout->addWidget( m_pBrowseButton, 0 );
3087
    //chk_connect( m_pBrowseButton, &QPushButton::clicked), this, &MergeResultWindow::slotBrowseButtonClicked);
3087
    //connect( m_pBrowseButton, &QPushButton::clicked), this, &MergeResultWindow::slotBrowseButtonClicked);
3088
3088
3089
    m_pModifiedLabel = new QLabel(i18n("[Modified]"));
3089
    m_pModifiedLabel = new QLabel(i18n("[Modified]"));
3090
    pHLayout->addWidget(m_pModifiedLabel);
3090
    pHLayout->addWidget(m_pModifiedLabel);
(-)a/src/optiondialog.cpp (-13 / +13 lines)
Lines 113-119 FontChooser::FontChooser(QWidget* pParent) Link Here
113
113
114
    m_pSelectFont = new QPushButton(i18n("Change Font"));
114
    m_pSelectFont = new QPushButton(i18n("Change Font"));
115
    m_pSelectFont->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
115
    m_pSelectFont->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
116
    chk_connect(m_pSelectFont, &QPushButton::clicked, this, &FontChooser::slotSelectFont);
116
    connect(m_pSelectFont, &QPushButton::clicked, this, &FontChooser::slotSelectFont);
117
    pLayout->addWidget(m_pSelectFont);
117
    pLayout->addWidget(m_pSelectFont);
118
    pLayout->setAlignment(m_pSelectFont, Qt::AlignRight);
118
    pLayout->setAlignment(m_pSelectFont, Qt::AlignRight);
119
}
119
}
Lines 512-522 OptionDialog::OptionDialog(bool bShowDirMergeSettings, QWidget* parent) : KPageD Link Here
512
    // Initialize all values in the dialog
512
    // Initialize all values in the dialog
513
    resetToDefaults();
513
    resetToDefaults();
514
    slotApply();
514
    slotApply();
515
    chk_connect(button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &OptionDialog::slotApply);
515
    connect(button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &OptionDialog::slotApply);
516
    chk_connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &OptionDialog::slotOk);
516
    connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &OptionDialog::slotOk);
517
    chk_connect(button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, &OptionDialog::slotDefault);
517
    connect(button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, &OptionDialog::slotDefault);
518
    chk_connect(button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &QDialog::reject);
518
    connect(button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &QDialog::reject);
519
    chk_connect(button(QDialogButtonBox::Help), &QPushButton::clicked, this, &OptionDialog::helpRequested);
519
    connect(button(QDialogButtonBox::Help), &QPushButton::clicked, this, &OptionDialog::helpRequested);
520
}
520
}
521
521
522
void OptionDialog::helpRequested()
522
void OptionDialog::helpRequested()
Lines 1073-1079 void OptionDialog::setupMergePage() Link Here
1073
        addOptionItem(m_pHistorySortKeyOrderLineEdit);
1073
        addOptionItem(m_pHistorySortKeyOrderLineEdit);
1074
        label->setToolTip(s_historyEntryStartSortKeyOrderToolTip);
1074
        label->setToolTip(s_historyEntryStartSortKeyOrderToolTip);
1075
        m_pHistorySortKeyOrderLineEdit->setEnabled(false);
1075
        m_pHistorySortKeyOrderLineEdit->setEnabled(false);
1076
        chk_connect(m_pHistoryMergeSorting, &OptionCheckBox::toggled, m_pHistorySortKeyOrderLineEdit, &OptionLineEdit::setEnabled);
1076
        connect(m_pHistoryMergeSorting, &OptionCheckBox::toggled, m_pHistorySortKeyOrderLineEdit, &OptionLineEdit::setEnabled);
1077
        ++line;
1077
        ++line;
1078
1078
1079
        m_pHistoryAutoMerge = new OptionCheckBox(i18n("Merge version control history on merge start"), false, "RunHistoryAutoMergeOnMergeStart", &m_options->m_bRunHistoryAutoMergeOnMergeStart, page);
1079
        m_pHistoryAutoMerge = new OptionCheckBox(i18n("Merge version control history on merge start"), false, "RunHistoryAutoMergeOnMergeStart", &m_options->m_bRunHistoryAutoMergeOnMergeStart, page);
Lines 1093-1099 void OptionDialog::setupMergePage() Link Here
1093
1093
1094
    QPushButton* pButton = new QPushButton(i18n("Test your regular expressions"), page);
1094
    QPushButton* pButton = new QPushButton(i18n("Test your regular expressions"), page);
1095
    gbox->addWidget(pButton, line, 0);
1095
    gbox->addWidget(pButton, line, 0);
1096
    chk_connect(pButton, &QPushButton::clicked, this, &OptionDialog::slotHistoryMergeRegExpTester);
1096
    connect(pButton, &QPushButton::clicked, this, &OptionDialog::slotHistoryMergeRegExpTester);
1097
    ++line;
1097
    ++line;
1098
1098
1099
    label = new QLabel(i18n("Irrelevant merge command:"), page);
1099
    label = new QLabel(i18n("Irrelevant merge command:"), page);
Lines 1294-1300 void OptionDialog::setupDirectoryMergePage() Link Here
1294
    pWhiteSpaceDiffsEqual->setToolTip(i18n(
1294
    pWhiteSpaceDiffsEqual->setToolTip(i18n(
1295
        "If files differ only by white space consider them equal.\n"
1295
        "If files differ only by white space consider them equal.\n"
1296
        "This is only active when full analysis is chosen."));
1296
        "This is only active when full analysis is chosen."));
1297
    chk_connect(pFullAnalysis, &OptionRadioButton::toggled, pWhiteSpaceDiffsEqual, &OptionCheckBox::setEnabled);
1297
    connect(pFullAnalysis, &OptionRadioButton::toggled, pWhiteSpaceDiffsEqual, &OptionCheckBox::setEnabled);
1298
    pWhiteSpaceDiffsEqual->setEnabled(false);
1298
    pWhiteSpaceDiffsEqual->setEnabled(false);
1299
    ++line;
1299
    ++line;
1300
1300
Lines 1413-1422 void OptionDialog::setupRegionalPage() Link Here
1413
    gbox->addWidget(m_pEncodingPPComboBox, line, 1);
1413
    gbox->addWidget(m_pEncodingPPComboBox, line, 1);
1414
    ++line;
1414
    ++line;
1415
1415
1416
    chk_connect(m_pSameEncoding, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged);
1416
    connect(m_pSameEncoding, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged);
1417
    chk_connect(m_pEncodingAComboBox, static_cast<void (OptionEncodingComboBox::*)(int)>(&OptionEncodingComboBox::activated), this, &OptionDialog::slotEncodingChanged);
1417
    connect(m_pEncodingAComboBox, static_cast<void (OptionEncodingComboBox::*)(int)>(&OptionEncodingComboBox::activated), this, &OptionDialog::slotEncodingChanged);
1418
    chk_connect(m_pAutoDetectUnicodeA, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged);
1418
    connect(m_pAutoDetectUnicodeA, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged);
1419
    chk_connect(m_pAutoSelectOutEncoding, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged);
1419
    connect(m_pAutoSelectOutEncoding, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged);
1420
1420
1421
    OptionCheckBox* pRightToLeftLanguage = new OptionCheckBox(i18n("Right To Left Language"), false, "RightToLeftLanguage", &m_options->m_bRightToLeftLanguage, page);
1421
    OptionCheckBox* pRightToLeftLanguage = new OptionCheckBox(i18n("Right To Left Language"), false, "RightToLeftLanguage", &m_options->m_bRightToLeftLanguage, page);
1422
    addOptionItem(pRightToLeftLanguage);
1422
    addOptionItem(pRightToLeftLanguage);
(-)a/src/pdiff.cpp (-28 / +28 lines)
Lines 585-593 void KDiff3App::initView() Link Here
585
    DiffTextWindow::mVScrollBar = new QScrollBar(Qt::Vertical, pDiffWindowFrame);
585
    DiffTextWindow::mVScrollBar = new QScrollBar(Qt::Vertical, pDiffWindowFrame);
586
    pDiffHLayout->addWidget(DiffTextWindow::mVScrollBar);
586
    pDiffHLayout->addWidget(DiffTextWindow::mVScrollBar);
587
587
588
    chk_connect(m_pOverview, &Overview::setLine, DiffTextWindow::mVScrollBar, &QScrollBar::setValue);
588
    connect(m_pOverview, &Overview::setLine, DiffTextWindow::mVScrollBar, &QScrollBar::setValue);
589
    chk_connect(this, &KDiff3App::showWhiteSpaceToggled, m_pOverview, &Overview::slotRedraw);
589
    connect(this, &KDiff3App::showWhiteSpaceToggled, m_pOverview, &Overview::slotRedraw);
590
    chk_connect(this, &KDiff3App::changeOverViewMode, m_pOverview, &Overview::setOverviewMode);
590
    connect(this, &KDiff3App::changeOverViewMode, m_pOverview, &Overview::setOverviewMode);
591
591
592
    m_pDiffTextWindowFrame1 = new DiffTextWindowFrame(m_pDiffWindowSplitter, m_pOptionDialog->getOptions(), e_SrcSelector::A, m_sd1);
592
    m_pDiffTextWindowFrame1 = new DiffTextWindowFrame(m_pDiffWindowSplitter, m_pOptionDialog->getOptions(), e_SrcSelector::A, m_sd1);
593
    m_pDiffWindowSplitter->addWidget(m_pDiffTextWindowFrame1);
593
    m_pDiffWindowSplitter->addWidget(m_pDiffTextWindowFrame1);
Lines 647-689 void KDiff3App::initView() Link Here
647
    m_pCornerWidget = new QWidget(m_pMainWidget);
647
    m_pCornerWidget = new QWidget(m_pMainWidget);
648
    pHScrollBarLayout->addWidget(m_pCornerWidget);
648
    pHScrollBarLayout->addWidget(m_pCornerWidget);
649
649
650
    chk_connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pOverview, &Overview::setFirstLine);
650
    connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pOverview, &Overview::setFirstLine);
651
    chk_connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow1, &DiffTextWindow::setFirstLine);
651
    connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow1, &DiffTextWindow::setFirstLine);
652
    chk_connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow1, &DiffTextWindow::setHorizScrollOffset);
652
    connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow1, &DiffTextWindow::setHorizScrollOffset);
653
    m_pDiffTextWindow1->setupConnections(this);
653
    m_pDiffTextWindow1->setupConnections(this);
654
654
655
    chk_connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow2, &DiffTextWindow::setFirstLine);
655
    connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow2, &DiffTextWindow::setFirstLine);
656
    chk_connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow2, &DiffTextWindow::setHorizScrollOffset);
656
    connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow2, &DiffTextWindow::setHorizScrollOffset);
657
    m_pDiffTextWindow2->setupConnections(this);
657
    m_pDiffTextWindow2->setupConnections(this);
658
658
659
    chk_connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow3, &DiffTextWindow::setFirstLine);
659
    connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow3, &DiffTextWindow::setFirstLine);
660
    chk_connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow3, &DiffTextWindow::setHorizScrollOffset);
660
    connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow3, &DiffTextWindow::setHorizScrollOffset);
661
    m_pDiffTextWindow3->setupConnections(this);
661
    m_pDiffTextWindow3->setupConnections(this);
662
662
663
    MergeResultWindow* p = m_pMergeResultWindow;
663
    MergeResultWindow* p = m_pMergeResultWindow;
664
    chk_connect(MergeResultWindow::mVScrollBar, &QScrollBar::valueChanged, p, &MergeResultWindow::setFirstLine);
664
    connect(MergeResultWindow::mVScrollBar, &QScrollBar::valueChanged, p, &MergeResultWindow::setFirstLine);
665
665
666
    chk_connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, p, &MergeResultWindow::setHorizScrollOffset);
666
    connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, p, &MergeResultWindow::setHorizScrollOffset);
667
    chk_connect(p, &MergeResultWindow::modifiedChanged, m_pMergeResultWindowTitle, &WindowTitleWidget::slotSetModified);
667
    connect(p, &MergeResultWindow::modifiedChanged, m_pMergeResultWindowTitle, &WindowTitleWidget::slotSetModified);
668
    p->setupConnections(this);
668
    p->setupConnections(this);
669
    sourceMask(0, 0);
669
    sourceMask(0, 0);
670
670
671
    chk_connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow1, &DiffTextWindow::setFastSelectorRange);
671
    connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow1, &DiffTextWindow::setFastSelectorRange);
672
    chk_connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow2, &DiffTextWindow::setFastSelectorRange);
672
    connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow2, &DiffTextWindow::setFastSelectorRange);
673
    chk_connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow3, &DiffTextWindow::setFastSelectorRange);
673
    connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow3, &DiffTextWindow::setFastSelectorRange);
674
    chk_connect(m_pDiffTextWindow1, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine);
674
    connect(m_pDiffTextWindow1, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine);
675
    chk_connect(m_pDiffTextWindow2, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine);
675
    connect(m_pDiffTextWindow2, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine);
676
    chk_connect(m_pDiffTextWindow3, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine);
676
    connect(m_pDiffTextWindow3, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine);
677
    chk_connect(m_pDiffTextWindow1, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask);
677
    connect(m_pDiffTextWindow1, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask);
678
    chk_connect(m_pDiffTextWindow2, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask);
678
    connect(m_pDiffTextWindow2, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask);
679
    chk_connect(m_pDiffTextWindow3, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask);
679
    connect(m_pDiffTextWindow3, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask);
680
    chk_connect(m_pDirectoryMergeInfo, &DirectoryMergeInfo::gotFocus, p, &MergeResultWindow::updateSourceMask);
680
    connect(m_pDirectoryMergeInfo, &DirectoryMergeInfo::gotFocus, p, &MergeResultWindow::updateSourceMask);
681
681
682
    chk_connect(m_pDiffTextWindow1, &DiffTextWindow::resizeHeightChangedSignal, this, &KDiff3App::resizeDiffTextWindowHeight);
682
    connect(m_pDiffTextWindow1, &DiffTextWindow::resizeHeightChangedSignal, this, &KDiff3App::resizeDiffTextWindowHeight);
683
    // The following two connects cause the wordwrap to be recalced thrice, just to make sure. Better than forgetting one.
683
    // The following two connects cause the wordwrap to be recalced thrice, just to make sure. Better than forgetting one.
684
    chk_connect(m_pDiffTextWindow1, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap);
684
    connect(m_pDiffTextWindow1, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap);
685
    chk_connect(m_pDiffTextWindow2, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap);
685
    connect(m_pDiffTextWindow2, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap);
686
    chk_connect(m_pDiffTextWindow3, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap);
686
    connect(m_pDiffTextWindow3, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap);
687
687
688
    m_pDiffTextWindow1->setFocus();
688
    m_pDiffTextWindow1->setFocus();
689
    m_pMainWidget->setMinimumSize(50, 50);
689
    m_pMainWidget->setMinimumSize(50, 50);
(-)a/src/progress.cpp (-2 / +2 lines)
Lines 58-64 ProgressDialog::ProgressDialog(QWidget* pParent, QStatusBar* pStatusBar) Link Here
58
    hlayout->addStretch(1);
58
    hlayout->addStretch(1);
59
    m_pAbortButton = new QPushButton(i18n("&Cancel"), this);
59
    m_pAbortButton = new QPushButton(i18n("&Cancel"), this);
60
    hlayout->addWidget(m_pAbortButton);
60
    hlayout->addWidget(m_pAbortButton);
61
    chk_connect(m_pAbortButton, &QPushButton::clicked, this, &ProgressDialog::slotAbort);
61
    connect(m_pAbortButton, &QPushButton::clicked, this, &ProgressDialog::slotAbort);
62
    if(m_pStatusBar != nullptr)
62
    if(m_pStatusBar != nullptr)
63
    {
63
    {
64
        m_pStatusBarWidget = new QWidget;
64
        m_pStatusBarWidget = new QWidget;
Lines 69-75 ProgressDialog::ProgressDialog(QWidget* pParent, QStatusBar* pStatusBar) Link Here
69
        m_pStatusProgressBar->setRange(0, 1000);
69
        m_pStatusProgressBar->setRange(0, 1000);
70
        m_pStatusProgressBar->setTextVisible(false);
70
        m_pStatusProgressBar->setTextVisible(false);
71
        m_pStatusAbortButton = new QPushButton(i18n("&Cancel"));
71
        m_pStatusAbortButton = new QPushButton(i18n("&Cancel"));
72
        chk_connect(m_pStatusAbortButton, &QPushButton::clicked, this, &ProgressDialog::slotAbort);
72
        connect(m_pStatusAbortButton, &QPushButton::clicked, this, &ProgressDialog::slotAbort);
73
        pStatusBarLayout->addWidget(m_pStatusProgressBar);
73
        pStatusBarLayout->addWidget(m_pStatusProgressBar);
74
        pStatusBarLayout->addWidget(m_pStatusAbortButton);
74
        pStatusBarLayout->addWidget(m_pStatusAbortButton);
75
        m_pStatusBar->addPermanentWidget(m_pStatusBarWidget, 0);
75
        m_pStatusBar->addPermanentWidget(m_pStatusBarWidget, 0);
(-)a/src/smalldialogs.cpp (-30 / +30 lines)
Lines 49-58 OpenDialog::OpenDialog( Link Here
49
    dialogUi.lineA->setEditText(n1);
49
    dialogUi.lineA->setEditText(n1);
50
50
51
    QPushButton* button = dialogUi.fileSelectA;
51
    QPushButton* button = dialogUi.fileSelectA;
52
    chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectFileA);
52
    connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileA);
53
    QPushButton* button2 = dialogUi.folderSelectA;
53
    QPushButton* button2 = dialogUi.folderSelectA;
54
    chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectDirA);
54
    connect(button2, &QPushButton::clicked, this, &OpenDialog::selectDirA);
55
    chk_connect_a(dialogUi.lineA, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged);
55
    connect(dialogUi.lineA, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged);
56
56
57
    dialogUi.lineB->setEditable(true);
57
    dialogUi.lineB->setEditable(true);
58
    dialogUi.lineB->insertItems(0, m_pOptions->m_recentBFiles);
58
    dialogUi.lineB->insertItems(0, m_pOptions->m_recentBFiles);
Lines 60-79 OpenDialog::OpenDialog( Link Here
60
60
61
    dialogUi.lineB->setMinimumWidth(200);
61
    dialogUi.lineB->setMinimumWidth(200);
62
    button = dialogUi.fileSelectB;
62
    button = dialogUi.fileSelectB;
63
    chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectFileB);
63
    connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileB);
64
    button2 = dialogUi.folderSelectB;
64
    button2 = dialogUi.folderSelectB;
65
    chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectDirB);
65
    connect(button2, &QPushButton::clicked, this, &OpenDialog::selectDirB);
66
    chk_connect_a(dialogUi.lineB, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged);
66
    connect(dialogUi.lineB, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged);
67
67
68
    dialogUi.lineC->setEditable(true);
68
    dialogUi.lineC->setEditable(true);
69
    dialogUi.lineC->insertItems(0, m_pOptions->m_recentCFiles);
69
    dialogUi.lineC->insertItems(0, m_pOptions->m_recentCFiles);
70
    dialogUi.lineC->setEditText(n3);
70
    dialogUi.lineC->setEditText(n3);
71
    dialogUi.lineC->setMinimumWidth(200);
71
    dialogUi.lineC->setMinimumWidth(200);
72
    button = dialogUi.fileSelectC;
72
    button = dialogUi.fileSelectC;
73
    chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectFileC);
73
    connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileC);
74
    button2 = dialogUi.folderSelectC;
74
    button2 = dialogUi.folderSelectC;
75
    chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectDirC);
75
    connect(button2, &QPushButton::clicked, this, &OpenDialog::selectDirC);
76
    chk_connect_a(dialogUi.lineC, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged);
76
    connect(dialogUi.lineC, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged);
77
77
78
    button = dialogUi.swapCopy;
78
    button = dialogUi.swapCopy;
79
79
Lines 87-115 OpenDialog::OpenDialog( Link Here
87
    m->addAction(i18n("Swap %1<->Output", i18n("A")));
87
    m->addAction(i18n("Swap %1<->Output", i18n("A")));
88
    m->addAction(i18n("Swap %1<->Output", i18n("B")));
88
    m->addAction(i18n("Swap %1<->Output", i18n("B")));
89
    m->addAction(i18n("Swap %1<->Output", i18n("C")));
89
    m->addAction(i18n("Swap %1<->Output", i18n("C")));
90
    chk_connect_a(m, &QMenu::triggered, this, &OpenDialog::slotSwapCopyNames);
90
    connect(m, &QMenu::triggered, this, &OpenDialog::slotSwapCopyNames);
91
    button->setMenu(m);
91
    button->setMenu(m);
92
92
93
    dialogUi.lineOut->insertItems(0, m_pOptions->m_recentOutputFiles);
93
    dialogUi.lineOut->insertItems(0, m_pOptions->m_recentOutputFiles);
94
    dialogUi.lineOut->setEditText(outputName);
94
    dialogUi.lineOut->setEditText(outputName);
95
95
96
    button = dialogUi.selectOutputFile;
96
    button = dialogUi.selectOutputFile;
97
    chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectOutputName);
97
    connect(button, &QPushButton::clicked, this, &OpenDialog::selectOutputName);
98
    button2 = dialogUi.selectOutputFolder;
98
    button2 = dialogUi.selectOutputFolder;
99
    chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectOutputDir);
99
    connect(button2, &QPushButton::clicked, this, &OpenDialog::selectOutputDir);
100
    chk_connect_a(dialogUi.mergeCheckBox, &QCheckBox::stateChanged, this, &OpenDialog::internalSlot);
100
    connect(dialogUi.mergeCheckBox, &QCheckBox::stateChanged, this, &OpenDialog::internalSlot);
101
    chk_connect_a(this, &OpenDialog::internalSignal, dialogUi.lineOut, &QComboBox::setEnabled);
101
    connect(this, &OpenDialog::internalSignal, dialogUi.lineOut, &QComboBox::setEnabled);
102
    chk_connect_a(this, &OpenDialog::internalSignal, button, &QPushButton::setEnabled);
102
    connect(this, &OpenDialog::internalSignal, button, &QPushButton::setEnabled);
103
    chk_connect_a(this, &OpenDialog::internalSignal, button2, &QPushButton::setEnabled);
103
    connect(this, &OpenDialog::internalSignal, button2, &QPushButton::setEnabled);
104
104
105
    dialogUi.mergeCheckBox->setChecked(bMerge);
105
    dialogUi.mergeCheckBox->setChecked(bMerge);
106
106
107
    QDialogButtonBox *box = dialogUi.buttonBox;
107
    QDialogButtonBox *box = dialogUi.buttonBox;
108
    button = box->addButton(i18n("Configure..."), QDialogButtonBox::ActionRole);
108
    button = box->addButton(i18n("Configure..."), QDialogButtonBox::ActionRole);
109
    button->setIcon(QIcon::fromTheme("configure"));
109
    button->setIcon(QIcon::fromTheme("configure"));
110
    chk_connect_a(button, &QPushButton::clicked, pParent, &KDiff3App::slotConfigure);
110
    connect(button, &QPushButton::clicked, pParent, &KDiff3App::slotConfigure);
111
    chk_connect_a(box, &QDialogButtonBox::accepted, this, &OpenDialog::accept);
111
    connect(box, &QDialogButtonBox::accepted, this, &OpenDialog::accept);
112
    chk_connect_a(box, &QDialogButtonBox::rejected, this, &OpenDialog::reject);
112
    connect(box, &QDialogButtonBox::rejected, this, &OpenDialog::reject);
113
113
114
    QSize sh = sizeHint();
114
    QSize sh = sizeHint();
115
    if(sh.height() > 10)
115
    if(sh.height() > 10)
Lines 354-361 FindDialog::FindDialog(QWidget* pParent) Link Here
354
    QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Cancel, this);
354
    QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Cancel, this);
355
    layout->addWidget(box, line, 0, 1, 2);
355
    layout->addWidget(box, line, 0, 1, 2);
356
    box->addButton(i18n("&Search"), QDialogButtonBox::AcceptRole);
356
    box->addButton(i18n("&Search"), QDialogButtonBox::AcceptRole);
357
    chk_connect(box, &QDialogButtonBox::accepted, this, &FindDialog::accept);
357
    connect(box, &QDialogButtonBox::accepted, this, &FindDialog::accept);
358
    chk_connect(box, &QDialogButtonBox::rejected, this, &FindDialog::reject);
358
    connect(box, &QDialogButtonBox::rejected, this, &FindDialog::reject);
359
359
360
    hide();
360
    hide();
361
}
361
}
Lines 389-395 RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT Link Here
389
    l->setToolTip(autoMergeRegExpToolTip);
389
    l->setToolTip(autoMergeRegExpToolTip);
390
    m_pAutoMergeRegExpEdit = new QLineEdit(this);
390
    m_pAutoMergeRegExpEdit = new QLineEdit(this);
391
    pGrid->addWidget(m_pAutoMergeRegExpEdit, line, 1);
391
    pGrid->addWidget(m_pAutoMergeRegExpEdit, line, 1);
392
    chk_connect(m_pAutoMergeRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
392
    connect(m_pAutoMergeRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
393
    ++line;
393
    ++line;
394
394
395
    l = new QLabel(i18n("Example auto merge line:"), this);
395
    l = new QLabel(i18n("Example auto merge line:"), this);
Lines 397-403 RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT Link Here
397
    l->setToolTip(i18n("To test auto merge, copy a line as used in your files."));
397
    l->setToolTip(i18n("To test auto merge, copy a line as used in your files."));
398
    m_pAutoMergeExampleEdit = new QLineEdit(this);
398
    m_pAutoMergeExampleEdit = new QLineEdit(this);
399
    pGrid->addWidget(m_pAutoMergeExampleEdit, line, 1);
399
    pGrid->addWidget(m_pAutoMergeExampleEdit, line, 1);
400
    chk_connect(m_pAutoMergeExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
400
    connect(m_pAutoMergeExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
401
    ++line;
401
    ++line;
402
402
403
    l = new QLabel(i18n("Match result:"), this);
403
    l = new QLabel(i18n("Match result:"), this);
Lines 416-422 RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT Link Here
416
    l->setToolTip(historyStartRegExpToolTip);
416
    l->setToolTip(historyStartRegExpToolTip);
417
    m_pHistoryStartRegExpEdit = new QLineEdit(this);
417
    m_pHistoryStartRegExpEdit = new QLineEdit(this);
418
    pGrid->addWidget(m_pHistoryStartRegExpEdit, line, 1);
418
    pGrid->addWidget(m_pHistoryStartRegExpEdit, line, 1);
419
    chk_connect(m_pHistoryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
419
    connect(m_pHistoryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
420
    ++line;
420
    ++line;
421
421
422
    l = new QLabel(i18n("Example history start line (with leading comment):"), this);
422
    l = new QLabel(i18n("Example history start line (with leading comment):"), this);
Lines 425-431 RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT Link Here
425
                       "including the leading comment."));
425
                       "including the leading comment."));
426
    m_pHistoryStartExampleEdit = new QLineEdit(this);
426
    m_pHistoryStartExampleEdit = new QLineEdit(this);
427
    pGrid->addWidget(m_pHistoryStartExampleEdit, line, 1);
427
    pGrid->addWidget(m_pHistoryStartExampleEdit, line, 1);
428
    chk_connect(m_pHistoryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
428
    connect(m_pHistoryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
429
    ++line;
429
    ++line;
430
430
431
    l = new QLabel(i18n("Match result:"), this);
431
    l = new QLabel(i18n("Match result:"), this);
Lines 444-450 RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT Link Here
444
    l->setToolTip(historyEntryStartRegExpToolTip);
444
    l->setToolTip(historyEntryStartRegExpToolTip);
445
    m_pHistoryEntryStartRegExpEdit = new QLineEdit(this);
445
    m_pHistoryEntryStartRegExpEdit = new QLineEdit(this);
446
    pGrid->addWidget(m_pHistoryEntryStartRegExpEdit, line, 1);
446
    pGrid->addWidget(m_pHistoryEntryStartRegExpEdit, line, 1);
447
    chk_connect(m_pHistoryEntryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
447
    connect(m_pHistoryEntryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
448
    ++line;
448
    ++line;
449
449
450
    l = new QLabel(i18n("History sort key order:"), this);
450
    l = new QLabel(i18n("History sort key order:"), this);
Lines 452-458 RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT Link Here
452
    l->setToolTip(historySortKeyOrderToolTip);
452
    l->setToolTip(historySortKeyOrderToolTip);
453
    m_pHistorySortKeyOrderEdit = new QLineEdit(this);
453
    m_pHistorySortKeyOrderEdit = new QLineEdit(this);
454
    pGrid->addWidget(m_pHistorySortKeyOrderEdit, line, 1);
454
    pGrid->addWidget(m_pHistorySortKeyOrderEdit, line, 1);
455
    chk_connect(m_pHistorySortKeyOrderEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
455
    connect(m_pHistorySortKeyOrderEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
456
    ++line;
456
    ++line;
457
457
458
    l = new QLabel(i18n("Example history entry start line (without leading comment):"), this);
458
    l = new QLabel(i18n("Example history entry start line (without leading comment):"), this);
Lines 461-467 RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT Link Here
461
                       "but omit the leading comment."));
461
                       "but omit the leading comment."));
462
    m_pHistoryEntryStartExampleEdit = new QLineEdit(this);
462
    m_pHistoryEntryStartExampleEdit = new QLineEdit(this);
463
    pGrid->addWidget(m_pHistoryEntryStartExampleEdit, line, 1);
463
    pGrid->addWidget(m_pHistoryEntryStartExampleEdit, line, 1);
464
    chk_connect(m_pHistoryEntryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
464
    connect(m_pHistoryEntryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc);
465
    ++line;
465
    ++line;
466
466
467
    l = new QLabel(i18n("Match result:"), this);
467
    l = new QLabel(i18n("Match result:"), this);
Lines 480-487 RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT Link Here
480
480
481
    QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
481
    QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
482
    pGrid->addWidget(box, line, 0, 1, 2);
482
    pGrid->addWidget(box, line, 0, 1, 2);
483
    chk_connect(box, &QDialogButtonBox::accepted, this, &RegExpTester::accept);
483
    connect(box, &QDialogButtonBox::accepted, this, &RegExpTester::accept);
484
    chk_connect(box, &QDialogButtonBox::rejected, this, &RegExpTester::reject);
484
    connect(box, &QDialogButtonBox::rejected, this, &RegExpTester::reject);
485
485
486
    resize(800, sizeHint().height());
486
    resize(800, sizeHint().height());
487
}
487
}

Return to bug 789330