diff --git a/src/DefaultFileAccessJobHandler.cpp b/src/DefaultFileAccessJobHandler.cpp index 3e3ea99..e5916b4 100644 --- a/src/DefaultFileAccessJobHandler.cpp +++ b/src/DefaultFileAccessJobHandler.cpp @@ -29,8 +29,8 @@ bool DefaultFileAccessJobHandler::stat(short detail, bool bWantToWrite) bWantToWrite ? KIO::StatJob::DestinationSide : KIO::StatJob::SourceSide, detail, KIO::HideProgressInfo); - chk_connect(pStatJob, &KIO::StatJob::result, this, &DefaultFileAccessJobHandler::slotStatResult); - chk_connect(pStatJob, &KIO::StatJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pStatJob, &KIO::StatJob::result, this, &DefaultFileAccessJobHandler::slotStatResult); + connect(pStatJob, &KIO::StatJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); ProgressProxy::enterEventLoop(pStatJob, i18n("Getting file status: %1", mFileAccess->prettyAbsPath())); @@ -79,10 +79,10 @@ bool DefaultFileAccessJobHandler::get(void* pDestBuffer, long maxLength) m_bSuccess = false; mFileAccess->setStatusText(QString()); - chk_connect(pJob, &KIO::TransferJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); - chk_connect(pJob, &KIO::TransferJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); - chk_connect(pJob, &KIO::TransferJob::data, this, &DefaultFileAccessJobHandler::slotGetData); - chk_connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong))); + connect(pJob, &KIO::TransferJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); + connect(pJob, &KIO::TransferJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pJob, &KIO::TransferJob::data, this, &DefaultFileAccessJobHandler::slotGetData); + connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong))); ProgressProxy::enterEventLoop(pJob, i18n("Reading file: %1", mFileAccess->prettyAbsPath())); return m_bSuccess; @@ -119,10 +119,10 @@ bool DefaultFileAccessJobHandler::put(const void* pSrcBuffer, long maxLength, bo m_bSuccess = false; mFileAccess->setStatusText(QString()); - chk_connect(pJob, &KIO::TransferJob::result, this, &DefaultFileAccessJobHandler::slotPutJobResult); - chk_connect(pJob, &KIO::TransferJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); - chk_connect(pJob, &KIO::TransferJob::dataReq, this, &DefaultFileAccessJobHandler::slotPutData); - chk_connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong))); + connect(pJob, &KIO::TransferJob::result, this, &DefaultFileAccessJobHandler::slotPutJobResult); + connect(pJob, &KIO::TransferJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pJob, &KIO::TransferJob::dataReq, this, &DefaultFileAccessJobHandler::slotPutData); + connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong))); ProgressProxy::enterEventLoop(pJob, i18n("Writing file: %1", mFileAccess->prettyAbsPath())); return m_bSuccess; @@ -192,8 +192,8 @@ bool DefaultFileAccessJobHandler::mkDirImp(const QString& dirName) { m_bSuccess = false; KIO::SimpleJob* pJob = KIO::mkdir(dir.url()); - chk_connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); - chk_connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); + connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); ProgressProxy::enterEventLoop(pJob, i18n("Making folder: %1", dirName)); return m_bSuccess; @@ -214,8 +214,8 @@ bool DefaultFileAccessJobHandler::rmDirImp(const QString& dirName) { m_bSuccess = false; KIO::SimpleJob* pJob = KIO::rmdir(fa.url()); - chk_connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); - chk_connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); + connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); ProgressProxy::enterEventLoop(pJob, i18n("Removing folder: %1", dirName)); return m_bSuccess; @@ -230,8 +230,8 @@ bool DefaultFileAccessJobHandler::removeFile(const QUrl& fileName) { m_bSuccess = false; KIO::SimpleJob* pJob = KIO::file_delete(fileName, KIO::HideProgressInfo); - chk_connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); - chk_connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pJob, &KIO::SimpleJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); + connect(pJob, &KIO::SimpleJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); ProgressProxy::enterEventLoop(pJob, i18n("Removing file: %1", FileAccess::prettyAbsPath(fileName))); return m_bSuccess; @@ -246,8 +246,8 @@ bool DefaultFileAccessJobHandler::symLink(const QUrl& linkTarget, const QUrl& li { m_bSuccess = false; KIO::CopyJob* pJob = KIO::link(linkTarget, linkLocation, KIO::HideProgressInfo); - chk_connect(pJob, &KIO::CopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); - chk_connect(pJob, &KIO::CopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pJob, &KIO::CopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); + connect(pJob, &KIO::CopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); ProgressProxy::enterEventLoop(pJob, i18n("Creating symbolic link: %1 -> %2", FileAccess::prettyAbsPath(linkLocation), FileAccess::prettyAbsPath(linkTarget))); @@ -270,9 +270,9 @@ bool DefaultFileAccessJobHandler::rename(const FileAccess& destFile) int permissions = -1; m_bSuccess = false; KIO::FileCopyJob* pJob = KIO::file_move(mFileAccess->url(), destFile.url(), permissions, KIO::HideProgressInfo); - chk_connect(pJob, &KIO::FileCopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); - chk_connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong))); - chk_connect(pJob, &KIO::FileCopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pJob, &KIO::FileCopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); + connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong))); + connect(pJob, &KIO::FileCopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); ProgressProxy::enterEventLoop(pJob, i18n("Renaming file: %1 -> %2", mFileAccess->prettyAbsPath(), destFile.prettyAbsPath())); @@ -313,9 +313,9 @@ bool DefaultFileAccessJobHandler::copyFile(const QString& inDest) int permissions = (mFileAccess->isExecutable() ? 0111 : 0) + (mFileAccess->isWritable() ? 0222 : 0) + (mFileAccess->isReadable() ? 0444 : 0); m_bSuccess = false; KIO::FileCopyJob* pJob = KIO::file_copy(mFileAccess->url(), dest.url(), permissions, KIO::HideProgressInfo|KIO::Overwrite); - chk_connect(pJob, &KIO::FileCopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); - chk_connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong))); - chk_connect(pJob, &KIO::FileCopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pJob, &KIO::FileCopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); + connect(pJob, SIGNAL(percent(KJob*,ulong)), &pp, SLOT(slotPercent(KJob*,ulong))); + connect(pJob, &KIO::FileCopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); ProgressProxy::enterEventLoop(pJob, i18n("Copying file: %1 -> %2", mFileAccess->prettyAbsPath(), dest.prettyAbsPath())); @@ -387,14 +387,14 @@ bool DefaultFileAccessJobHandler::listDir(t_DirectoryList* pDirList, bool bRecur m_bSuccess = false; if(pListJob != nullptr) { - chk_connect(pListJob, &KIO::ListJob::entries, this, &DefaultFileAccessJobHandler::slotListDirProcessNewEntries); - chk_connect(pListJob, &KIO::ListJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); - chk_connect(pListJob, &KIO::ListJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); - chk_connect(pListJob, &KIO::ListJob::infoMessage, &pp, &ProgressProxyExtender::slotListDirInfoMessage); + connect(pListJob, &KIO::ListJob::entries, this, &DefaultFileAccessJobHandler::slotListDirProcessNewEntries); + connect(pListJob, &KIO::ListJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); + connect(pListJob, &KIO::ListJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); + connect(pListJob, &KIO::ListJob::infoMessage, &pp, &ProgressProxyExtender::slotListDirInfoMessage); // This line makes the transfer via fish unreliable.:-( /*if(mFileAccess->url().scheme() != QLatin1String("fish")){ - chk_connect( pListJob, static_cast(&KIO::ListJob::percent), &pp, &ProgressProxyExtender::slotPercent); + connect( pListJob, static_cast(&KIO::ListJob::percent), &pp, &ProgressProxyExtender::slotPercent); }*/ ProgressProxy::enterEventLoop(pListJob, diff --git a/src/difftextwindow.cpp b/src/difftextwindow.cpp index f328035..e7fd99d 100644 --- a/src/difftextwindow.cpp +++ b/src/difftextwindow.cpp @@ -266,21 +266,21 @@ void DiffTextWindow::setupConnections(const KDiff3App* app) { Q_ASSERT(qobject_cast(parent()) != nullptr); - chk_connect(this, &DiffTextWindow::firstLineChanged, dynamic_cast(parent()), &DiffTextWindowFrame::setFirstLine); - chk_connect(this, &DiffTextWindow::newSelection, app, &KDiff3App::slotSelectionStart); - chk_connect(this, &DiffTextWindow::selectionEnd, app, &KDiff3App::slotSelectionEnd); - chk_connect(this, &DiffTextWindow::scrollDiffTextWindow, app, &KDiff3App::scrollDiffTextWindow); - chk_connect_q(this, &DiffTextWindow::finishRecalcWordWrap, app, &KDiff3App::slotFinishRecalcWordWrap); + connect(this, &DiffTextWindow::firstLineChanged, dynamic_cast(parent()), &DiffTextWindowFrame::setFirstLine); + connect(this, &DiffTextWindow::newSelection, app, &KDiff3App::slotSelectionStart); + connect(this, &DiffTextWindow::selectionEnd, app, &KDiff3App::slotSelectionEnd); + connect(this, &DiffTextWindow::scrollDiffTextWindow, app, &KDiff3App::scrollDiffTextWindow); + connect(this, &DiffTextWindow::finishRecalcWordWrap, app, &KDiff3App::slotFinishRecalcWordWrap, Qt::QueuedConnection); - chk_connect(this, &DiffTextWindow::finishDrop, app, &KDiff3App::slotFinishDrop); + connect(this, &DiffTextWindow::finishDrop, app, &KDiff3App::slotFinishDrop); - chk_connect(this, &DiffTextWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg); + connect(this, &DiffTextWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg); - chk_connect(app, &KDiff3App::showWhiteSpaceToggled, this, static_cast(&DiffTextWindow::update)); - chk_connect(app, &KDiff3App::showLineNumbersToggled, this, static_cast(&DiffTextWindow::update)); - chk_connect(app, &KDiff3App::doRefresh, this, &DiffTextWindow::slotRefresh); - chk_connect(app, &KDiff3App::selectAll, this, &DiffTextWindow::slotSelectAll); - chk_connect(app, &KDiff3App::copy, this, &DiffTextWindow::slotCopy); + connect(app, &KDiff3App::showWhiteSpaceToggled, this, static_cast(&DiffTextWindow::update)); + connect(app, &KDiff3App::showLineNumbersToggled, this, static_cast(&DiffTextWindow::update)); + connect(app, &KDiff3App::doRefresh, this, &DiffTextWindow::slotRefresh); + connect(app, &KDiff3App::selectAll, this, &DiffTextWindow::slotSelectAll); + connect(app, &KDiff3App::copy, this, &DiffTextWindow::slotCopy); connections.push_back(KDiff3App::allowCopy.connect(boost::bind(&DiffTextWindow::canCopy, this))); connections.push_back(KDiff3App::getSelection.connect(boost::bind(&DiffTextWindow::getSelection, this))); @@ -1859,8 +1859,8 @@ DiffTextWindowFrame::DiffTextWindowFrame(QWidget* pParent, const QSharedPointer< d = new DiffTextWindowFrameData(this, pOptions, winIdx); d->mSourceData = psd; setAutoFillBackground(true); - chk_connect(d->getBrowseButton(), &QPushButton::clicked, this, &DiffTextWindowFrame::slotBrowseButtonClicked); - chk_connect(d->getFileSelectionField(), &QLineEdit::returnPressed, this, &DiffTextWindowFrame::slotReturnPressed); + connect(d->getBrowseButton(), &QPushButton::clicked, this, &DiffTextWindowFrame::slotBrowseButtonClicked); + connect(d->getFileSelectionField(), &QLineEdit::returnPressed, this, &DiffTextWindowFrame::slotReturnPressed); d->m_pDiffTextWindow = new DiffTextWindow(this, pOptions, winIdx); d->m_pDiffTextWindow->setSourceData(psd); @@ -1887,7 +1887,7 @@ DiffTextWindowFrame::DiffTextWindowFrame(QWidget* pParent, const QSharedPointer< pHL2->addWidget(d->m_pTopLine, 0); d->m_pEncoding = new EncodingLabel(i18n("Encoding:"), psd, pOptions); //EncodeLabel::EncodingChanged should be handled asyncroniously. - chk_connect_q((EncodingLabel*)d->m_pEncoding, &EncodingLabel::encodingChanged, this, &DiffTextWindowFrame::slotEncodingChanged); + connect((EncodingLabel*)d->m_pEncoding, &EncodingLabel::encodingChanged, this, &DiffTextWindowFrame::slotEncodingChanged, Qt::QueuedConnection); d->m_pLineEndStyle = new QLabel(i18n("Line end style:")); pHL2->addWidget(d->m_pEncoding); @@ -1926,8 +1926,8 @@ void DiffTextWindowFrame::init() void DiffTextWindowFrame::setupConnections(const KDiff3App* app) { - chk_connect(this, &DiffTextWindowFrame::fileNameChanged, app, &KDiff3App::slotFileNameChanged); - chk_connect(this, &DiffTextWindowFrame::encodingChanged, app, &KDiff3App::slotEncodingChanged); + connect(this, &DiffTextWindowFrame::fileNameChanged, app, &KDiff3App::slotFileNameChanged); + connect(this, &DiffTextWindowFrame::encodingChanged, app, &KDiff3App::slotEncodingChanged); d->mSourceData->setupConnections(); } @@ -2103,7 +2103,7 @@ void EncodingLabel::insertCodec(const QString& visibleCodecName, QTextCodec* pCo if(currentTextCodecEnum == CodecMIBEnum) pAction->setChecked(true); pMenu->addAction(pAction); - chk_connect(pAction, &QAction::triggered, this, &EncodingLabel::slotSelectEncoding); + connect(pAction, &QAction::triggered, this, &EncodingLabel::slotSelectEncoding); codecEnumList.append(CodecMIBEnum); } } diff --git a/src/directorymergewindow.cpp b/src/directorymergewindow.cpp index bbc600b..0729620 100644 --- a/src/directorymergewindow.cpp +++ b/src/directorymergewindow.cpp @@ -68,7 +68,7 @@ class StatusInfo : public QDialog m_pTextEdit->setWordWrapMode(QTextOption::NoWrap); m_pTextEdit->setReadOnly(true); QDialogButtonBox* box = new QDialogButtonBox(QDialogButtonBox::Close, this); - chk_connect(box, &QDialogButtonBox::rejected, this, &QDialog::accept); + connect(box, &QDialogButtonBox::rejected, this, &QDialog::accept); pVLayout->addWidget(box); } @@ -639,8 +639,8 @@ DirectoryMergeWindow::DirectoryMergeWindow(QWidget* pParent, const QSharedPointe d = new DirectoryMergeWindowPrivate(this); setModel(d); setItemDelegate(new DirMergeItemDelegate(this)); - chk_connect(this, &DirectoryMergeWindow::doubleClicked, this, &DirectoryMergeWindow::onDoubleClick); - chk_connect(this, &DirectoryMergeWindow::expanded, this, &DirectoryMergeWindow::onExpanded); + connect(this, &DirectoryMergeWindow::doubleClicked, this, &DirectoryMergeWindow::onDoubleClick); + connect(this, &DirectoryMergeWindow::expanded, this, &DirectoryMergeWindow::onExpanded); d->m_pOptions = pOptions; @@ -3003,12 +3003,12 @@ void DirectoryMergeWindow::initDirectoryMergeActions(KDiff3App* pKDiff3App, KAct void DirectoryMergeWindow::setupConnections(const KDiff3App* app) { - chk_connect(this, &DirectoryMergeWindow::startDiffMerge, app, &KDiff3App::slotFileOpen2); - chk_connect(selectionModel(), &QItemSelectionModel::selectionChanged, app, &KDiff3App::slotUpdateAvailabilities); - chk_connect(selectionModel(), &QItemSelectionModel::currentChanged, app, &KDiff3App::slotUpdateAvailabilities); - chk_connect(this, static_cast(&DirectoryMergeWindow::updateAvailabilities), app, &KDiff3App::slotUpdateAvailabilities); - chk_connect(this, &DirectoryMergeWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg); - chk_connect(app, &KDiff3App::doRefresh, this, &DirectoryMergeWindow::slotRefresh); + connect(this, &DirectoryMergeWindow::startDiffMerge, app, &KDiff3App::slotFileOpen2); + connect(selectionModel(), &QItemSelectionModel::selectionChanged, app, &KDiff3App::slotUpdateAvailabilities); + connect(selectionModel(), &QItemSelectionModel::currentChanged, app, &KDiff3App::slotUpdateAvailabilities); + connect(this, static_cast(&DirectoryMergeWindow::updateAvailabilities), app, &KDiff3App::slotUpdateAvailabilities); + connect(this, &DirectoryMergeWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg); + connect(app, &KDiff3App::doRefresh, this, &DirectoryMergeWindow::slotRefresh); } void DirectoryMergeWindow::updateAvailabilities(bool bMergeEditorVisible, bool bDirCompare, bool bDiffWindowVisible, diff --git a/src/guiutils.h b/src/guiutils.h index 170475c..b790046 100644 --- a/src/guiutils.h +++ b/src/guiutils.h @@ -28,7 +28,7 @@ namespace GuiUtils { theAction = ac->addAction(actionName); theAction->setText(text); - chk_connect(theAction, &QAction::triggered, receiver, slot); + QObject::connect(theAction, &QAction::triggered, receiver, slot); return theAction; } @@ -43,7 +43,7 @@ namespace GuiUtils { KToggleAction* theAction = new KToggleAction(ac); ac->addAction( actionName, theAction ); theAction->setText( text ); - chk_connect( theAction, &KToggleAction::triggered, receiver, slot ); + QObject::connect( theAction, &KToggleAction::triggered, receiver, slot ); return theAction; } diff --git a/src/kdiff3.cpp b/src/kdiff3.cpp index cd94360..3f2c052 100644 --- a/src/kdiff3.cpp +++ b/src/kdiff3.cpp @@ -145,7 +145,7 @@ KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P // All default values must be set before calling readOptions(). m_pOptionDialog = new OptionDialog(m_pKDiff3Shell != nullptr, this); - chk_connect(m_pOptionDialog, &OptionDialog::applyDone, this, &KDiff3App::slotRefresh); + connect(m_pOptionDialog, &OptionDialog::applyDone, this, &KDiff3App::slotRefresh); // This is just a convenience variable to make code that accesses options more readable m_pOptions = m_pOptionDialog->getOptions(); @@ -303,7 +303,7 @@ KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P initStatusBar(); m_pFindDialog = new FindDialog(this); - chk_connect(m_pFindDialog, &FindDialog::findNext, this, &KDiff3App::slotEditFindNext); + connect(m_pFindDialog, &FindDialog::findNext, this, &KDiff3App::slotEditFindNext); autoAdvance->setChecked(m_pOptions->m_bAutoAdvance); showWhiteSpaceCharacters->setChecked(m_pOptions->m_bShowWhiteSpaceCharacters); @@ -343,10 +343,10 @@ KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P //Warning: Make sure DirectoryMergeWindow::initActions is called before this point or we can crash when selectionChanged is sent. m_pDirectoryMergeWindow->setupConnections(this); - chk_connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &KDiff3App::slotClipboardChanged); - chk_connect_q(this, &KDiff3App::sigRecalcWordWrap, this, &KDiff3App::slotRecalcWordWrap); + connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &KDiff3App::slotClipboardChanged); + connect(this, &KDiff3App::sigRecalcWordWrap, this, &KDiff3App::slotRecalcWordWrap, Qt::QueuedConnection); connections.push_back(shouldContinue.connect(boost::bind(&KDiff3App::canContinue, this))); - chk_connect(this, &KDiff3App::finishDrop, this, &KDiff3App::slotFinishDrop); + connect(this, &KDiff3App::finishDrop, this, &KDiff3App::slotFinishDrop); connections.push_back(allowCut.connect(boost::bind(&KDiff3App::canCut, this))); connections.push_back(allowCopy.connect(boost::bind(&KDiff3App::canCopy, this))); @@ -354,7 +354,7 @@ KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P m_pDirectoryMergeWindow->initDirectoryMergeActions(this, actionCollection()); if(qApp != nullptr) - chk_connect(qApp, &QApplication::focusChanged, this, &KDiff3App::slotFocusChanged); + connect(qApp, &QApplication::focusChanged, this, &KDiff3App::slotFocusChanged); delete KDiff3Shell::getParser(); } diff --git a/src/kdiff3.h b/src/kdiff3.h index f504f59..8d401d7 100644 --- a/src/kdiff3.h +++ b/src/kdiff3.h @@ -68,7 +68,7 @@ class ReversibleScrollBar : public QScrollBar { m_pbRightToLeftLanguage = pbRightToLeftLanguage; m_realVal = 0; - chk_connect(this, &ReversibleScrollBar::valueChanged, this, &ReversibleScrollBar::slotValueChanged); + connect(this, &ReversibleScrollBar::valueChanged, this, &ReversibleScrollBar::slotValueChanged); } void setAgain() { setValue(m_realVal); } diff --git a/src/kdiff3_shell.cpp b/src/kdiff3_shell.cpp index 979ec93..d1b194c 100644 --- a/src/kdiff3_shell.cpp +++ b/src/kdiff3_shell.cpp @@ -54,7 +54,7 @@ KDiff3Shell::KDiff3Shell(bool bCompleteInit) if(bCompleteInit) m_widget->completeInit(QString()); - chk_connect(m_widget, &KDiff3App::createNewInstance, this, &KDiff3Shell::slotNewInstance); + connect(m_widget, &KDiff3App::createNewInstance, this, &KDiff3Shell::slotNewInstance); } else { @@ -140,7 +140,7 @@ void KDiff3Shell::optionsConfigureToolbars() // use the standard toolbar editor KEditToolBar dlg(factory()); - chk_connect(&dlg, &KEditToolBar::newToolBarConfig, this, &KDiff3Shell::applyNewToolbarConfig); + connect(&dlg, &KEditToolBar::newToolBarConfig, this, &KDiff3Shell::applyNewToolbarConfig); dlg.exec(); } diff --git a/src/mergeresultwindow.cpp b/src/mergeresultwindow.cpp index 803beba..028034c 100644 --- a/src/mergeresultwindow.cpp +++ b/src/mergeresultwindow.cpp @@ -76,12 +76,12 @@ MergeResultWindow::MergeResultWindow( m_pStatusBar = pStatusBar; if(m_pStatusBar != nullptr) - chk_connect(m_pStatusBar, &QStatusBar::messageChanged, this, &MergeResultWindow::slotStatusMessageChanged); + connect(m_pStatusBar, &QStatusBar::messageChanged, this, &MergeResultWindow::slotStatusMessageChanged); m_pOptions = pOptions; setUpdatesEnabled(false); - chk_connect(&m_cursorTimer, &QTimer::timeout, this, &MergeResultWindow::slotCursorUpdate); + connect(&m_cursorTimer, &QTimer::timeout, this, &MergeResultWindow::slotCursorUpdate); m_cursorTimer.setSingleShot(true); m_cursorTimer.start(500 /*ms*/); m_selection.reset(); @@ -154,57 +154,57 @@ void MergeResultWindow::initActions(KActionCollection* ac) void MergeResultWindow::connectActions() const { - chk_connect(chooseAEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseAEverywhere); - chk_connect(chooseBEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseBEverywhere); - chk_connect(chooseCEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseCEverywhere); + connect(chooseAEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseAEverywhere); + connect(chooseBEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseBEverywhere); + connect(chooseCEverywhere, &QAction::triggered, this, &MergeResultWindow::slotChooseCEverywhere); - chk_connect(chooseAForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedConflicts); - chk_connect(chooseBForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedConflicts); - chk_connect(chooseCForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedConflicts); + connect(chooseAForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedConflicts); + connect(chooseBForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedConflicts); + connect(chooseCForUnsolvedConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedConflicts); - chk_connect(chooseAForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedWhiteSpaceConflicts); - chk_connect(chooseBForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedWhiteSpaceConflicts); - chk_connect(chooseCForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedWhiteSpaceConflicts); + connect(chooseAForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseAForUnsolvedWhiteSpaceConflicts); + connect(chooseBForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseBForUnsolvedWhiteSpaceConflicts); + connect(chooseCForUnsolvedWhiteSpaceConflicts, &QAction::triggered, this, &MergeResultWindow::slotChooseCForUnsolvedWhiteSpaceConflicts); } void MergeResultWindow::setupConnections(const KDiff3App* app) { - chk_connect(app, &KDiff3App::cut, this, &MergeResultWindow::slotCut); - chk_connect(app, &KDiff3App::copy, this, &MergeResultWindow::slotCopy); - chk_connect(app, &KDiff3App::selectAll, this, &MergeResultWindow::slotSelectAll); - - chk_connect(this, &MergeResultWindow::scrollMergeResultWindow, app, &KDiff3App::scrollMergeResultWindow); - chk_connect(this, &MergeResultWindow::sourceMask, app, &KDiff3App::sourceMask); - chk_connect(this, &MergeResultWindow::resizeSignal, app, &KDiff3App::setHScrollBarRange); - chk_connect(this, &MergeResultWindow::resizeSignal, this, &MergeResultWindow::slotResize); - - chk_connect(this, &MergeResultWindow::selectionEnd, app, &KDiff3App::slotSelectionEnd); - chk_connect(this, &MergeResultWindow::newSelection, app, &KDiff3App::slotSelectionStart); - chk_connect(this, &MergeResultWindow::modifiedChanged, app, &KDiff3App::slotOutputModified); - chk_connect(this, &MergeResultWindow::updateAvailabilities, app, &KDiff3App::slotUpdateAvailabilities); - chk_connect(this, &MergeResultWindow::showPopupMenu, app, &KDiff3App::showPopupMenu); - chk_connect(this, &MergeResultWindow::noRelevantChangesDetected, app, &KDiff3App::slotNoRelevantChangesDetected); - chk_connect(this, &MergeResultWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg); + connect(app, &KDiff3App::cut, this, &MergeResultWindow::slotCut); + connect(app, &KDiff3App::copy, this, &MergeResultWindow::slotCopy); + connect(app, &KDiff3App::selectAll, this, &MergeResultWindow::slotSelectAll); + + connect(this, &MergeResultWindow::scrollMergeResultWindow, app, &KDiff3App::scrollMergeResultWindow); + connect(this, &MergeResultWindow::sourceMask, app, &KDiff3App::sourceMask); + connect(this, &MergeResultWindow::resizeSignal, app, &KDiff3App::setHScrollBarRange); + connect(this, &MergeResultWindow::resizeSignal, this, &MergeResultWindow::slotResize); + + connect(this, &MergeResultWindow::selectionEnd, app, &KDiff3App::slotSelectionEnd); + connect(this, &MergeResultWindow::newSelection, app, &KDiff3App::slotSelectionStart); + connect(this, &MergeResultWindow::modifiedChanged, app, &KDiff3App::slotOutputModified); + connect(this, &MergeResultWindow::updateAvailabilities, app, &KDiff3App::slotUpdateAvailabilities); + connect(this, &MergeResultWindow::showPopupMenu, app, &KDiff3App::showPopupMenu); + connect(this, &MergeResultWindow::noRelevantChangesDetected, app, &KDiff3App::slotNoRelevantChangesDetected); + connect(this, &MergeResultWindow::statusBarMessage, app, &KDiff3App::slotStatusMsg); //connect menu actions - chk_connect(app, &KDiff3App::showWhiteSpaceToggled, this, static_cast(&MergeResultWindow::update)); - chk_connect(app, &KDiff3App::doRefresh, this, &MergeResultWindow::slotRefresh); - - chk_connect(app, &KDiff3App::autoSolve, this, &MergeResultWindow::slotAutoSolve); - chk_connect(app, &KDiff3App::unsolve, this, &MergeResultWindow::slotUnsolve); - chk_connect(app, &KDiff3App::mergeHistory, this, &MergeResultWindow::slotMergeHistory); - chk_connect(app, &KDiff3App::regExpAutoMerge, this, &MergeResultWindow::slotRegExpAutoMerge); - - chk_connect(app, &KDiff3App::goCurrent, this, &MergeResultWindow::slotGoCurrent); - chk_connect(app, &KDiff3App::goTop, this, &MergeResultWindow::slotGoTop); - chk_connect(app, &KDiff3App::goBottom, this, &MergeResultWindow::slotGoBottom); - chk_connect(app, &KDiff3App::goPrevUnsolvedConflict, this, &MergeResultWindow::slotGoPrevUnsolvedConflict); - chk_connect(app, &KDiff3App::goNextUnsolvedConflict, this, &MergeResultWindow::slotGoNextUnsolvedConflict); - chk_connect(app, &KDiff3App::goPrevConflict, this, &MergeResultWindow::slotGoPrevConflict); - chk_connect(app, &KDiff3App::goNextConflict, this, &MergeResultWindow::slotGoNextConflict); - chk_connect(app, &KDiff3App::goPrevDelta, this, &MergeResultWindow::slotGoPrevDelta); - chk_connect(app, &KDiff3App::goNextDelta, this, &MergeResultWindow::slotGoNextDelta); - - chk_connect(app, &KDiff3App::changeOverViewMode, this, &MergeResultWindow::setOverviewMode); + connect(app, &KDiff3App::showWhiteSpaceToggled, this, static_cast(&MergeResultWindow::update)); + connect(app, &KDiff3App::doRefresh, this, &MergeResultWindow::slotRefresh); + + connect(app, &KDiff3App::autoSolve, this, &MergeResultWindow::slotAutoSolve); + connect(app, &KDiff3App::unsolve, this, &MergeResultWindow::slotUnsolve); + connect(app, &KDiff3App::mergeHistory, this, &MergeResultWindow::slotMergeHistory); + connect(app, &KDiff3App::regExpAutoMerge, this, &MergeResultWindow::slotRegExpAutoMerge); + + connect(app, &KDiff3App::goCurrent, this, &MergeResultWindow::slotGoCurrent); + connect(app, &KDiff3App::goTop, this, &MergeResultWindow::slotGoTop); + connect(app, &KDiff3App::goBottom, this, &MergeResultWindow::slotGoBottom); + connect(app, &KDiff3App::goPrevUnsolvedConflict, this, &MergeResultWindow::slotGoPrevUnsolvedConflict); + connect(app, &KDiff3App::goNextUnsolvedConflict, this, &MergeResultWindow::slotGoNextUnsolvedConflict); + connect(app, &KDiff3App::goPrevConflict, this, &MergeResultWindow::slotGoPrevConflict); + connect(app, &KDiff3App::goNextConflict, this, &MergeResultWindow::slotGoNextConflict); + connect(app, &KDiff3App::goPrevDelta, this, &MergeResultWindow::slotGoPrevDelta); + connect(app, &KDiff3App::goNextDelta, this, &MergeResultWindow::slotGoNextDelta); + + connect(app, &KDiff3App::changeOverViewMode, this, &MergeResultWindow::setOverviewMode); connections.push_back(KDiff3App::allowCut.connect(boost::bind(&MergeResultWindow::canCut, this))); connections.push_back(KDiff3App::allowCopy.connect(boost::bind(&MergeResultWindow::canCopy, this))); @@ -3084,7 +3084,7 @@ WindowTitleWidget::WindowTitleWidget(const QSharedPointer& pOptions) //m_pBrowseButton = new QPushButton("..."); //pHLayout->addWidget( m_pBrowseButton, 0 ); - //chk_connect( m_pBrowseButton, &QPushButton::clicked), this, &MergeResultWindow::slotBrowseButtonClicked); + //connect( m_pBrowseButton, &QPushButton::clicked), this, &MergeResultWindow::slotBrowseButtonClicked); m_pModifiedLabel = new QLabel(i18n("[Modified]")); pHLayout->addWidget(m_pModifiedLabel); diff --git a/src/optiondialog.cpp b/src/optiondialog.cpp index 311585e..8dc8f3c 100644 --- a/src/optiondialog.cpp +++ b/src/optiondialog.cpp @@ -113,7 +113,7 @@ FontChooser::FontChooser(QWidget* pParent) m_pSelectFont = new QPushButton(i18n("Change Font")); m_pSelectFont->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - chk_connect(m_pSelectFont, &QPushButton::clicked, this, &FontChooser::slotSelectFont); + connect(m_pSelectFont, &QPushButton::clicked, this, &FontChooser::slotSelectFont); pLayout->addWidget(m_pSelectFont); pLayout->setAlignment(m_pSelectFont, Qt::AlignRight); } @@ -512,11 +512,11 @@ OptionDialog::OptionDialog(bool bShowDirMergeSettings, QWidget* parent) : KPageD // Initialize all values in the dialog resetToDefaults(); slotApply(); - chk_connect(button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &OptionDialog::slotApply); - chk_connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &OptionDialog::slotOk); - chk_connect(button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, &OptionDialog::slotDefault); - chk_connect(button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &QDialog::reject); - chk_connect(button(QDialogButtonBox::Help), &QPushButton::clicked, this, &OptionDialog::helpRequested); + connect(button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &OptionDialog::slotApply); + connect(button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &OptionDialog::slotOk); + connect(button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, &OptionDialog::slotDefault); + connect(button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &QDialog::reject); + connect(button(QDialogButtonBox::Help), &QPushButton::clicked, this, &OptionDialog::helpRequested); } void OptionDialog::helpRequested() @@ -1073,7 +1073,7 @@ void OptionDialog::setupMergePage() addOptionItem(m_pHistorySortKeyOrderLineEdit); label->setToolTip(s_historyEntryStartSortKeyOrderToolTip); m_pHistorySortKeyOrderLineEdit->setEnabled(false); - chk_connect(m_pHistoryMergeSorting, &OptionCheckBox::toggled, m_pHistorySortKeyOrderLineEdit, &OptionLineEdit::setEnabled); + connect(m_pHistoryMergeSorting, &OptionCheckBox::toggled, m_pHistorySortKeyOrderLineEdit, &OptionLineEdit::setEnabled); ++line; m_pHistoryAutoMerge = new OptionCheckBox(i18n("Merge version control history on merge start"), false, "RunHistoryAutoMergeOnMergeStart", &m_options->m_bRunHistoryAutoMergeOnMergeStart, page); @@ -1093,7 +1093,7 @@ void OptionDialog::setupMergePage() QPushButton* pButton = new QPushButton(i18n("Test your regular expressions"), page); gbox->addWidget(pButton, line, 0); - chk_connect(pButton, &QPushButton::clicked, this, &OptionDialog::slotHistoryMergeRegExpTester); + connect(pButton, &QPushButton::clicked, this, &OptionDialog::slotHistoryMergeRegExpTester); ++line; label = new QLabel(i18n("Irrelevant merge command:"), page); @@ -1294,7 +1294,7 @@ void OptionDialog::setupDirectoryMergePage() pWhiteSpaceDiffsEqual->setToolTip(i18n( "If files differ only by white space consider them equal.\n" "This is only active when full analysis is chosen.")); - chk_connect(pFullAnalysis, &OptionRadioButton::toggled, pWhiteSpaceDiffsEqual, &OptionCheckBox::setEnabled); + connect(pFullAnalysis, &OptionRadioButton::toggled, pWhiteSpaceDiffsEqual, &OptionCheckBox::setEnabled); pWhiteSpaceDiffsEqual->setEnabled(false); ++line; @@ -1413,10 +1413,10 @@ void OptionDialog::setupRegionalPage() gbox->addWidget(m_pEncodingPPComboBox, line, 1); ++line; - chk_connect(m_pSameEncoding, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged); - chk_connect(m_pEncodingAComboBox, static_cast(&OptionEncodingComboBox::activated), this, &OptionDialog::slotEncodingChanged); - chk_connect(m_pAutoDetectUnicodeA, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged); - chk_connect(m_pAutoSelectOutEncoding, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged); + connect(m_pSameEncoding, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged); + connect(m_pEncodingAComboBox, static_cast(&OptionEncodingComboBox::activated), this, &OptionDialog::slotEncodingChanged); + connect(m_pAutoDetectUnicodeA, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged); + connect(m_pAutoSelectOutEncoding, &OptionCheckBox::toggled, this, &OptionDialog::slotEncodingChanged); OptionCheckBox* pRightToLeftLanguage = new OptionCheckBox(i18n("Right To Left Language"), false, "RightToLeftLanguage", &m_options->m_bRightToLeftLanguage, page); addOptionItem(pRightToLeftLanguage); diff --git a/src/pdiff.cpp b/src/pdiff.cpp index 2b4485b..efdd115 100644 --- a/src/pdiff.cpp +++ b/src/pdiff.cpp @@ -585,9 +585,9 @@ void KDiff3App::initView() DiffTextWindow::mVScrollBar = new QScrollBar(Qt::Vertical, pDiffWindowFrame); pDiffHLayout->addWidget(DiffTextWindow::mVScrollBar); - chk_connect(m_pOverview, &Overview::setLine, DiffTextWindow::mVScrollBar, &QScrollBar::setValue); - chk_connect(this, &KDiff3App::showWhiteSpaceToggled, m_pOverview, &Overview::slotRedraw); - chk_connect(this, &KDiff3App::changeOverViewMode, m_pOverview, &Overview::setOverviewMode); + connect(m_pOverview, &Overview::setLine, DiffTextWindow::mVScrollBar, &QScrollBar::setValue); + connect(this, &KDiff3App::showWhiteSpaceToggled, m_pOverview, &Overview::slotRedraw); + connect(this, &KDiff3App::changeOverViewMode, m_pOverview, &Overview::setOverviewMode); m_pDiffTextWindowFrame1 = new DiffTextWindowFrame(m_pDiffWindowSplitter, m_pOptionDialog->getOptions(), e_SrcSelector::A, m_sd1); m_pDiffWindowSplitter->addWidget(m_pDiffTextWindowFrame1); @@ -647,43 +647,43 @@ void KDiff3App::initView() m_pCornerWidget = new QWidget(m_pMainWidget); pHScrollBarLayout->addWidget(m_pCornerWidget); - chk_connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pOverview, &Overview::setFirstLine); - chk_connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow1, &DiffTextWindow::setFirstLine); - chk_connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow1, &DiffTextWindow::setHorizScrollOffset); + connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pOverview, &Overview::setFirstLine); + connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow1, &DiffTextWindow::setFirstLine); + connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow1, &DiffTextWindow::setHorizScrollOffset); m_pDiffTextWindow1->setupConnections(this); - chk_connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow2, &DiffTextWindow::setFirstLine); - chk_connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow2, &DiffTextWindow::setHorizScrollOffset); + connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow2, &DiffTextWindow::setFirstLine); + connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow2, &DiffTextWindow::setHorizScrollOffset); m_pDiffTextWindow2->setupConnections(this); - chk_connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow3, &DiffTextWindow::setFirstLine); - chk_connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow3, &DiffTextWindow::setHorizScrollOffset); + connect(DiffTextWindow::mVScrollBar, &QScrollBar::valueChanged, m_pDiffTextWindow3, &DiffTextWindow::setFirstLine); + connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, m_pDiffTextWindow3, &DiffTextWindow::setHorizScrollOffset); m_pDiffTextWindow3->setupConnections(this); MergeResultWindow* p = m_pMergeResultWindow; - chk_connect(MergeResultWindow::mVScrollBar, &QScrollBar::valueChanged, p, &MergeResultWindow::setFirstLine); + connect(MergeResultWindow::mVScrollBar, &QScrollBar::valueChanged, p, &MergeResultWindow::setFirstLine); - chk_connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, p, &MergeResultWindow::setHorizScrollOffset); - chk_connect(p, &MergeResultWindow::modifiedChanged, m_pMergeResultWindowTitle, &WindowTitleWidget::slotSetModified); + connect(m_pHScrollBar, &ReversibleScrollBar::valueChanged2, p, &MergeResultWindow::setHorizScrollOffset); + connect(p, &MergeResultWindow::modifiedChanged, m_pMergeResultWindowTitle, &WindowTitleWidget::slotSetModified); p->setupConnections(this); sourceMask(0, 0); - chk_connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow1, &DiffTextWindow::setFastSelectorRange); - chk_connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow2, &DiffTextWindow::setFastSelectorRange); - chk_connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow3, &DiffTextWindow::setFastSelectorRange); - chk_connect(m_pDiffTextWindow1, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine); - chk_connect(m_pDiffTextWindow2, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine); - chk_connect(m_pDiffTextWindow3, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine); - chk_connect(m_pDiffTextWindow1, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask); - chk_connect(m_pDiffTextWindow2, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask); - chk_connect(m_pDiffTextWindow3, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask); - chk_connect(m_pDirectoryMergeInfo, &DirectoryMergeInfo::gotFocus, p, &MergeResultWindow::updateSourceMask); - - chk_connect(m_pDiffTextWindow1, &DiffTextWindow::resizeHeightChangedSignal, this, &KDiff3App::resizeDiffTextWindowHeight); + connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow1, &DiffTextWindow::setFastSelectorRange); + connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow2, &DiffTextWindow::setFastSelectorRange); + connect(p, &MergeResultWindow::setFastSelectorRange, m_pDiffTextWindow3, &DiffTextWindow::setFastSelectorRange); + connect(m_pDiffTextWindow1, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine); + connect(m_pDiffTextWindow2, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine); + connect(m_pDiffTextWindow3, &DiffTextWindow::setFastSelectorLine, p, &MergeResultWindow::slotSetFastSelectorLine); + connect(m_pDiffTextWindow1, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask); + connect(m_pDiffTextWindow2, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask); + connect(m_pDiffTextWindow3, &DiffTextWindow::gotFocus, p, &MergeResultWindow::updateSourceMask); + connect(m_pDirectoryMergeInfo, &DirectoryMergeInfo::gotFocus, p, &MergeResultWindow::updateSourceMask); + + connect(m_pDiffTextWindow1, &DiffTextWindow::resizeHeightChangedSignal, this, &KDiff3App::resizeDiffTextWindowHeight); // The following two connects cause the wordwrap to be recalced thrice, just to make sure. Better than forgetting one. - chk_connect(m_pDiffTextWindow1, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap); - chk_connect(m_pDiffTextWindow2, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap); - chk_connect(m_pDiffTextWindow3, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap); + connect(m_pDiffTextWindow1, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap); + connect(m_pDiffTextWindow2, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap); + connect(m_pDiffTextWindow3, &DiffTextWindow::resizeWidthChangedSignal, this, &KDiff3App::postRecalcWordWrap); m_pDiffTextWindow1->setFocus(); m_pMainWidget->setMinimumSize(50, 50); diff --git a/src/progress.cpp b/src/progress.cpp index 0664081..55317d4 100644 --- a/src/progress.cpp +++ b/src/progress.cpp @@ -58,7 +58,7 @@ ProgressDialog::ProgressDialog(QWidget* pParent, QStatusBar* pStatusBar) hlayout->addStretch(1); m_pAbortButton = new QPushButton(i18n("&Cancel"), this); hlayout->addWidget(m_pAbortButton); - chk_connect(m_pAbortButton, &QPushButton::clicked, this, &ProgressDialog::slotAbort); + connect(m_pAbortButton, &QPushButton::clicked, this, &ProgressDialog::slotAbort); if(m_pStatusBar != nullptr) { m_pStatusBarWidget = new QWidget; @@ -69,7 +69,7 @@ ProgressDialog::ProgressDialog(QWidget* pParent, QStatusBar* pStatusBar) m_pStatusProgressBar->setRange(0, 1000); m_pStatusProgressBar->setTextVisible(false); m_pStatusAbortButton = new QPushButton(i18n("&Cancel")); - chk_connect(m_pStatusAbortButton, &QPushButton::clicked, this, &ProgressDialog::slotAbort); + connect(m_pStatusAbortButton, &QPushButton::clicked, this, &ProgressDialog::slotAbort); pStatusBarLayout->addWidget(m_pStatusProgressBar); pStatusBarLayout->addWidget(m_pStatusAbortButton); m_pStatusBar->addPermanentWidget(m_pStatusBarWidget, 0); diff --git a/src/smalldialogs.cpp b/src/smalldialogs.cpp index 7f26369..d425c82 100644 --- a/src/smalldialogs.cpp +++ b/src/smalldialogs.cpp @@ -49,10 +49,10 @@ OpenDialog::OpenDialog( dialogUi.lineA->setEditText(n1); QPushButton* button = dialogUi.fileSelectA; - chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectFileA); + connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileA); QPushButton* button2 = dialogUi.folderSelectA; - chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectDirA); - chk_connect_a(dialogUi.lineA, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); + connect(button2, &QPushButton::clicked, this, &OpenDialog::selectDirA); + connect(dialogUi.lineA, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); dialogUi.lineB->setEditable(true); dialogUi.lineB->insertItems(0, m_pOptions->m_recentBFiles); @@ -60,20 +60,20 @@ OpenDialog::OpenDialog( dialogUi.lineB->setMinimumWidth(200); button = dialogUi.fileSelectB; - chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectFileB); + connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileB); button2 = dialogUi.folderSelectB; - chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectDirB); - chk_connect_a(dialogUi.lineB, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); + connect(button2, &QPushButton::clicked, this, &OpenDialog::selectDirB); + connect(dialogUi.lineB, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); dialogUi.lineC->setEditable(true); dialogUi.lineC->insertItems(0, m_pOptions->m_recentCFiles); dialogUi.lineC->setEditText(n3); dialogUi.lineC->setMinimumWidth(200); button = dialogUi.fileSelectC; - chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectFileC); + connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileC); button2 = dialogUi.folderSelectC; - chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectDirC); - chk_connect_a(dialogUi.lineC, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); + connect(button2, &QPushButton::clicked, this, &OpenDialog::selectDirC); + connect(dialogUi.lineC, &QComboBox::editTextChanged, this, &OpenDialog::inputFilenameChanged); button = dialogUi.swapCopy; @@ -87,29 +87,29 @@ OpenDialog::OpenDialog( m->addAction(i18n("Swap %1<->Output", i18n("A"))); m->addAction(i18n("Swap %1<->Output", i18n("B"))); m->addAction(i18n("Swap %1<->Output", i18n("C"))); - chk_connect_a(m, &QMenu::triggered, this, &OpenDialog::slotSwapCopyNames); + connect(m, &QMenu::triggered, this, &OpenDialog::slotSwapCopyNames); button->setMenu(m); dialogUi.lineOut->insertItems(0, m_pOptions->m_recentOutputFiles); dialogUi.lineOut->setEditText(outputName); button = dialogUi.selectOutputFile; - chk_connect_a(button, &QPushButton::clicked, this, &OpenDialog::selectOutputName); + connect(button, &QPushButton::clicked, this, &OpenDialog::selectOutputName); button2 = dialogUi.selectOutputFolder; - chk_connect_a(button2, &QPushButton::clicked, this, &OpenDialog::selectOutputDir); - chk_connect_a(dialogUi.mergeCheckBox, &QCheckBox::stateChanged, this, &OpenDialog::internalSlot); - chk_connect_a(this, &OpenDialog::internalSignal, dialogUi.lineOut, &QComboBox::setEnabled); - chk_connect_a(this, &OpenDialog::internalSignal, button, &QPushButton::setEnabled); - chk_connect_a(this, &OpenDialog::internalSignal, button2, &QPushButton::setEnabled); + connect(button2, &QPushButton::clicked, this, &OpenDialog::selectOutputDir); + connect(dialogUi.mergeCheckBox, &QCheckBox::stateChanged, this, &OpenDialog::internalSlot); + connect(this, &OpenDialog::internalSignal, dialogUi.lineOut, &QComboBox::setEnabled); + connect(this, &OpenDialog::internalSignal, button, &QPushButton::setEnabled); + connect(this, &OpenDialog::internalSignal, button2, &QPushButton::setEnabled); dialogUi.mergeCheckBox->setChecked(bMerge); QDialogButtonBox *box = dialogUi.buttonBox; button = box->addButton(i18n("Configure..."), QDialogButtonBox::ActionRole); button->setIcon(QIcon::fromTheme("configure")); - chk_connect_a(button, &QPushButton::clicked, pParent, &KDiff3App::slotConfigure); - chk_connect_a(box, &QDialogButtonBox::accepted, this, &OpenDialog::accept); - chk_connect_a(box, &QDialogButtonBox::rejected, this, &OpenDialog::reject); + connect(button, &QPushButton::clicked, pParent, &KDiff3App::slotConfigure); + connect(box, &QDialogButtonBox::accepted, this, &OpenDialog::accept); + connect(box, &QDialogButtonBox::rejected, this, &OpenDialog::reject); QSize sh = sizeHint(); if(sh.height() > 10) @@ -354,8 +354,8 @@ FindDialog::FindDialog(QWidget* pParent) QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Cancel, this); layout->addWidget(box, line, 0, 1, 2); box->addButton(i18n("&Search"), QDialogButtonBox::AcceptRole); - chk_connect(box, &QDialogButtonBox::accepted, this, &FindDialog::accept); - chk_connect(box, &QDialogButtonBox::rejected, this, &FindDialog::reject); + connect(box, &QDialogButtonBox::accepted, this, &FindDialog::accept); + connect(box, &QDialogButtonBox::rejected, this, &FindDialog::reject); hide(); } @@ -389,7 +389,7 @@ RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT l->setToolTip(autoMergeRegExpToolTip); m_pAutoMergeRegExpEdit = new QLineEdit(this); pGrid->addWidget(m_pAutoMergeRegExpEdit, line, 1); - chk_connect(m_pAutoMergeRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); + connect(m_pAutoMergeRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); ++line; l = new QLabel(i18n("Example auto merge line:"), this); @@ -397,7 +397,7 @@ RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT l->setToolTip(i18n("To test auto merge, copy a line as used in your files.")); m_pAutoMergeExampleEdit = new QLineEdit(this); pGrid->addWidget(m_pAutoMergeExampleEdit, line, 1); - chk_connect(m_pAutoMergeExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); + connect(m_pAutoMergeExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); ++line; l = new QLabel(i18n("Match result:"), this); @@ -416,7 +416,7 @@ RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT l->setToolTip(historyStartRegExpToolTip); m_pHistoryStartRegExpEdit = new QLineEdit(this); pGrid->addWidget(m_pHistoryStartRegExpEdit, line, 1); - chk_connect(m_pHistoryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); + connect(m_pHistoryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); ++line; l = new QLabel(i18n("Example history start line (with leading comment):"), this); @@ -425,7 +425,7 @@ RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT "including the leading comment.")); m_pHistoryStartExampleEdit = new QLineEdit(this); pGrid->addWidget(m_pHistoryStartExampleEdit, line, 1); - chk_connect(m_pHistoryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); + connect(m_pHistoryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); ++line; l = new QLabel(i18n("Match result:"), this); @@ -444,7 +444,7 @@ RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT l->setToolTip(historyEntryStartRegExpToolTip); m_pHistoryEntryStartRegExpEdit = new QLineEdit(this); pGrid->addWidget(m_pHistoryEntryStartRegExpEdit, line, 1); - chk_connect(m_pHistoryEntryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); + connect(m_pHistoryEntryStartRegExpEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); ++line; l = new QLabel(i18n("History sort key order:"), this); @@ -452,7 +452,7 @@ RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT l->setToolTip(historySortKeyOrderToolTip); m_pHistorySortKeyOrderEdit = new QLineEdit(this); pGrid->addWidget(m_pHistorySortKeyOrderEdit, line, 1); - chk_connect(m_pHistorySortKeyOrderEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); + connect(m_pHistorySortKeyOrderEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); ++line; l = new QLabel(i18n("Example history entry start line (without leading comment):"), this); @@ -461,7 +461,7 @@ RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT "but omit the leading comment.")); m_pHistoryEntryStartExampleEdit = new QLineEdit(this); pGrid->addWidget(m_pHistoryEntryStartExampleEdit, line, 1); - chk_connect(m_pHistoryEntryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); + connect(m_pHistoryEntryStartExampleEdit, &QLineEdit::textChanged, this, &RegExpTester::slotRecalc); ++line; l = new QLabel(i18n("Match result:"), this); @@ -480,8 +480,8 @@ RegExpTester::RegExpTester(QWidget* pParent, const QString& autoMergeRegExpToolT QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); pGrid->addWidget(box, line, 0, 1, 2); - chk_connect(box, &QDialogButtonBox::accepted, this, &RegExpTester::accept); - chk_connect(box, &QDialogButtonBox::rejected, this, &RegExpTester::reject); + connect(box, &QDialogButtonBox::accepted, this, &RegExpTester::accept); + connect(box, &QDialogButtonBox::rejected, this, &RegExpTester::reject); resize(800, sizeHint().height()); }