diff --git a/krArc/krarc.cpp b/krArc/krarc.cpp --- a/krArc/krarc.cpp +++ b/krArc/krarc.cpp @@ -487,8 +487,7 @@ escapedFilename.replace('[', "[[]"); proc << getCmd << getPath(arcFile->url()); if (arcType != "gzip" && arcType != "bzip2" && arcType != "lzma" && arcType != "xz") proc << localeEncodedString(escapedFilename); - connect(&proc, SIGNAL(newOutputData(KProcess*,QByteArray&)), - this, SLOT(receivedData(KProcess*,QByteArray&))); + connect(&proc, &KrLinecountingProcess::newOutputData, this, &kio_krarcProtocol::receivedData); proc.setMerge(false); } infoMessage(i18n("Unpacking %1...", url.fileName())); @@ -1736,8 +1735,7 @@ KrLinecountingProcess proc; proc << testCmd << fileName; - connect(&proc, SIGNAL(newOutputData(KProcess*,QByteArray&)), - this, SLOT(checkOutputForPassword(KProcess*,QByteArray&))); + connect(&proc, &KrLinecountingProcess::newOutputData, this, &kio_krarcProtocol::checkOutputForPassword); proc.start(); proc.waitForFinished(); encrypted = this->encrypted; diff --git a/krArc/krlinecountingprocess.cpp b/krArc/krlinecountingprocess.cpp --- a/krArc/krlinecountingprocess.cpp +++ b/krArc/krlinecountingprocess.cpp @@ -24,8 +24,8 @@ KrLinecountingProcess::KrLinecountingProcess() : KProcess() { setOutputChannelMode(KProcess::SeparateChannels); // without this output redirection has no effect! - connect(this, SIGNAL(readyReadStandardError()), SLOT(receivedError())); - connect(this, SIGNAL(readyReadStandardOutput()), SLOT(receivedOutput())); + connect(this, &KrLinecountingProcess::readyReadStandardError, this, &KrLinecountingProcess::receivedError); + connect(this, &KrLinecountingProcess::readyReadStandardOutput, [=]() { receivedOutput(); }); mergedOutput = true; } diff --git a/krusader/ActionMan/actionman.cpp b/krusader/ActionMan/actionman.cpp --- a/krusader/ActionMan/actionman.cpp +++ b/krusader/ActionMan/actionman.cpp @@ -50,10 +50,10 @@ applyButton = buttonBox->button(QDialogButtonBox::Apply); applyButton->setEnabled(false); - connect(buttonBox, SIGNAL(rejected()), SLOT(slotClose())); - connect(applyButton, SIGNAL(clicked()), SLOT(slotApply())); - connect(userActionPage, SIGNAL(changed()), SLOT(slotEnableApplyButton())); - connect(userActionPage, SIGNAL(applied()), SLOT(slotDisableApplyButton())); + connect(buttonBox, &QDialogButtonBox::rejected, this, &ActionMan::slotClose); + connect(applyButton, &QPushButton::clicked, this, &ActionMan::slotApply); + connect(userActionPage, &UserActionPage::changed, this, &ActionMan::slotEnableApplyButton); + connect(userActionPage, &UserActionPage::applied, this, &ActionMan::slotDisableApplyButton); exec(); diff --git a/krusader/ActionMan/actionproperty.cpp b/krusader/ActionMan/actionproperty.cpp --- a/krusader/ActionMan/actionproperty.cpp +++ b/krusader/ActionMan/actionproperty.cpp @@ -53,43 +53,43 @@ // fill with all existing categories cbCategory->addItems(krUserAction->allCategories()); - connect(ButtonAddPlaceholder, SIGNAL(clicked()), this, SLOT(addPlaceholder())); - connect(ButtonAddStartpath, SIGNAL(clicked()), this, SLOT(addStartpath())); - connect(ButtonNewProtocol, SIGNAL(clicked()), this, SLOT(newProtocol())); - connect(ButtonEditProtocol, SIGNAL(clicked()), this, SLOT(editProtocol())); - connect(ButtonRemoveProtocol, SIGNAL(clicked()), this, SLOT(removeProtocol())); - connect(ButtonAddPath, SIGNAL(clicked()), this, SLOT(addPath())); - connect(ButtonEditPath, SIGNAL(clicked()), this, SLOT(editPath())); - connect(ButtonRemovePath, SIGNAL(clicked()), this, SLOT(removePath())); - connect(ButtonAddMime, SIGNAL(clicked()), this, SLOT(addMime())); - connect(ButtonEditMime, SIGNAL(clicked()), this, SLOT(editMime())); - connect(ButtonRemoveMime, SIGNAL(clicked()), this, SLOT(removeMime())); - connect(ButtonNewFile, SIGNAL(clicked()), this, SLOT(newFile())); - connect(ButtonEditFile, SIGNAL(clicked()), this, SLOT(editFile())); - connect(ButtonRemoveFile, SIGNAL(clicked()), this, SLOT(removeFile())); - connect(KeyButtonShortcut, SIGNAL(keySequenceChanged(QKeySequence)), this, SLOT(changedShortcut(QKeySequence))); + connect(ButtonAddPlaceholder, &QToolButton::clicked, this, &ActionProperty::addPlaceholder); + connect(ButtonAddStartpath, &QToolButton::clicked, this, &ActionProperty::addStartpath); + connect(ButtonNewProtocol, &QToolButton::clicked, this, &ActionProperty::newProtocol); + connect(ButtonEditProtocol, &QToolButton::clicked, this, &ActionProperty::editProtocol); + connect(ButtonRemoveProtocol, &QToolButton::clicked, this, &ActionProperty::removeProtocol); + connect(ButtonAddPath, &QToolButton::clicked, this, &ActionProperty::addPath); + connect(ButtonEditPath, &QToolButton::clicked, this, &ActionProperty::editPath); + connect(ButtonRemovePath, &QToolButton::clicked, this, &ActionProperty::removePath); + connect(ButtonAddMime, &QToolButton::clicked, this, &ActionProperty::addMime); + connect(ButtonEditMime, &QToolButton::clicked, this, &ActionProperty::editMime); + connect(ButtonRemoveMime, &QToolButton::clicked, this, &ActionProperty::removeMime); + connect(ButtonNewFile, &QToolButton::clicked, this, &ActionProperty::newFile); + connect(ButtonEditFile, &QToolButton::clicked, this, &ActionProperty::editFile); + connect(ButtonRemoveFile, &QToolButton::clicked, this, &ActionProperty::removeFile); + connect(KeyButtonShortcut, &KKeySequenceWidget::keySequenceChanged, this, &ActionProperty::changedShortcut); // track modifications: - connect(leDistinctName, SIGNAL(textChanged(QString)), SLOT(setModified())); - connect(leTitle, SIGNAL(textChanged(QString)), SLOT(setModified())); - connect(ButtonIcon, SIGNAL(iconChanged(QString)), SLOT(setModified())); - connect(cbCategory, SIGNAL(currentTextChanged(QString)), SLOT(setModified())); - connect(leTooltip, SIGNAL(textChanged(QString)), SLOT(setModified())); - connect(textDescription, SIGNAL(textChanged()), SLOT(setModified())); - connect(leCommandline, SIGNAL(textChanged(QString)), SLOT(setModified())); - connect(leStartpath, SIGNAL(textChanged(QString)), SLOT(setModified())); - connect(chkSeparateStdError, SIGNAL(clicked()), SLOT(setModified())); - connect(radioCollectOutput, SIGNAL(clicked()), SLOT(setModified())); - connect(radioNormal, SIGNAL(clicked()), SLOT(setModified())); - connect(radioTE, SIGNAL(clicked()), SLOT(setModified())); - connect(radioTerminal, SIGNAL(clicked()), SLOT(setModified())); - connect(radioLocal, SIGNAL(clicked()), SLOT(setModified())); - connect(radioUrl, SIGNAL(clicked()), SLOT(setModified())); - connect(KeyButtonShortcut, SIGNAL(keySequenceChanged(QKeySequence)), SLOT(setModified())); - connect(chkEnabled, SIGNAL(clicked()), SLOT(setModified())); - connect(leDifferentUser, SIGNAL(textChanged(QString)), SLOT(setModified())); - connect(chkDifferentUser, SIGNAL(clicked()), SLOT(setModified())); - connect(chkConfirmExecution, SIGNAL(clicked()), SLOT(setModified())); - connect(chkSeparateStdError, SIGNAL(clicked()), SLOT(setModified())); + connect(leDistinctName, &KLineEdit::textChanged, this, [=]() { setModified(true); }); + connect(leTitle, &KLineEdit::textChanged, this, [=]() {setModified(true); }); + connect(ButtonIcon, &KIconButton::iconChanged, this, [=]() {setModified(true); }); + connect(cbCategory, &KComboBox::currentTextChanged, this, [=]() {setModified(true); }); + connect(leTooltip, &KLineEdit::textChanged, this, [=]() {setModified(true); }); + connect(textDescription, &KTextEdit::textChanged, this, [=]() {setModified(true); }); + connect(leCommandline, &KLineEdit::textChanged, this, [=]() {setModified(true); }); + connect(leStartpath, &KLineEdit::textChanged, this, [=]() {setModified(true); }); + connect(chkSeparateStdError, &QCheckBox::clicked, this, &ActionProperty::setModified); + connect(radioCollectOutput, &QRadioButton::clicked, this, &ActionProperty::setModified); + connect(radioNormal, &QRadioButton::clicked, this, &ActionProperty::setModified); + connect(radioTE, &QRadioButton::clicked, this, &ActionProperty::setModified); + connect(radioTerminal, &QRadioButton::clicked, this, &ActionProperty::setModified); + connect(radioLocal, &QRadioButton::clicked, this, &ActionProperty::setModified); + connect(radioUrl, &QRadioButton::clicked, this, &ActionProperty::setModified); + connect(KeyButtonShortcut, &KKeySequenceWidget::keySequenceChanged, this, [=]() {setModified(true); }); + connect(chkEnabled, &QCheckBox::clicked, this, &ActionProperty::setModified); + connect(leDifferentUser, &KLineEdit::textChanged, this, [=]() {setModified(true); }); + connect(chkDifferentUser, &QCheckBox::clicked, this, &ActionProperty::setModified); + connect(chkConfirmExecution, &QCheckBox::clicked, this, &ActionProperty::setModified); + connect(chkSeparateStdError, &QCheckBox::clicked, this, &ActionProperty::setModified); // The modified-state of the ShowOnly-lists is tracked in the access-functions below } diff --git a/krusader/ActionMan/addplaceholderpopup.cpp b/krusader/ActionMan/addplaceholderpopup.cpp --- a/krusader/ActionMan/addplaceholderpopup.cpp +++ b/krusader/ActionMan/addplaceholderpopup.cpp @@ -208,10 +208,10 @@ QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(okButton, SIGNAL(clicked()), this, SLOT(slotOk())); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), SIGNAL(clicked()), this, SLOT(reset())); + connect(okButton, &QPushButton:: clicked, this, &ParameterDialog::slotOk); + connect(buttonBox, &QDialogButtonBox::accepted, this, &ParameterDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &ParameterDialog::reject); + connect(buttonBox->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, this, &ParameterDialog::reset); } QString ParameterDialog::getParameter() @@ -309,7 +309,7 @@ _button = new QToolButton(hboxWidget); _button->setIcon(Icon("list-add")); hbox->addWidget(_button); - connect(_button, SIGNAL(clicked()), this, SLOT(addPlaceholder())); + connect(_button, &QToolButton::clicked, this, &ParameterPlaceholder::addPlaceholder); } QString ParameterPlaceholder::text() @@ -421,7 +421,7 @@ _button = new QToolButton(hboxWidget); hbox->addWidget(_button); _button->setIcon(Icon("document-open")); - connect(_button, SIGNAL(clicked()), this, SLOT(addFile())); + connect(_button, &QToolButton::clicked, this, &ParameterFile::addFile); } QString ParameterFile::text() @@ -534,11 +534,11 @@ _dirButton = new QToolButton(hboxWidget); hbox->addWidget(_dirButton); _dirButton->setIcon(Icon("document-open")); - connect(_dirButton, SIGNAL(clicked()), this, SLOT(setDir())); + connect(_dirButton, &QToolButton::clicked, this, &ParameterGoto::setDir); _placeholderButton = new QToolButton(hboxWidget); _placeholderButton->setIcon(Icon("list-add")); hbox->addWidget(_placeholderButton); - connect(_placeholderButton, SIGNAL(clicked()), this, SLOT(addPlaceholder())); + connect(_placeholderButton, &QToolButton::clicked, this, &ParameterGoto::addPlaceholder); layout->addWidget(hboxWidget); } diff --git a/krusader/ActionMan/useractionlistview.cpp b/krusader/ActionMan/useractionlistview.cpp --- a/krusader/ActionMan/useractionlistview.cpp +++ b/krusader/ActionMan/useractionlistview.cpp @@ -47,7 +47,7 @@ setSortingEnabled(true); sortItems(COL_TITLE, Qt::AscendingOrder); - connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(slotCurrentItemChanged(QTreeWidgetItem*))); + connect(this, &UserActionListView::currentItemChanged, this, &UserActionListView::slotCurrentItemChanged); update(); } diff --git a/krusader/ActionMan/useractionpage.cpp b/krusader/ActionMan/useractionpage.cpp --- a/krusader/ActionMan/useractionpage.cpp +++ b/krusader/ActionMan/useractionpage.cpp @@ -122,13 +122,13 @@ actionProperties = new ActionProperty(split); actionProperties->setEnabled(false); // if there are any actions in the list, the first is displayed and this widget is enabled - connect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(slotChangeCurrent())); - connect(newButton, SIGNAL(clicked()), SLOT(slotNewAction())); - connect(removeButton, SIGNAL(clicked()), SLOT(slotRemoveAction())); - connect(importButton, SIGNAL(clicked()), SLOT(slotImport())); - connect(exportButton, SIGNAL(clicked()), SLOT(slotExport())); - connect(copyButton, SIGNAL(clicked()), SLOT(slotToClip())); - connect(pasteButton, SIGNAL(clicked()), SLOT(slotFromClip())); + connect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); + connect(newButton, &QToolButton::clicked, this, &UserActionPage::slotNewAction); + connect(removeButton, &QToolButton::clicked, this, &UserActionPage::slotRemoveAction); + connect(importButton, &QToolButton::clicked, this, &UserActionPage::slotImport); + connect(exportButton, &QToolButton::clicked, this, &UserActionPage::slotExport); + connect(copyButton, &QToolButton::clicked, this, &UserActionPage::slotToClip); + connect(pasteButton, &QToolButton::clicked, this, &UserActionPage::slotFromClip); // forwards the changed signal of the properties connect(actionProperties, SIGNAL(changed()), SIGNAL(changed())); @@ -150,16 +150,16 @@ i18n("The current action has been modified. Do you want to apply these changes?") ); if (answer == KMessageBox::Cancel) { - disconnect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(slotChangeCurrent())); + disconnect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); actionTree->setCurrentAction(actionProperties->action()); - connect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(slotChangeCurrent())); + connect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); return false; } if (answer == KMessageBox::Yes) { if (! actionProperties->validProperties()) { - disconnect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(slotChangeCurrent())); + disconnect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); actionTree->setCurrentAction(actionProperties->action()); - connect(actionTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), SLOT(slotChangeCurrent())); + connect(actionTree, &UserActionListView::currentItemChanged, this, &UserActionPage::slotChangeCurrent); return false; } slotUpdateAction(); diff --git a/krusader/Archive/abstractthreadedjob.cpp b/krusader/Archive/abstractthreadedjob.cpp --- a/krusader/Archive/abstractthreadedjob.cpp +++ b/krusader/Archive/abstractthreadedjob.cpp @@ -127,15 +127,15 @@ addSubjob(job); job->setUiDelegate(new KIO::JobUiDelegate()); - connect(job, SIGNAL(result(KJob*)), this, SLOT(slotDownloadResult(KJob*))); + connect(job, &KIO::Job::result, this, &AbstractThreadedJob::slotDownloadResult); connect(job, SIGNAL(processedAmount(KJob*,KJob::Unit,qulonglong)), - this, SLOT(slotProcessedAmount(KJob*,KJob::Unit,qulonglong))); + this, SLOT(slotProcessedAmount(KJob*,KJob::Unit,qulonglong))); connect(job, SIGNAL(totalAmount(KJob*,KJob::Unit,qulonglong)), - this, SLOT(slotTotalAmount(KJob*,KJob::Unit,qulonglong))); + this, SLOT(slotTotalAmount(KJob*,KJob::Unit,qulonglong))); connect(job, SIGNAL(speed(KJob*,ulong)), - this, SLOT(slotSpeed(KJob*,ulong))); + this, SLOT(slotSpeed(KJob*,ulong))); connect(job, SIGNAL(description(KJob*,QString,QPair,QPair)), - this, SLOT(slotDescription(KJob*,QString,QPair,QPair))); + this, SLOT(slotDescription(KJob*,QString,QPair,QPair))); } break; case CMD_MAXPROGRESSVALUE: { diff --git a/krusader/Archive/kr7zencryptionchecker.cpp b/krusader/Archive/kr7zencryptionchecker.cpp --- a/krusader/Archive/kr7zencryptionchecker.cpp +++ b/krusader/Archive/kr7zencryptionchecker.cpp @@ -24,7 +24,7 @@ Kr7zEncryptionChecker::Kr7zEncryptionChecker() : KProcess(), encrypted(false), lastData() { setOutputChannelMode(KProcess::SeparateChannels); // without this output redirection has no effect! - connect(this, SIGNAL(readyReadStandardOutput()), SLOT(receivedOutput())); + connect(this, &Kr7zEncryptionChecker::readyReadStandardOutput, this, [=]() {receivedOutput(); }); } void Kr7zEncryptionChecker::setupChildProcess() diff --git a/krusader/Archive/krarchandler.cpp b/krusader/Archive/krarchandler.cpp --- a/krusader/Archive/krarchandler.cpp +++ b/krusader/Archive/krarchandler.cpp @@ -331,11 +331,9 @@ // tell the user to wait observer->subJobStarted(i18n("Unpacking File(s)"), count); if (count != 0) { - connect(&proc, SIGNAL(newOutputLines(int)), - observer, SLOT(incrementProgress(int))); + connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KRarcObserver::incrementProgress); if (type == "rpm") - connect(&proc, SIGNAL(newErrorLines(int)), - observer, SLOT(incrementProgress(int))); + connect(&proc, &KrLinecountingProcess::newErrorLines, observer, &KRarcObserver::incrementProgress); } // start the unpacking process @@ -407,8 +405,7 @@ // tell the user to wait observer->subJobStarted(i18n("Testing Archive"), count); if (count != 0) - connect(&proc, SIGNAL(newOutputLines(int)), - observer, SLOT(incrementProgress(int))); + connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KRarcObserver::incrementProgress); // start the unpacking process proc.start(); @@ -535,8 +532,7 @@ // tell the user to wait observer->subJobStarted(i18n("Packing File(s)"), count); if (count != 0) - connect(&proc, SIGNAL(newOutputLines(int)), - observer, SLOT(incrementProgress(int))); + connect(&proc, &KrLinecountingProcess::newOutputLines, observer, &KRarcObserver::incrementProgress); // start the packing process proc.start(); diff --git a/krusader/BookMan/kraddbookmarkdlg.cpp b/krusader/BookMan/kraddbookmarkdlg.cpp --- a/krusader/BookMan/kraddbookmarkdlg.cpp +++ b/krusader/BookMan/kraddbookmarkdlg.cpp @@ -69,7 +69,7 @@ _createInBtn = new QToolButton(this); _createInBtn->setIcon(Icon("go-down")); _createInBtn->setCheckable(true); - connect(_createInBtn, SIGNAL(toggled(bool)), this, SLOT(toggleCreateIn(bool))); + connect(_createInBtn, &QToolButton::toggled, this, &KrAddBookmarkDlg::toggleCreateIn); layout->addWidget(_createInBtn, 2, 2); mainLayout->addLayout(layout); @@ -87,10 +87,10 @@ newFolderButton = new QPushButton(i18n("New Folder")); buttonBox->addButton(newFolderButton, QDialogButtonBox::ActionRole); newFolderButton->setVisible(false);// hide it until _createIn is shown - connect(newFolderButton, SIGNAL(clicked()), this, SLOT(newFolder())); + connect(newFolderButton, &QPushButton::clicked, this, &KrAddBookmarkDlg::newFolder); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(buttonBox, &QDialogButtonBox::accepted, this, &KrAddBookmarkDlg::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &KrAddBookmarkDlg::reject); _name->setFocus(); resize(sizeHint().width() * 2, sizeHint().height()); @@ -121,7 +121,7 @@ populateCreateInWidget(krBookMan->_root, item); _createIn->setCurrentItem(item); slotSelectionChanged(); - connect(_createIn, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged())); + connect(_createIn, &KrTreeWidget::itemSelectionChanged, this, &KrAddBookmarkDlg::slotSelectionChanged); return _createIn; } diff --git a/krusader/BookMan/krbookmark.cpp b/krusader/BookMan/krbookmark.cpp --- a/krusader/BookMan/krbookmark.cpp +++ b/krusader/BookMan/krbookmark.cpp @@ -41,7 +41,7 @@ QString actName = actionName.isNull() ? BM_NAME(name) : BM_NAME(actionName); setText(name); parent->addAction(actName, this); - connect(this, SIGNAL(triggered()), this, SLOT(activatedProxy())); + connect(this, &KrBookmark::triggered, this, &KrBookmark::activatedProxy); setIconName(iconName); } diff --git a/krusader/BookMan/krbookmarkbutton.cpp b/krusader/BookMan/krbookmarkbutton.cpp --- a/krusader/BookMan/krbookmarkbutton.cpp +++ b/krusader/BookMan/krbookmarkbutton.cpp @@ -46,8 +46,8 @@ acmBookmarks->setDelayed(false); setMenu(acmBookmarks->menu()); - connect(acmBookmarks->menu(), SIGNAL(aboutToShow()), this, SLOT(populate())); - connect(acmBookmarks->menu(), SIGNAL(aboutToShow()), this, SIGNAL(aboutToShow())); + connect(acmBookmarks->menu(), &QMenu::aboutToShow, this, &KrBookmarkButton::populate); + connect(acmBookmarks->menu(), &QMenu::aboutToShow, this, &KrBookmarkButton::aboutToShow); } void KrBookmarkButton::populate() diff --git a/krusader/BookMan/krbookmarkhandler.cpp b/krusader/BookMan/krbookmarkhandler.cpp --- a/krusader/BookMan/krbookmarkhandler.cpp +++ b/krusader/BookMan/krbookmarkhandler.cpp @@ -79,7 +79,7 @@ // create bookmark manager QString filename = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + BOOKMARKS_FILE; manager = KBookmarkManager::managerForFile(filename, QStringLiteral("krusader")); - connect(manager, SIGNAL(changed(QString,QString)), this, SLOT(bookmarksChanged(QString,QString))); + connect(manager, &KBookmarkManager::changed, this, &KrBookmarkHandler::bookmarksChanged); // create the quick search bar and action _quickSearchAction = new QWidgetAction(this); diff --git a/krusader/Dialogs/krdialogs.cpp b/krusader/Dialogs/krdialogs.cpp --- a/krusader/Dialogs/krdialogs.cpp +++ b/krusader/Dialogs/krdialogs.cpp @@ -122,10 +122,10 @@ i18n("Enqueue the job if another job is running. Otherwise start immediately.")); buttonBox->addButton(queueButton, QDialogButtonBox::ActionRole); - connect(buttonBox, SIGNAL(accepted()), SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), SLOT(reject())); - connect(queueButton, SIGNAL(clicked()), SLOT(slotQueueButtonClicked())); - connect(urlRequester_, SIGNAL(textChanged(QString)), SLOT(slotTextChanged(QString))); + connect(buttonBox, &QDialogButtonBox::accepted, this, &KUrlRequesterDlgForCopy::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &KUrlRequesterDlgForCopy::reject); + connect(queueButton, &QPushButton::clicked, this, &KUrlRequesterDlgForCopy::slotQueueButtonClicked); + connect(urlRequester_, &KUrlRequester::textChanged, this, &KUrlRequesterDlgForCopy::slotTextChanged); urlRequester_->setFocus(); bool state = !urlName.isEmpty(); @@ -181,8 +181,8 @@ setMinimumSize(dateWidget->sizeHint()); setMaximumSize(dateWidget->sizeHint()); resize(minimumSize()); - connect(dateWidget, SIGNAL(dateSelected(QDate)), this, SLOT(setDate(QDate))); - connect(dateWidget, SIGNAL(dateEntered(QDate)), this, SLOT(setDate(QDate))); + connect(dateWidget, &KDatePicker::dateSelected, this, &KRGetDate::setDate); + connect(dateWidget, &KDatePicker::dateEntered, this, &KRGetDate::setDate); // keep the original date - incase ESC is pressed originalDate = date; diff --git a/krusader/Dialogs/krmaskchoice.cpp b/krusader/Dialogs/krmaskchoice.cpp --- a/krusader/Dialogs/krmaskchoice.cpp +++ b/krusader/Dialogs/krmaskchoice.cpp @@ -105,15 +105,15 @@ MainLayout->addWidget(ButtonBox); // signals and slots connections - connect(ButtonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(ButtonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(PushButton7, SIGNAL(clicked()), this, SLOT(addSelection())); - connect(PushButton7_2, SIGNAL(clicked()), this, SLOT(deleteSelection())); - connect(PushButton7_3, SIGNAL(clicked()), this, SLOT(clearSelections())); - connect(selection, SIGNAL(activated(QString)), selection, SLOT(setEditText(QString))); - connect(selection->lineEdit(), SIGNAL(returnPressed()), this, SLOT(accept())); - connect(preSelections, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(currentItemChanged(QListWidgetItem*))); - connect(preSelections, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(acceptFromList(QListWidgetItem*))); + connect(ButtonBox, &QDialogButtonBox::rejected, this, &KRMaskChoice::reject); + connect(ButtonBox, &QDialogButtonBox::accepted, this, &KRMaskChoice::accept); + connect(PushButton7, &QPushButton::clicked, this, &KRMaskChoice::addSelection); + connect(PushButton7_2, &QPushButton::clicked, this, &KRMaskChoice::deleteSelection); + connect(PushButton7_3, &QPushButton::clicked, this, &KRMaskChoice::clearSelections); + connect(selection, QOverload::of(&KComboBox::activated), selection, &KComboBox::setEditText); + connect(selection->lineEdit(), &QLineEdit::returnPressed, this, &KRMaskChoice::accept); + connect(preSelections, &KrListWidget::currentItemChanged, this, &KRMaskChoice::currentItemChanged); + connect(preSelections, &KrListWidget::itemActivated, this, &KRMaskChoice::acceptFromList); } /* diff --git a/krusader/Dialogs/krpleasewait.cpp b/krusader/Dialogs/krpleasewait.cpp --- a/krusader/Dialogs/krpleasewait.cpp +++ b/krusader/Dialogs/krpleasewait.cpp @@ -49,7 +49,7 @@ setAutoClose(false); setAutoReset(false); - connect(timer, SIGNAL(timeout()), this, SLOT(cycleProgress())); + connect(timer, &QTimer::timeout, this, &KRPleaseWait::cycleProgress); QProgressBar* progress = new QProgressBar(this); progress->setMaximum(count); @@ -109,7 +109,7 @@ { if (dlg == 0) { dlg = new KRPleaseWait(msg , _parentWindow, count, cancel); - connect(dlg, SIGNAL(canceled()), this, SLOT(killJob())); + connect(dlg, &KRPleaseWait::canceled, this, &KRPleaseWaitHandler::killJob); } incMutex = cycleMutex = _wasCancelled = false; dlg->setValue(0); diff --git a/krusader/Dialogs/newftpgui.cpp b/krusader/Dialogs/newftpgui.cpp --- a/krusader/Dialogs/newftpgui.cpp +++ b/krusader/Dialogs/newftpgui.cpp @@ -149,13 +149,11 @@ okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(buttonBox, &QDialogButtonBox::accepted, this, &newFTPGUI::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &newFTPGUI::reject); - connect(prefix, SIGNAL(activated(QString)), - this, SLOT(slotTextChanged(QString))); - connect(url, SIGNAL(activated(QString)), - url, SLOT(addToHistory(QString))); + connect(prefix, QOverload::of(&KComboBox::activated), this, &newFTPGUI::slotTextChanged); + connect(url, QOverload::of(&KHistoryComboBox::activated), url, &KHistoryComboBox::addToHistory); if(!lastUsedProtocol.isEmpty()) { // update the port field diff --git a/krusader/krslots.h b/krusader/krslots.h --- a/krusader/krslots.h +++ b/krusader/krslots.h @@ -44,7 +44,7 @@ KrProcess(QString in1, QString in2) { tmp1 = in1; tmp2 = in2; - connect(this, SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(processHasExited())); + connect(this, QOverload::of(&KrProcess::finished), this, &KrProcess::processHasExited); } public slots: diff --git a/krusader/krusader.cpp b/krusader/krusader.cpp --- a/krusader/krusader.cpp +++ b/krusader/krusader.cpp @@ -137,7 +137,7 @@ // create MountMan KrGlobal::mountMan = new KMountMan(this); - connect(KrGlobal::mountMan, SIGNAL(refreshPanel(QUrl)), SLOTS, SLOT(refresh(QUrl))); + connect(KrGlobal::mountMan, &KMountMan::refreshPanel, SLOTS, &KRslots::refresh); // create popular URLs container _popularUrls = new PopularUrls(this); @@ -271,10 +271,10 @@ //HACK: make sure the active view becomes focused // for some reason sometimes the active view cannot be focused immediately at this point, // so queue it for the main loop - QTimer::singleShot(0, ACTIVE_PANEL->view->widget(), SLOT(setFocus())); + QTimer::singleShot(0, ACTIVE_PANEL->view->widget(), QOverload<>::of(&QWidget::setFocus)); _openUrlTimer.setSingleShot(true); - connect(&_openUrlTimer, SIGNAL(timeout()), SLOT(doOpenUrl())); + connect(&_openUrlTimer, &QTimer::timeout, this, &Krusader::doOpenUrl); KStartupInfo *startupInfo = new KStartupInfo(0, this); connect(startupInfo, &KStartupInfo::gotNewStartup, @@ -356,7 +356,7 @@ void Krusader::setupActions() { QAction *bringToTopAct = new QAction(i18n("Bring Main Window to Top"), this); actionCollection()->addAction("bring_main_window_to_top", bringToTopAct); - connect(bringToTopAct, SIGNAL(triggered()), SLOT(moveToTop())); + connect(bringToTopAct, &QAction::triggered, this, &Krusader::moveToTop); KrActions::setupActions(this); _krActions = new KrActions(this); diff --git a/krusader/krusaderview.cpp b/krusader/krusaderview.cpp --- a/krusader/krusaderview.cpp +++ b/krusader/krusaderview.cpp @@ -424,8 +424,8 @@ { ProfileManager profileManager("Panel", this); profileManager.hide(); - connect(&profileManager, SIGNAL(saveToProfile(QString)), this, SLOT(savePanelProfiles(QString))); - connect(&profileManager, SIGNAL(loadFromProfile(QString)), this, SLOT(loadPanelProfiles(QString))); + connect(&profileManager, &ProfileManager::saveToProfile, this, &KrusaderView::savePanelProfiles); + connect(&profileManager, &ProfileManager::loadFromProfile, this, &KrusaderView::loadPanelProfiles); if (profileName.isEmpty()) profileManager.profilePopup(); else diff --git a/krusader/panelmanager.cpp b/krusader/panelmanager.cpp --- a/krusader/panelmanager.cpp +++ b/krusader/panelmanager.cpp @@ -63,16 +63,16 @@ _newTab->setToolTip(i18n("Open a new tab in home")); _newTab->setIcon(Icon("tab-new")); _newTab->adjustSize(); - connect(_newTab, SIGNAL(clicked()), this, SLOT(slotNewTab())); + connect(_newTab, &QToolButton::clicked, this, QOverload<>::of(&PanelManager::slotNewTab)); // tab-bar _tabbar = new PanelTabBar(this, _actions); - connect(_tabbar, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int))); - connect(_tabbar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotCloseTab(int))); - connect(_tabbar, SIGNAL(closeCurrentTab()), this, SLOT(slotCloseTab())); + connect(_tabbar, &PanelTabBar::currentChanged, this, &PanelManager::slotCurrentTabChanged); + connect(_tabbar, &PanelTabBar::tabCloseRequested, this, QOverload::of(&PanelManager::slotCloseTab)); + connect(_tabbar, &PanelTabBar::closeCurrentTab, this, QOverload<>::of(&PanelManager::slotCloseTab)); connect(_tabbar, SIGNAL(newTab(QUrl)), this, SLOT(slotNewTab(QUrl))); - connect(_tabbar, SIGNAL(draggingTab(QMouseEvent*)), this, SLOT(slotDraggingTab(QMouseEvent*))); - connect(_tabbar, SIGNAL(draggingTabFinished(QMouseEvent*)), this, SLOT(slotDraggingTabFinished(QMouseEvent*))); + connect(_tabbar, &PanelTabBar::draggingTab, this, &PanelManager::slotDraggingTab); + connect(_tabbar, &PanelTabBar::draggingTabFinished, this, &PanelManager::slotDraggingTabFinished); QHBoxLayout *tabbarLayout = new QHBoxLayout; tabbarLayout->setSpacing(0);