diff --git a/krusader/Archive/abstractthreadedjob.cpp b/krusader/Archive/abstractthreadedjob.cpp --- a/krusader/Archive/abstractthreadedjob.cpp +++ b/krusader/Archive/abstractthreadedjob.cpp @@ -312,7 +312,7 @@ void AbstractJobThread::run() { - QTimer::singleShot(0, this, SLOT(slotStart())); + QTimer::singleShot(0, this, &AbstractJobThread::slotStart); QPointer threadLoop = new QEventLoop(this); _loop = threadLoop; diff --git a/krusader/Dialogs/krpleasewait.cpp b/krusader/Dialogs/krpleasewait.cpp --- a/krusader/Dialogs/krpleasewait.cpp +++ b/krusader/Dialogs/krpleasewait.cpp @@ -130,7 +130,7 @@ if (cycleMutex) return; cycleMutex = true; if (dlg) dlg->cycleProgress(); - if (cycle) QTimer::singleShot(2000, this, SLOT(cycleProgress())); + if (cycle) QTimer::singleShot(2000, this, &KRPleaseWaitHandler::cycleProgress); cycleMutex = false; } diff --git a/krusader/DiskUsage/diskusagegui.cpp b/krusader/DiskUsage/diskusagegui.cpp --- a/krusader/DiskUsage/diskusagegui.cpp +++ b/krusader/DiskUsage/diskusagegui.cpp @@ -237,6 +237,6 @@ baseDirectory = newDir; - QTimer::singleShot(0, this, SLOT(slotLoadUsageInfo())); + QTimer::singleShot(0, this, &DiskUsageGUI::slotLoadUsageInfo); return true; } diff --git a/krusader/DiskUsage/dulines.cpp b/krusader/DiskUsage/dulines.cpp --- a/krusader/DiskUsage/dulines.cpp +++ b/krusader/DiskUsage/dulines.cpp @@ -498,7 +498,7 @@ duItem->setText(1, item->percent()); if (!refreshNeeded) { refreshNeeded = true; - QTimer::singleShot(0, this, SLOT(slotRefresh())); + QTimer::singleShot(0, this, &DULines::slotRefresh); } break; } diff --git a/krusader/FileSystem/sizecalculator.cpp b/krusader/FileSystem/sizecalculator.cpp --- a/krusader/FileSystem/sizecalculator.cpp +++ b/krusader/FileSystem/sizecalculator.cpp @@ -32,7 +32,7 @@ : QObject(nullptr), m_urls(urls), m_nextUrls(urls), m_totalSize(0), m_totalFiles(0), m_totalDirs(0), m_canceled(false), m_directorySizeJob(nullptr) { - QTimer::singleShot(0, this, SLOT(start())); + QTimer::singleShot(0, this, &SizeCalculator::start); } SizeCalculator::~SizeCalculator() diff --git a/krusader/Filter/generalfilter.cpp b/krusader/Filter/generalfilter.cpp --- a/krusader/Filter/generalfilter.cpp +++ b/krusader/Filter/generalfilter.cpp @@ -390,8 +390,8 @@ connect(profileManager, &ProfileManager::saveToProfile, fltTabs, &FilterTabs::saveToProfile); } - connect(searchFor, SIGNAL(activated(QString)), searchFor, SLOT(addToHistory(QString))); - connect(containsText, SIGNAL(activated(QString)), containsText, SLOT(addToHistory(QString))); + connect(searchFor, QOverload::of(&KHistoryComboBox::activated), searchFor, &KHistoryComboBox::addToHistory); + connect(containsText, QOverload::of(&KHistoryComboBox::activated), containsText, &KHistoryComboBox::addToHistory); // load the completion and history lists // ==> search for diff --git a/krusader/GUI/kcmdline.cpp b/krusader/GUI/kcmdline.cpp --- a/krusader/GUI/kcmdline.cpp +++ b/krusader/GUI/kcmdline.cpp @@ -178,17 +178,17 @@ QStringList list = grpSvr.readEntry("cmdline history", QStringList()); cmdLine->setHistoryItems(list); - connect(cmdLine, SIGNAL(returnPressed(QString)), this, SLOT(slotRun())); - connect(cmdLine, SIGNAL(returnPressed(QString)), cmdLine->lineEdit(), SLOT(clear())); - connect(cmdLine, SIGNAL(returnToPanel()), this, SLOT(slotReturnFocus())); + connect(cmdLine, QOverload::of(&CmdLineCombo::returnPressed), this, &KCMDLine::slotRun); + connect(cmdLine, QOverload::of(&CmdLineCombo::returnPressed), cmdLine->lineEdit(), &QLineEdit::clear); + connect(cmdLine, &CmdLineCombo::returnToPanel, this, &KCMDLine::slotReturnFocus); cmdLine->setWhatsThis(i18n("

Well, it is actually quite simple: you type your command here and Krusader obeys.

Tip: move within command line history with <Up> and <Down> arrows.

")); layout->addWidget(cmdLine, 0, 1); buttonAddPlaceholder = new QToolButton(this); buttonAddPlaceholder->setAutoRaise(true); buttonAddPlaceholder->setIcon(Icon("list-add")); - connect(buttonAddPlaceholder, SIGNAL(clicked()), this, SLOT(addPlaceholder())); + connect(buttonAddPlaceholder, &QToolButton::clicked, this, &KCMDLine::addPlaceholder); buttonAddPlaceholder->setWhatsThis(i18n("Add Placeholders for the selected files in the panel.")); layout->addWidget(buttonAddPlaceholder, 0, 2); diff --git a/krusader/GUI/terminaldock.cpp b/krusader/GUI/terminaldock.cpp --- a/krusader/GUI/terminaldock.cpp +++ b/krusader/GUI/terminaldock.cpp @@ -283,7 +283,7 @@ if (konsole_part && konsole_part->widget()) { // BUGFIX: TE scrolling bug (see upper) // show the Konsole part delayed - QTimer::singleShot(0, konsole_part->widget(), SLOT(show())); + QTimer::singleShot(0, konsole_part->widget(), &QWidget::show); } } diff --git a/krusader/KViewer/krviewer.cpp b/krusader/KViewer/krviewer.cpp --- a/krusader/KViewer/krviewer.cpp +++ b/krusader/KViewer/krviewer.cpp @@ -250,7 +250,7 @@ // don't activate the close functions immediately! // it can cause crash if (act == tabCloseAction || act == quitAction) { - QTimer::singleShot(0, act, SLOT(trigger())); + QTimer::singleShot(0, act, &QAction::trigger); } else { act->activate(QAction::Trigger); } @@ -432,7 +432,7 @@ krMainWindow->activateWindow(); } - QTimer::singleShot(0, this, SLOT(close())); + QTimer::singleShot(0, this, &KrViewer::close); } else if (tabBar.count() == 1) { // no point in detaching only one tab.. detachAction->setEnabled(false); @@ -502,7 +502,7 @@ void KrViewer::checkModified() { - QTimer::singleShot(CHECK_MODFIED_INTERVAL, this, SLOT(checkModified())); + QTimer::singleShot(CHECK_MODFIED_INTERVAL, this, &KrViewer::checkModified); PanelViewerBase* pvb = static_cast(tabBar.currentWidget()); if (pvb) diff --git a/krusader/KViewer/lister.h b/krusader/KViewer/lister.h --- a/krusader/KViewer/lister.h +++ b/krusader/KViewer/lister.h @@ -106,8 +106,10 @@ void performAnchorChange(const int anchor); void getScreenPosition(const int position, int &x, int &y); -protected slots: +public slots: void slotActionTriggered(const int action); + +protected slots: void slotCursorPositionChanged(); void zoomIn(const int range = 1); void zoomOut(const int range = 1); diff --git a/krusader/KViewer/lister.cpp b/krusader/KViewer/lister.cpp --- a/krusader/KViewer/lister.cpp +++ b/krusader/KViewer/lister.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -1319,7 +1320,7 @@ grid->addWidget(statusWidget, 1, 0, 1, 2); setWidget(widget); - connect(_scrollBar, SIGNAL(actionTriggered(int)), _textArea, SLOT(slotActionTriggered(int))); + connect(_scrollBar, &QScrollBar::actionTriggered, _textArea, &ListerTextArea::slotActionTriggered); connect(&_searchUpdateTimer, &QTimer::timeout, this, &Lister::slotUpdate); new ListerBrowserExtension(this); @@ -1558,7 +1559,7 @@ _searchIsForward = forward; _searchHexadecimal = hex; - QTimer::singleShot(0, this, SLOT(slotSearchMore())); + QTimer::singleShot(0, this, &Lister::slotSearchMore); _searchInProgress = true; _searchProgressCounter = 3; @@ -1713,7 +1714,7 @@ } } - QTimer::singleShot(0, this, SLOT(slotSearchMore())); + QTimer::singleShot(0, this, &Lister::slotSearchMore); } void Lister::resetSearchPosition() @@ -1930,11 +1931,9 @@ if (url.isEmpty()) return; - KIO::Job *saveJob = KIO::put(url, -1, KIO::Overwrite); - connect(saveJob, SIGNAL(dataReq(KIO::Job*,QByteArray&)), - this, SLOT(slotDataSend(KIO::Job*,QByteArray&))); - connect(saveJob, SIGNAL(result(KJob*)), - this, SLOT(slotSendFinished(KJob*))); + KIO::TransferJob *saveJob = KIO::put(url, -1, KIO::Overwrite); + connect(saveJob, &KIO::TransferJob::dataReq, this, &Lister::slotDataSend); + connect(saveJob, &KIO::TransferJob::result, this, &Lister::slotSendFinished); saveJob->setUiDelegate(new KIO::JobUiDelegate()); KIO::getJobTracker()->registerJob(saveJob); diff --git a/krusader/KViewer/panelviewer.cpp b/krusader/KViewer/panelviewer.cpp --- a/krusader/KViewer/panelviewer.cpp +++ b/krusader/KViewer/panelviewer.cpp @@ -106,7 +106,7 @@ openFile(KFileItem(url)); else { KIO::StatJob* statJob = KIO::stat(url, KIO::HideProgressInfo); - connect(statJob, SIGNAL(result(KJob*)), this, SLOT(slotStatResult(KJob*))); + connect(statJob, &KIO::StatJob::result, this, &PanelViewerBase::slotStatResult); } } @@ -252,7 +252,7 @@ args.setReload(true); cpart->setArguments(args); if (cpart->openUrl(curl)) { - connect(cpart, SIGNAL(destroyed()), this, SLOT(slotCPartDestroyed())); + connect(cpart.data(), &KParts::ReadOnlyPart::destroyed, this, &PanelViewer::slotCPartDestroyed); emit openUrlFinished(this, true); return; } @@ -288,8 +288,8 @@ if (part) { KParts::BrowserExtension * ext = KParts::BrowserExtension::childObject(part); if (ext) { - connect(ext, SIGNAL(openUrlRequestDelayed(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)), this, SLOT(openUrl(QUrl))); - connect(ext, SIGNAL(openUrlRequestDelayed(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)), this, SIGNAL(openUrlRequest(QUrl))); + connect(ext, &KParts::BrowserExtension::openUrlRequestDelayed, this, &PanelViewer::openUrl); + connect(ext, &KParts::BrowserExtension::openUrlRequestDelayed, this, &PanelViewer::openUrlRequest); } } return part; @@ -362,7 +362,7 @@ args.setReload(true); cpart->setArguments(args); if (cpart->openUrl(curl)) { - connect(cpart, SIGNAL(destroyed()), this, SLOT(slotCPartDestroyed())); + connect(cpart.data(), &KParts::ReadOnlyPart::destroyed, this, &PanelEditor::slotCPartDestroyed); emit openUrlFinished(this, true); return; } // else: don't show error message - assume this has been done by the editor part @@ -407,8 +407,8 @@ if (part) { KParts::BrowserExtension * ext = KParts::BrowserExtension::childObject(part); if (ext) { - connect(ext, SIGNAL(openUrlRequestDelayed(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)), this, SLOT(openUrl(QUrl))); - connect(ext, SIGNAL(openUrlRequestDelayed(QUrl,KParts::OpenUrlArguments,KParts::BrowserArguments)), this, SIGNAL(openUrlRequest(QUrl))); + connect(ext, &KParts::BrowserExtension::openUrlRequestDelayed, this, &PanelEditor::openUrl); + connect(ext, &KParts::BrowserExtension::openUrlRequestDelayed, this, &PanelEditor::openUrlRequest); } } return part; diff --git a/krusader/Konfigurator/konfiguratoritems.cpp b/krusader/Konfigurator/konfiguratoritems.cpp --- a/krusader/Konfigurator/konfiguratoritems.cpp +++ b/krusader/Konfigurator/konfiguratoritems.cpp @@ -421,17 +421,17 @@ QHBoxLayout *layout = new QHBoxLayout(this); ext = new KonfiguratorExtension(this, configGroup, name, restart, page); - connect(ext, SIGNAL(applyAuto(QObject*,QString,QString)), this, SLOT(slotApply(QObject*,QString,QString))); - connect(ext, SIGNAL(setDefaultsAuto(QObject*)), this, SLOT(slotSetDefaults(QObject*))); - connect(ext, SIGNAL(setInitialValue(QObject*)), this, SLOT(loadInitialValue())); + connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorFontChooser::slotApply); + connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorFontChooser::slotSetDefaults); + connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorFontChooser::loadInitialValue); pLabel = new QLabel(this); pLabel->setMinimumWidth(150); layout->addWidget(pLabel); pToolButton = new QToolButton(this); - connect(pToolButton, SIGNAL(clicked()), this, SLOT(slotBrowseFont())); + connect(pToolButton, &QToolButton::clicked, this, &KonfiguratorFontChooser::slotBrowseFont); pToolButton->setIcon(Icon("document-open")); layout->addWidget(pToolButton); @@ -495,13 +495,13 @@ } ext = new KonfiguratorExtension(this, configGroup, name, restart, page); - connect(ext, SIGNAL(applyAuto(QObject*,QString,QString)), this, SLOT(slotApply(QObject*,QString,QString))); - connect(ext, SIGNAL(setDefaultsAuto(QObject*)), this, SLOT(slotSetDefaults(QObject*))); - connect(ext, SIGNAL(setInitialValue(QObject*)), this, SLOT(loadInitialValue())); + connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorComboBox::slotApply); + connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorComboBox::slotSetDefaults); + connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorComboBox::loadInitialValue); -// connect( this, SIGNAL(highlighted(int)), ext, SLOT(setChanged()) ); /* Removed because of startup combo failure */ - connect(this, SIGNAL(activated(int)), ext, SLOT(setChanged())); - connect(this, SIGNAL(currentTextChanged(QString)), ext, SLOT(setChanged())); + //connect(this, &KonfiguratorComboBox::highlighted, ext, &KonfiguratorExtension::setChanged); /* Removed because of startup combo failure */ + connect(this, QOverload::of(&KonfiguratorComboBox::activated), ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); + connect(this, &KonfiguratorComboBox::currentTextChanged, ext, QOverload<>::of(&KonfiguratorExtension::setChanged)); setEditable(editable); loadInitialValue(); @@ -566,9 +566,9 @@ { ext = new KonfiguratorExtension(this, configGroup, name, restart, page); - connect(ext, SIGNAL(applyAuto(QObject*,QString,QString)), this, SLOT(slotApply(QObject*,QString,QString))); - connect(ext, SIGNAL(setDefaultsAuto(QObject*)), this, SLOT(slotSetDefaults(QObject*))); - connect(ext, SIGNAL(setInitialValue(QObject*)), this, SLOT(loadInitialValue())); + connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorColorChooser::slotApply); + connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorColorChooser::slotSetDefaults); + connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorColorChooser::loadInitialValue); addColor(i18n("Custom color"), QColor(255, 255, 255)); addColor(i18nc("Default color", "Default"), defaultValue); @@ -596,7 +596,7 @@ addColor(i18n("Dark Gray"), Qt::darkGray); addColor(i18n("Black"), Qt::black); - connect(this, SIGNAL(activated(int)), this, SLOT(slotCurrentChanged(int))); + connect(this, QOverload::of(&KonfiguratorColorChooser::activated), this, &KonfiguratorColorChooser::slotCurrentChanged); loadInitialValue(); } @@ -768,9 +768,9 @@ defaultValue(defaultValue) { ext = new KonfiguratorExtension(this, configGroup, name, restart, page); - connect(ext, SIGNAL(applyAuto(QObject*,QString,QString)), this, SLOT(slotApply(QObject*,QString,QString))); - connect(ext, SIGNAL(setDefaultsAuto(QObject*)), this, SLOT(slotSetDefaults(QObject*))); - connect(ext, SIGNAL(setInitialValue(QObject*)), this, SLOT(loadInitialValue())); + connect(ext, &KonfiguratorExtension::applyAuto, this, &KonfiguratorListBox::slotApply); + connect(ext, &KonfiguratorExtension::setDefaultsAuto, this, &KonfiguratorListBox::slotSetDefaults); + connect(ext, &KonfiguratorExtension::setInitialValue, this, &KonfiguratorListBox::loadInitialValue); loadInitialValue(); } diff --git a/krusader/Konfigurator/krresulttable.cpp b/krusader/Konfigurator/krresulttable.cpp --- a/krusader/Konfigurator/krresulttable.cpp +++ b/krusader/Konfigurator/krresulttable.cpp @@ -197,8 +197,7 @@ _label->setContentsMargins(5, 5, 5, 5); _label->setAlignment(Qt::AlignTop); grid->addWidget(_label, _numRows, 0); - connect(_label, SIGNAL(leftClickedUrl(QString)), - SLOT(website(QString))); + connect(dynamic_cast(_label), QOverload::of(&KUrlLabel::leftClickedUrl), this, &KrArchiverResultTable::website); // Found column _label = new QLabel(arch->getPath(), this); diff --git a/krusader/Locate/locate.cpp b/krusader/Locate/locate.cpp --- a/krusader/Locate/locate.cpp +++ b/krusader/Locate/locate.cpp @@ -190,12 +190,9 @@ resultList->setSelectionMode(QAbstractItemView::ExtendedSelection); resultList->setDragEnabled(true); - connect(resultList, SIGNAL(itemRightClicked(QTreeWidgetItem*,QPoint,int)), - this, SLOT(slotRightClick(QTreeWidgetItem*,QPoint))); - connect(resultList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), - this, SLOT(slotDoubleClick(QTreeWidgetItem*))); - connect(resultList, SIGNAL(itemActivated(QTreeWidgetItem*,int)), - this, SLOT(slotDoubleClick(QTreeWidgetItem*))); + connect(resultList, &KrTreeWidget::itemRightClicked, this, &LocateDlg::slotRightClick); + connect(resultList, &KrTreeWidget::itemDoubleClicked, this, &LocateDlg::slotDoubleClick); + connect(resultList, &KrTreeWidget::itemActivated, this, &LocateDlg::slotDoubleClick); grid->addWidget(resultList, 3, 0); @@ -220,16 +217,16 @@ feedStopButton = new QPushButton; buttonBox->addButton(feedStopButton, QDialogButtonBox::ActionRole); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(locateButton, SIGNAL(clicked()), this, SLOT(slotLocate())); - connect(updateDbButton, SIGNAL(clicked()), this, SLOT(slotUpdateDb())); - connect(feedStopButton, SIGNAL(clicked()), this, SLOT(slotFeedStop())); + connect(buttonBox, &QDialogButtonBox::rejected, this, &LocateDlg::reject); + connect(locateButton, &QPushButton::clicked, this, &LocateDlg::slotLocate); + connect(updateDbButton, &QPushButton::clicked, this, &LocateDlg::slotUpdateDb); + connect(feedStopButton, &QPushButton::clicked, this, &LocateDlg::slotFeedStop); updateButtons(false); if (updateProcess) { if (updateProcess->state() == QProcess::Running) { - connect(updateProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(updateFinished())); + connect(updateProcess, QOverload::of(&KProcess::finished), this, &LocateDlg::updateFinished); updateDbButton->setEnabled(false); } else updateFinished(); @@ -257,7 +254,7 @@ *updateProcess << KrServices::fullPathName("updatedb"); *updateProcess << KShell::splitArgs(group.readEntry("UpdateDB Arguments")); - connect(updateProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(updateFinished())); + connect(updateProcess, QOverload::of(&KProcess::finished), this, &LocateDlg::updateFinished); updateProcess->start(); updateDbButton->setEnabled(false); } @@ -299,10 +296,10 @@ locateProc = new KProcess(this); locateProc->setOutputChannelMode(KProcess::SeparateChannels); // default is forwarding to the parent channels - connect(locateProc, SIGNAL(readyReadStandardOutput()), SLOT(processStdout())); - connect(locateProc, SIGNAL(readyReadStandardError()), SLOT(processStderr())); - connect(locateProc, SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(locateFinished())); - connect(locateProc, SIGNAL(error(QProcess::ProcessError)), SLOT(locateError())); + connect(locateProc, &KProcess::readyReadStandardOutput, this, &LocateDlg::processStdout); + connect(locateProc, &KProcess::readyReadStandardError, this, &LocateDlg::processStderr); + connect(locateProc, QOverload::of(&KProcess::finished), this, &LocateDlg::locateFinished); + connect(locateProc, QOverload::of(&KProcess::error), this, &LocateDlg::locateError); *locateProc << KrServices::fullPathName("locate"); if (!isCs) diff --git a/krusader/MountMan/kmountmangui.cpp b/krusader/MountMan/kmountmangui.cpp --- a/krusader/MountMan/kmountmangui.cpp +++ b/krusader/MountMan/kmountmangui.cpp @@ -74,7 +74,7 @@ setLayout(mainLayout); watcher = new QTimer(this); - connect(watcher, SIGNAL(timeout()), this, SLOT(checkMountChange())); + connect(watcher, &QTimer::timeout, this, &KMountManGUI::checkMountChange); mainLayout->addLayout(createMainPage()); @@ -91,17 +91,13 @@ buttonBox->addButton(mountButton, QDialogButtonBox::ActionRole); // connections - connect(buttonBox, SIGNAL(rejected()), SLOT(reject())); - connect(ejectButton, SIGNAL(clicked()), SLOT(slotEject())); - connect(mountButton, SIGNAL(clicked()), SLOT(slotToggleMount())); - connect(mountList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, - SLOT(doubleClicked(QTreeWidgetItem*))); - connect(mountList, SIGNAL(itemRightClicked(QTreeWidgetItem*,QPoint,int)), - this, SLOT(clicked(QTreeWidgetItem*,QPoint))); - connect(mountList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, - SLOT(changeActive(QTreeWidgetItem*))); - connect(mountList, SIGNAL(itemSelectionChanged()), this, - SLOT(changeActive())); + connect(buttonBox, &QDialogButtonBox::rejected, this, &KMountManGUI::reject); + connect(ejectButton, &QPushButton::clicked, this, &KMountManGUI::slotEject); + connect(mountButton, &QPushButton::clicked, this, &KMountManGUI::slotToggleMount); + connect(mountList, &KrTreeWidget::itemDoubleClicked, this, &KMountManGUI::doubleClicked); + connect(mountList, &KrTreeWidget::itemRightClicked, this, &KMountManGUI::clicked); + connect(mountList, &KrTreeWidget::itemClicked, this, QOverload::of(&KMountManGUI::changeActive)); + connect(mountList, &KrTreeWidget::itemSelectionChanged, this, QOverload<>::of(&KMountManGUI::changeActive)); KConfigGroup group(krConfig, "MountMan"); int sx = group.readEntry("Window Width", -1); @@ -202,7 +198,7 @@ cbShowOnlyRemovable = new QCheckBox(i18n("Show only removable devices"), this); cbShowOnlyRemovable->setChecked(grp.readEntry("ShowOnlyRemovable", false)); - connect(cbShowOnlyRemovable , SIGNAL(stateChanged(int)), SLOT(updateList())); + connect(cbShowOnlyRemovable , &QCheckBox::stateChanged, this, &KMountManGUI::updateList); layout->addWidget(box, 0, 0); layout->addWidget(cbShowOnlyRemovable, 1, 0); diff --git a/krusader/Panel/PanelView/krinterbriefview.cpp b/krusader/Panel/PanelView/krinterbriefview.cpp --- a/krusader/Panel/PanelView/krinterbriefview.cpp +++ b/krusader/Panel/PanelView/krinterbriefview.cpp @@ -74,11 +74,11 @@ setAcceptDrops(true); setDropIndicatorShown(true); - connect(_mouseHandler, SIGNAL(renameCurrentItem()), SLOT(renameCurrentItem())); + connect(_mouseHandler, &KrMouseHandler::renameCurrentItem, this, &KrInterBriefView::renameCurrentItem); _model->setExtensionEnabled(false); _model->setAlternatingTable(true); - connect(_model, SIGNAL(layoutChanged()), SLOT(updateGeometries())); + connect(_model, &ListModel::layoutChanged, this, &KrInterBriefView::updateGeometries); } KrInterBriefView::~KrInterBriefView() @@ -141,8 +141,7 @@ _header->setSectionResizeMode(QHeaderView::Fixed); _header->setSectionsClickable(true); _header->setSortIndicatorShown(true); - connect(_header, SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), - _model, SLOT(sort(int,Qt::SortOrder))); + connect(_header, &QHeaderView::sortIndicatorChanged, _model, QOverload::of(&ListModel::sort)); _header->installEventFilter(this); _numOfColumns = _properties->numberOfColumns; diff --git a/krusader/Panel/PanelView/krinterdetailedview.cpp b/krusader/Panel/PanelView/krinterdetailedview.cpp --- a/krusader/Panel/PanelView/krinterdetailedview.cpp +++ b/krusader/Panel/PanelView/krinterdetailedview.cpp @@ -52,7 +52,7 @@ KrInterView(instance, cfg, this), _autoResizeColumns(true) { - connect(_mouseHandler, SIGNAL(renameCurrentItem()), this, SLOT(renameCurrentItem())); + connect(_mouseHandler, &KrMouseHandler::renameCurrentItem, this, &KrInterDetailedView::renameCurrentItem); setWidget(this); KConfigGroup grpSvr(_config, "Look&Feel"); @@ -82,8 +82,8 @@ setItemDelegate(new KrViewItemDelegate(this)); - connect(header(), SIGNAL(sectionResized(int,int,int)), this, SLOT(sectionResized(int,int,int))); - connect(header(), SIGNAL(sectionMoved(int,int,int)), this, SLOT(sectionMoved(int,int,int))); + connect(header(), &QHeaderView::sectionResized, this, &KrInterDetailedView::sectionResized); + connect(header(), &QHeaderView::sectionMoved, this, &KrInterDetailedView::sectionMoved); } KrInterDetailedView::~KrInterDetailedView() diff --git a/krusader/Panel/krlayoutfactory.cpp b/krusader/Panel/krlayoutfactory.cpp --- a/krusader/Panel/krlayoutfactory.cpp +++ b/krusader/Panel/krlayoutfactory.cpp @@ -21,6 +21,7 @@ #include "krlayoutfactory.h" #include "listpanelframe.h" +#include "listpanel.h" #include "../krglobal.h" // QtCore @@ -290,18 +291,18 @@ if(shape < 0) shape = shapeEnum.keyToValue(e.attribute("shape").toLatin1().data()); - QFrame *frame = new ListPanelFrame(parent, color); + ListPanelFrame *frame = new ListPanelFrame(parent, color); frame->setFrameStyle(shape | shadow); frame->setAcceptDrops(true); if(QLayout *l = createLayout(e, frame)) { l->setContentsMargins(frame->frameWidth(), frame->frameWidth(), frame->frameWidth(), frame->frameWidth()); frame->setLayout(l); } - QObject::connect(frame, SIGNAL(dropped(QDropEvent*,QWidget*)), panel, SLOT(handleDrop(QDropEvent*))); + QObject::connect(frame, &ListPanelFrame::dropped, panel, [=](QDropEvent *event) { dynamic_cast(panel)->handleDrop(event); }); if(!color.isEmpty()) - QObject::connect(panel, SIGNAL(refreshColors(bool)), frame, SLOT(refreshColors(bool))); + QObject::connect(dynamic_cast(panel), QOverload::of(&ListPanel::refreshColors), dynamic_cast(frame), &ListPanelFrame::refreshColors); return frame; } diff --git a/krusader/Panel/krpreviewjob.cpp b/krusader/Panel/krpreviewjob.cpp --- a/krusader/Panel/krpreviewjob.cpp +++ b/krusader/Panel/krpreviewjob.cpp @@ -42,7 +42,7 @@ { _timer.setSingleShot(true); _timer.setInterval(0); - connect(&_timer, SIGNAL(timeout()), SLOT(slotStartJob())); + connect(&_timer, &QTimer::timeout, this, &KrPreviewJob::slotStartJob); } KrPreviewJob::~KrPreviewJob() @@ -113,9 +113,9 @@ _job->setOverlayIconAlpha(0); _job->setOverlayIconSize(0); _job->setScaleType(KIO::PreviewJob::ScaledAndCached); - connect(_job, SIGNAL(gotPreview(KFileItem,QPixmap)), SLOT(slotGotPreview(KFileItem,QPixmap))); - connect(_job, SIGNAL(failed(KFileItem)), SLOT(slotFailed(KFileItem))); - connect(_job, SIGNAL(result(KJob*)), SLOT(slotJobResult(KJob*))); + connect(_job, &KIO::PreviewJob::gotPreview, this, &KrPreviewJob::slotGotPreview); + connect(_job, &KIO::PreviewJob::failed, this, &KrPreviewJob::slotFailed); + connect(_job, &KIO::PreviewJob::result, this, &KrPreviewJob::slotJobResult); } void KrPreviewJob::slotJobResult(KJob *job) diff --git a/krusader/Panel/krpreviewpopup.cpp b/krusader/Panel/krpreviewpopup.cpp --- a/krusader/Panel/krpreviewpopup.cpp +++ b/krusader/Panel/krpreviewpopup.cpp @@ -105,7 +105,7 @@ setStyle(new ProxyStyle()); - connect(this, SIGNAL(triggered(QAction*)), this, SLOT(view(QAction*))); + connect(this, &KrPreviewPopup::triggered, this, &KrPreviewPopup::view); } void KrPreviewPopup::showEvent(QShowEvent *event) @@ -118,8 +118,7 @@ pjob->setOverlayIconSize(0); pjob->setOverlayIconAlpha(1); pjob->setScaleType(KIO::PreviewJob::ScaledAndCached); - connect(pjob, SIGNAL(gotPreview(KFileItem,QPixmap)), - this, SLOT(addPreview(KFileItem,QPixmap))); + connect(pjob, &KIO::PreviewJob::gotPreview, this, &KrPreviewPopup::addPreview); jobStarted = true; } } diff --git a/krusader/Panel/listpanel.h b/krusader/Panel/listpanel.h --- a/krusader/Panel/listpanel.h +++ b/krusader/Panel/listpanel.h @@ -130,6 +130,8 @@ QUrl pinnedUrl() const { return _pinnedUrl; }; public slots: + void handleDrop(QDropEvent *event, bool onView = false); // handle drops on frame or view + void handleDrop(const QUrl &destination, QDropEvent *event); // handle drops with destination void popRightClickMenu(const QPoint&); void popEmptyRightClickMenu(const QPoint &); void compareDirs(bool otherPanelToo = true); @@ -179,8 +181,6 @@ protected slots: void slotCurrentChanged(KrViewItem *item); - void handleDrop(QDropEvent *event, bool onView = false); // handle drops on frame or view - void handleDrop(const QUrl &destination, QDropEvent *event); // handle drops with destination void startDragging(QStringList, QPixmap); void slotPreviewJobStarted(KJob *job); void slotPreviewJobPercent(KJob *job, unsigned long percent); diff --git a/krusader/Panel/listpanel.cpp b/krusader/Panel/listpanel.cpp --- a/krusader/Panel/listpanel.cpp +++ b/krusader/Panel/listpanel.cpp @@ -140,9 +140,9 @@ // media button mediaButton = new MediaButton(this); - connect(mediaButton, SIGNAL(aboutToShow()), this, SLOT(slotFocusOnMe())); - connect(mediaButton, SIGNAL(openUrl(QUrl)), func, SLOT(openUrl(QUrl))); - connect(mediaButton, SIGNAL(newTab(QUrl)), SLOT(newTab(QUrl))); + connect(mediaButton, &MediaButton::aboutToShow, this, [=]() { slotFocusOnMe(); }); + connect(mediaButton, &MediaButton::openUrl, [=](const QUrl & _t1) { func->openUrl(_t1); }); + connect(mediaButton, &MediaButton::newTab, this, [=](const QUrl &url) { newTab(url); }); ADD_WIDGET(mediaButton); // status bar @@ -167,14 +167,14 @@ // ... create the history button historyButton = new DirHistoryButton(func->history, this); - connect(historyButton, SIGNAL(aboutToShow()), this, SLOT(slotFocusOnMe())); - connect(historyButton, SIGNAL(gotoPos(int)), func, SLOT(historyGotoPos(int))); + connect(historyButton, &DirHistoryButton::aboutToShow, this, [=]() { slotFocusOnMe(); }); + connect(historyButton, &DirHistoryButton::gotoPos, func, &ListPanelFunc::historyGotoPos); ADD_WIDGET(historyButton); // bookmarks button bookmarksButton = new KrBookmarkButton(this); - connect(bookmarksButton, SIGNAL(aboutToShow()), this, SLOT(slotFocusOnMe())); - connect(bookmarksButton, SIGNAL(openUrl(QUrl)), func, SLOT(openUrl(QUrl))); + connect(bookmarksButton, &KrBookmarkButton::aboutToShow, this, [=]() { slotFocusOnMe(); }); + connect(bookmarksButton, &KrBookmarkButton::openUrl, [=](const QUrl & _t1) { func->openUrl(_t1); }); bookmarksButton->setWhatsThis(i18n("Open menu with bookmarks. You can also add " "current location to the list, edit bookmarks " "or add subfolder to the list.")); @@ -189,11 +189,11 @@ urlNavigator->editor()->installEventFilter(this); urlNavigator->setUrlEditable(isNavigatorEditModeSet()); urlNavigator->setShowFullPath(group.readEntry("Navigator Full Path", false)); - connect(urlNavigator, SIGNAL(returnPressed()), this, SLOT(slotFocusOnMe())); + connect(urlNavigator, &KUrlNavigator::returnPressed, this, [=]() { slotFocusOnMe(); }); connect(urlNavigator, &KUrlNavigator::urlChanged, this, &ListPanel::slotNavigatorUrlChanged); connect(urlNavigator->editor()->lineEdit(), &QLineEdit::editingFinished, this, &ListPanel::resetNavigatorMode); - connect(urlNavigator, SIGNAL(tabRequested(QUrl)), this, SLOT(newTab(QUrl))); - connect(urlNavigator, SIGNAL(urlsDropped(QUrl,QDropEvent*)), this, SLOT(handleDrop(QUrl,QDropEvent*))); + connect(urlNavigator, &KUrlNavigator::tabRequested, this, [=](const QUrl &url) { ListPanel::newTab(url); }); + connect(urlNavigator, &KUrlNavigator::urlsDropped, this, QOverload::of(&ListPanel::handleDrop)); ADD_WIDGET(urlNavigator); // toolbar @@ -250,7 +250,7 @@ cancelProgressButton = new QToolButton(this); cancelProgressButton->hide(); cancelProgressButton->setIcon(Icon("dialog-cancel")); - connect(cancelProgressButton, SIGNAL(clicked()), this, SLOT(cancelProgress())); + connect(cancelProgressButton, &QToolButton::clicked, this, &ListPanel::cancelProgress); ADD_WIDGET(cancelProgressButton); // button for changing the panel sidebar position in the panel @@ -373,8 +373,8 @@ setLayout(layout); - connect(&KrColorCache::getColorCache(), SIGNAL(colorsRefreshed()), this, SLOT(refreshColors())); - connect(krApp, SIGNAL(shutdown()), SLOT(cancelProgress())); + connect(&KrColorCache::getColorCache(), &KrColorCache::colorsRefreshed, this, QOverload<>::of(&ListPanel::refreshColors)); + connect(krApp, &Krusader::shutdown, this, &ListPanel::cancelProgress); } ListPanel::~ListPanel() @@ -433,27 +433,24 @@ view->widget()->installEventFilter(this); connect(view->op(), &KrViewOperator::quickCalcSpace, func, &ListPanelFunc::quickCalcSpace); - connect(view->op(), SIGNAL(goHome()), func, SLOT(home())); - connect(view->op(), SIGNAL(dirUp()), func, SLOT(dirUp())); + connect(view->op(), &KrViewOperator::goHome, func, &ListPanelFunc::home); + connect(view->op(), &KrViewOperator::dirUp, func, &ListPanelFunc::dirUp); connect(view->op(), &KrViewOperator::defaultDeleteFiles, func, &ListPanelFunc::defaultDeleteFiles); - connect(view->op(), SIGNAL(middleButtonClicked(KrViewItem*)), SLOT(newTab(KrViewItem*))); - connect(view->op(), SIGNAL(currentChanged(KrViewItem*)), SLOT(slotCurrentChanged(KrViewItem*))); - connect(view->op(), SIGNAL(renameItem(QString,QString)), - func, SLOT(rename(QString,QString))); - connect(view->op(), SIGNAL(executed(QString)), func, SLOT(execute(QString))); - connect(view->op(), SIGNAL(goInside(QString)), func, SLOT(goInside(QString))); - connect(view->op(), SIGNAL(needFocus()), this, SLOT(slotFocusOnMe())); - connect(view->op(), SIGNAL(selectionChanged()), this, SLOT(slotUpdateTotals())); - connect(view->op(), SIGNAL(itemDescription(QString)), krApp, SLOT(statusBarUpdate(QString))); - connect(view->op(), SIGNAL(contextMenu(QPoint)), this, SLOT(popRightClickMenu(QPoint))); - connect(view->op(), SIGNAL(emptyContextMenu(QPoint)), - this, SLOT(popEmptyRightClickMenu(QPoint))); - connect(view->op(), SIGNAL(letsDrag(QStringList,QPixmap)), this, SLOT(startDragging(QStringList,QPixmap))); - connect(view->op(), &KrViewOperator::gotDrop, - this, [this](QDropEvent *event) {handleDrop(event, true); }); - connect(view->op(), SIGNAL(previewJobStarted(KJob*)), this, SLOT(slotPreviewJobStarted(KJob*))); - connect(view->op(), SIGNAL(refreshActions()), krApp->viewActions(), SLOT(refreshActions())); - connect(view->op(), SIGNAL(currentChanged(KrViewItem*)), func->history, SLOT(saveCurrentItem())); + connect(view->op(), &KrViewOperator::middleButtonClicked, this, QOverload::of(&ListPanel::newTab)); + connect(view->op(), &KrViewOperator::currentChanged, this, &ListPanel::slotCurrentChanged); + connect(view->op(), &KrViewOperator::renameItem, func, QOverload::of(&ListPanelFunc::rename)); + connect(view->op(), &KrViewOperator::executed, func, &ListPanelFunc::execute); + connect(view->op(), &KrViewOperator::goInside, func, &ListPanelFunc::goInside); + connect(view->op(), &KrViewOperator::needFocus, this, [=]() { slotFocusOnMe(); }); + connect(view->op(), &KrViewOperator::selectionChanged, this, &ListPanel::slotUpdateTotals); + connect(view->op(), &KrViewOperator::itemDescription, krApp, &Krusader::statusBarUpdate); + connect(view->op(), &KrViewOperator::contextMenu, this, &ListPanel::popRightClickMenu); + connect(view->op(), &KrViewOperator::emptyContextMenu, this, &ListPanel::popEmptyRightClickMenu); + connect(view->op(), &KrViewOperator::letsDrag, this, &ListPanel::startDragging); + connect(view->op(), &KrViewOperator::gotDrop, this, [this](QDropEvent *event) {handleDrop(event, true); }); + connect(view->op(), &KrViewOperator::previewJobStarted, this, &ListPanel::slotPreviewJobStarted); + connect(view->op(), &KrViewOperator::refreshActions, krApp->viewActions(), &ViewActions::refreshActions); + connect(view->op(), &KrViewOperator::currentChanged, func->history, &DirHistoryQueue::saveCurrentItem); connect(view->op(), &KrViewOperator::goBack, func, &ListPanelFunc::historyBackward); connect(view->op(), &KrViewOperator::goForward, func, &ListPanelFunc::historyForward); @@ -1054,12 +1051,10 @@ syncBrowseButton->setEnabled(false); // connect to the job interface to provide in-panel refresh notification - connect(job, SIGNAL(infoMessage(KJob*,QString)), - SLOT(inlineRefreshInfoMessage(KJob*,QString))); + connect(job, &KIO::Job::infoMessage, this, &ListPanel::inlineRefreshInfoMessage); connect(job, SIGNAL(percent(KJob*,ulong)), SLOT(inlineRefreshPercent(KJob*,ulong))); - connect(job, SIGNAL(result(KJob*)), - this, SLOT(inlineRefreshListResult(KJob*))); + connect(job, &KIO::Job::result, this, &ListPanel::inlineRefreshListResult); inlineRefreshJob = job; diff --git a/krusader/Panel/listpanelframe.h b/krusader/Panel/listpanelframe.h --- a/krusader/Panel/listpanelframe.h +++ b/krusader/Panel/listpanelframe.h @@ -41,6 +41,8 @@ protected slots: void colorsChanged(); + +public slots: void refreshColors(bool active); protected: diff --git a/krusader/Search/krsearchdialog.cpp b/krusader/Search/krsearchdialog.cpp --- a/krusader/Search/krsearchdialog.cpp +++ b/krusader/Search/krsearchdialog.cpp @@ -254,17 +254,17 @@ // signals and slots connections - connect(mainSearchBtn, SIGNAL(clicked()), this, SLOT(startSearch())); - connect(mainStopBtn, SIGNAL(clicked()), this, SLOT(stopSearch())); - connect(mainCloseBtn, SIGNAL(clicked()), this, SLOT(closeDialog())); - connect(mainFeedToListBoxBtn, SIGNAL(clicked()), this, SLOT(feedToListBox())); + connect(mainSearchBtn, &QPushButton::clicked, this, &KrSearchDialog::startSearch); + connect(mainStopBtn, &QPushButton::clicked, this, &KrSearchDialog::stopSearch); + connect(mainCloseBtn, &QPushButton::clicked, this, &KrSearchDialog::closeDialog); + connect(mainFeedToListBoxBtn, &QPushButton::clicked, this, &KrSearchDialog::feedToListBox); - connect(profileManager, SIGNAL(loadFromProfile(QString)), filterTabs, SLOT(loadFromProfile(QString))); - connect(profileManager, SIGNAL(saveToProfile(QString)), filterTabs, SLOT(saveToProfile(QString))); + connect(profileManager, &ProfileManager::loadFromProfile, filterTabs, &FilterTabs::loadFromProfile); + connect(profileManager, &ProfileManager::saveToProfile, filterTabs, &FilterTabs::saveToProfile); - connect(resultView->op(), SIGNAL(currentChanged(KrViewItem*)), SLOT(currentChanged(KrViewItem*))); - connect(resultView->op(), SIGNAL(executed(QString)), SLOT(executed(QString))); - connect(resultView->op(), SIGNAL(contextMenu(QPoint)), SLOT(contextMenu(QPoint))); + connect(resultView->op(), &KrViewOperator::currentChanged, this, &KrSearchDialog::currentChanged); + connect(resultView->op(), &KrViewOperator::executed, this, &KrSearchDialog::executed); + connect(resultView->op(), &KrViewOperator::contextMenu, this, &KrSearchDialog::contextMenu); // tab order diff --git a/krusader/Splitter/combiner.cpp b/krusader/Splitter/combiner.cpp --- a/krusader/Splitter/combiner.cpp +++ b/krusader/Splitter/combiner.cpp @@ -85,10 +85,8 @@ combineReadJob = KIO::get(splURL, KIO::NoReload, KIO::HideProgressInfo); - connect(combineReadJob, SIGNAL(data(KIO::Job*,QByteArray)), - this, SLOT(combineSplitFileDataReceived(KIO::Job*,QByteArray))); - connect(combineReadJob, SIGNAL(result(KJob*)), - this, SLOT(combineSplitFileFinished(KJob*))); + connect(combineReadJob, &KIO::TransferJob::data, this, &Combiner::combineSplitFileDataReceived); + connect(combineReadJob, &KIO::TransferJob::result, this, &Combiner::combineSplitFileFinished); } exec(); @@ -164,7 +162,7 @@ } statJob = KIO::stat(writeURL, KIO::StatJob::DestinationSide, 0, KIO::HideProgressInfo); - connect(statJob, SIGNAL(result(KJob*)), SLOT(statDestResult(KJob*))); + connect(statJob, &KIO::StatJob::result, this, &Combiner::statDestResult); } void Combiner::statDestResult(KJob* job) @@ -229,10 +227,8 @@ /* creating a read job */ combineReadJob = KIO::get(readURL, KIO::NoReload, KIO::HideProgressInfo); - connect(combineReadJob, SIGNAL(data(KIO::Job*,QByteArray)), - this, SLOT(combineDataReceived(KIO::Job*,QByteArray))); - connect(combineReadJob, SIGNAL(result(KJob*)), - this, SLOT(combineReceiveFinished(KJob*))); + connect(combineReadJob, &KIO::TransferJob::data, this, &Combiner::combineDataReceived); + connect(combineReadJob, &KIO::TransferJob::result, this, &Combiner::combineReceiveFinished); if (hasValidSplitFile) connect(combineReadJob, SIGNAL(percent(KJob*,ulong)), this, SLOT(combineWritePercent(KJob*,ulong))); @@ -252,10 +248,8 @@ if (combineWriteJob == 0) { combineWriteJob = KIO::put(writeURL, permissions, KIO::HideProgressInfo | KIO::Overwrite); - connect(combineWriteJob, SIGNAL(dataReq(KIO::Job*,QByteArray&)), - this, SLOT(combineDataSend(KIO::Job*,QByteArray&))); - connect(combineWriteJob, SIGNAL(result(KJob*)), - this, SLOT(combineSendFinished(KJob*))); + connect(combineWriteJob, &KIO::TransferJob::dataReq, this, &Combiner::combineDataSend); + connect(combineWriteJob, &KIO::TransferJob::result, this, &Combiner::combineSendFinished); } // continue writing and suspend read job until received data is handed over to the write job diff --git a/krusader/Splitter/splitter.cpp b/krusader/Splitter/splitter.cpp --- a/krusader/Splitter/splitter.cpp +++ b/krusader/Splitter/splitter.cpp @@ -89,10 +89,8 @@ splitReadJob = KIO::get(fileName, KIO::NoReload, KIO::HideProgressInfo); - connect(splitReadJob, SIGNAL(data(KIO::Job*,QByteArray)), - this, SLOT(splitDataReceived(KIO::Job*,QByteArray))); - connect(splitReadJob, SIGNAL(result(KJob*)), - this, SLOT(splitReceiveFinished(KJob*))); + connect(splitReadJob, &KIO::TransferJob::data, this, &Splitter::splitDataReceived); + connect(splitReadJob, &KIO::TransferJob::result, this, &Splitter::splitReceiveFinished); connect(splitReadJob, SIGNAL(percent(KJob*,ulong)), this, SLOT(splitReceivePercent(KJob*,ulong))); @@ -169,7 +167,7 @@ openOutputFile(); else { statJob = KIO::stat(writeURL, KIO::StatJob::DestinationSide, 0, KIO::HideProgressInfo); - connect(statJob, SIGNAL(result(KJob*)), SLOT(statOutputFileResult(KJob*))); + connect(statJob, &KIO::Job::result, this, &Splitter::statOutputFileResult); } } @@ -205,10 +203,8 @@ { // create write job splitWriteJob = KIO::put(writeURL, permissions, KIO::HideProgressInfo | KIO::Overwrite); - connect(splitWriteJob, SIGNAL(dataReq(KIO::Job*,QByteArray&)), - this, SLOT(splitDataSend(KIO::Job*,QByteArray&))); - connect(splitWriteJob, SIGNAL(result(KJob*)), - this, SLOT(splitSendFinished(KJob*))); + connect(splitWriteJob, &KIO::TransferJob::dataReq, this, &Splitter::splitDataSend); + connect(splitWriteJob, &KIO::TransferJob::result, this, &Splitter::splitSendFinished); } @@ -259,10 +255,9 @@ writeURL = writeURL.adjusted(QUrl::StripTrailingSlash); writeURL.setPath(writeURL.path() + '/' + (fileName.fileName() + ".crc")); splitWriteJob = KIO::put(writeURL, permissions, KIO::HideProgressInfo | KIO::Overwrite); - connect(splitWriteJob, SIGNAL(dataReq(KIO::Job*,QByteArray&)), - this, SLOT(splitFileSend(KIO::Job*,QByteArray&))); - connect(splitWriteJob, SIGNAL(result(KJob*)), - this, SLOT(splitFileFinished(KJob*))); + connect(splitWriteJob, &KIO::TransferJob::dataReq, this, &Splitter::splitFileSend); + connect(splitWriteJob, &KIO::TransferJob::result, + this, &Splitter::splitFileFinished); } } diff --git a/krusader/Splitter/splittergui.cpp b/krusader/Splitter/splittergui.cpp --- a/krusader/Splitter/splittergui.cpp +++ b/krusader/Splitter/splittergui.cpp @@ -149,10 +149,10 @@ KConfigGroup cfg(KSharedConfig::openConfig(), QStringLiteral("Splitter")); overwriteCb->setChecked(cfg.readEntry("OverWriteFiles", false)); - connect(sizeCombo, SIGNAL(activated(int)), this, SLOT(sizeComboActivated(int))); - connect(deviceCombo, SIGNAL(activated(int)), this, SLOT(predefinedComboActivated(int))); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(buttonBox , SIGNAL(accepted()), this, SLOT(splitPressed())); + connect(sizeCombo, QOverload::of(&QComboBox::activated), this, &SplitterGUI::sizeComboActivated); + connect(deviceCombo, QOverload::of(&QComboBox::activated), this, &SplitterGUI::predefinedComboActivated); + connect(buttonBox, &QDialogButtonBox::rejected, this, &SplitterGUI::reject); + connect(buttonBox , &QDialogButtonBox::accepted, this, &SplitterGUI::splitPressed); predefinedComboActivated(0); } diff --git a/krusader/Synchronizer/synchronizedialog.cpp b/krusader/Synchronizer/synchronizedialog.cpp --- a/krusader/Synchronizer/synchronizedialog.cpp +++ b/krusader/Synchronizer/synchronizedialog.cpp @@ -126,9 +126,9 @@ layout->addWidget(hboxWidget); - connect(btnStart, SIGNAL(clicked()), this, SLOT(startSynchronization())); - connect(btnPause, SIGNAL(clicked()), this, SLOT(pauseOrResume())); - connect(btnClose, SIGNAL(clicked()), this, SLOT(reject())); + connect(btnStart, &QPushButton::clicked, this, [=]() { startSynchronization(); }); + connect(btnPause, &QPushButton::clicked, this, [=]() { pauseOrResume(); }); + connect(btnClose, &QPushButton::clicked, this, [=]() { reject(); }); exec(); } diff --git a/krusader/Synchronizer/synchronizer.cpp b/krusader/Synchronizer/synchronizer.cpp --- a/krusader/Synchronizer/synchronizer.cpp +++ b/krusader/Synchronizer/synchronizer.cpp @@ -932,7 +932,7 @@ case TT_COPY_TO_LEFT: if (task->isDir()) { KIO::SimpleJob *job = KIO::mkdir(leftURL); - connect(job, SIGNAL(result(KJob*)), this, SLOT(slotTaskFinished(KJob*))); + connect(job, &KIO::MkdirJob::result, this, &Synchronizer::slotTaskFinished); jobMap[ job ] = task; disableNewTasks = true; } else { @@ -945,20 +945,20 @@ ((overWrite || task->overWrite()) ? KIO::Overwrite : KIO::DefaultFlags) | KIO::HideProgressInfo); connect(job, SIGNAL(processedSize(KJob*,qulonglong)), this, SLOT(slotProcessedSize(KJob*,qulonglong))); - connect(job, SIGNAL(result(KJob*)), this, SLOT(slotTaskFinished(KJob*))); + connect(job, &KIO::FileCopyJob::result, this, &Synchronizer::slotTaskFinished); jobMap[ job ] = task; } else { KIO::SimpleJob *job = KIO::symlink(task->rightLink(), destURL, ((overWrite || task->overWrite()) ? KIO::Overwrite : KIO::DefaultFlags) | KIO::HideProgressInfo); - connect(job, SIGNAL(result(KJob*)), this, SLOT(slotTaskFinished(KJob*))); + connect(job, &KIO::SimpleJob::result, this, &Synchronizer::slotTaskFinished); jobMap[ job ] = task; } } break; case TT_COPY_TO_RIGHT: if (task->isDir()) { KIO::SimpleJob *job = KIO::mkdir(rightURL); - connect(job, SIGNAL(result(KJob*)), this, SLOT(slotTaskFinished(KJob*))); + connect(job, &KIO::SimpleJob::result, this, &Synchronizer::slotTaskFinished); jobMap[ job ] = task; disableNewTasks = true; } else { @@ -971,19 +971,19 @@ ((overWrite || task->overWrite()) ? KIO::Overwrite : KIO::DefaultFlags) | KIO::HideProgressInfo); connect(job, SIGNAL(processedSize(KJob*,qulonglong)), this, SLOT(slotProcessedSize(KJob*,qulonglong))); - connect(job, SIGNAL(result(KJob*)), this, SLOT(slotTaskFinished(KJob*))); + connect(job, &KIO::FileCopyJob::result, this, &Synchronizer::slotTaskFinished); jobMap[ job ] = task; } else { KIO::SimpleJob *job = KIO::symlink(task->leftLink(), destURL, ((overWrite || task->overWrite()) ? KIO::Overwrite : KIO::DefaultFlags) | KIO::HideProgressInfo); - connect(job, SIGNAL(result(KJob*)), this, SLOT(slotTaskFinished(KJob*))); + connect(job, &KIO::SimpleJob::result, this, &Synchronizer::slotTaskFinished); jobMap[ job ] = task; } } break; case TT_DELETE: { KIO::DeleteJob *job = KIO::del(leftURL, KIO::DefaultFlags); - connect(job, SIGNAL(result(KJob*)), this, SLOT(slotTaskFinished(KJob*))); + connect(job, &KIO::DeleteJob::result, this, &Synchronizer::slotTaskFinished); jobMap[ job ] = task; } break; @@ -1295,8 +1295,8 @@ buttonBox->addButton(mPauseButton, QDialogButtonBox::ActionRole); buttonBox->button(QDialogButtonBox::Cancel)->setDefault(true); - connect(mPauseButton, SIGNAL(clicked()), SLOT(slotPause())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(slotCancel())); + connect(mPauseButton, &QPushButton::clicked, this, &KgetProgressDialog::slotPause); + connect(buttonBox, &QDialogButtonBox::rejected, this, &KgetProgressDialog::slotCancel); mCancelled = mPaused = false; } diff --git a/krusader/Synchronizer/synchronizerdirlist.cpp b/krusader/Synchronizer/synchronizerdirlist.cpp --- a/krusader/Synchronizer/synchronizerdirlist.cpp +++ b/krusader/Synchronizer/synchronizerdirlist.cpp @@ -143,11 +143,9 @@ emit finished(result = true); return true; } else { - KIO::Job *job = KIO::listDir(KrServices::escapeFileUrl(url), KIO::HideProgressInfo, true); - connect(job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), - this, SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList))); - connect(job, SIGNAL(result(KJob*)), - this, SLOT(slotListResult(KJob*))); + KIO::ListJob *job = KIO::listDir(KrServices::escapeFileUrl(url), KIO::HideProgressInfo, true); + connect(job, &KIO::ListJob::entries, this, &SynchronizerDirList::slotEntries); + connect(job, &KIO::ListJob::result, this, &SynchronizerDirList::slotListResult); busy = true; if (!wait) diff --git a/krusader/Synchronizer/synchronizergui.cpp b/krusader/Synchronizer/synchronizergui.cpp --- a/krusader/Synchronizer/synchronizergui.cpp +++ b/krusader/Synchronizer/synchronizergui.cpp @@ -524,47 +524,42 @@ /* =============================== Connect table ================================ */ - connect(syncList, SIGNAL(itemRightClicked(QTreeWidgetItem*,QPoint,int)), - this, SLOT(rightMouseClicked(QTreeWidgetItem*,QPoint))); - connect(syncList, SIGNAL(itemActivated(QTreeWidgetItem*,int)), - this, SLOT(doubleClicked(QTreeWidgetItem*))); - - connect(profileManager, SIGNAL(loadFromProfile(QString)), this, SLOT(loadFromProfile(QString))); - connect(profileManager, SIGNAL(saveToProfile(QString)), this, SLOT(saveToProfile(QString))); - - connect(btnSwapSides, SIGNAL(clicked()), this, SLOT(swapSides())); - connect(btnCompareDirs, SIGNAL(clicked()), this, SLOT(compare())); - connect(btnStopComparing, SIGNAL(clicked()), this, SLOT(stop())); - connect(btnFeedToListBox, SIGNAL(clicked()), this, SLOT(feedToListBox())); - connect(btnSynchronize, SIGNAL(clicked()), this, SLOT(synchronize())); - connect(btnScrollResults, SIGNAL(toggled(bool)), this, SLOT(setScrolling(bool))); - connect(btnCloseSync, SIGNAL(clicked()), this, SLOT(closeDialog())); - - connect(cbSubdirs, SIGNAL(toggled(bool)), this, SLOT(subdirsChecked(bool))); - connect(cbAsymmetric, SIGNAL(toggled(bool)), this, SLOT(setPanelLabels())); - - connect(&synchronizer, SIGNAL(comparedFileData(SynchronizerFileItem*)), this, - SLOT(addFile(SynchronizerFileItem*))); - connect(&synchronizer, SIGNAL(markChanged(SynchronizerFileItem*,bool)), this, - SLOT(markChanged(SynchronizerFileItem*,bool))); - connect(&synchronizer, SIGNAL(statusInfo(QString)), this, SLOT(statusInfo(QString))); - - connect(btnLeftToRight, SIGNAL(toggled(bool)), this, SLOT(refresh())); - connect(btnEquals, SIGNAL(toggled(bool)), this, SLOT(refresh())); - connect(btnDifferents, SIGNAL(toggled(bool)), this, SLOT(refresh())); - connect(btnRightToLeft, SIGNAL(toggled(bool)), this, SLOT(refresh())); - connect(btnDeletable, SIGNAL(toggled(bool)), this, SLOT(refresh())); - connect(btnDuplicates, SIGNAL(toggled(bool)), this, SLOT(refresh())); - connect(btnSingles, SIGNAL(toggled(bool)), this, SLOT(refresh())); - - connect(fileFilter, SIGNAL(currentTextChanged(QString)), this, SLOT(connectFilters(QString))); - connect(generalFilter->searchFor, SIGNAL(currentTextChanged(QString)), this, SLOT(connectFilters(QString))); - connect(generalFilter->searchFor, SIGNAL(currentTextChanged(QString)), this, SLOT(setCompletion())); - connect(generalFilter->dontSearchIn, &KURLListRequester::checkValidity, - this, &SynchronizerGUI::checkExcludeURLValidity); - - connect(profileManager, SIGNAL(loadFromProfile(QString)), filterTabs, SLOT(loadFromProfile(QString))); - connect(profileManager, SIGNAL(saveToProfile(QString)), filterTabs, SLOT(saveToProfile(QString))); + connect(syncList, &KrTreeWidget::itemRightClicked, this, &SynchronizerGUI::rightMouseClicked); + connect(syncList, &KrTreeWidget::itemActivated, this, &SynchronizerGUI::doubleClicked); + + connect(profileManager, &ProfileManager::loadFromProfile, this, &SynchronizerGUI::loadFromProfile); + connect(profileManager, &ProfileManager::saveToProfile, this, &SynchronizerGUI::saveToProfile); + + connect(btnSwapSides, &QPushButton::clicked, this, &SynchronizerGUI::swapSides); + connect(btnCompareDirs, &QPushButton::clicked, this, &SynchronizerGUI::compare); + connect(btnStopComparing, &QPushButton::clicked, this, &SynchronizerGUI::stop); + connect(btnFeedToListBox, &QPushButton::clicked, this, &SynchronizerGUI::feedToListBox); + connect(btnSynchronize, &QPushButton::clicked, this, &SynchronizerGUI::synchronize); + connect(btnScrollResults, &QPushButton::toggled, this, &SynchronizerGUI::setScrolling); + connect(btnCloseSync, &QPushButton::clicked, this, &SynchronizerGUI::closeDialog); + + connect(cbSubdirs, &QCheckBox::toggled, this, &SynchronizerGUI::subdirsChecked); + connect(cbAsymmetric, &QCheckBox::toggled, this, &SynchronizerGUI::setPanelLabels); + + connect(&synchronizer, &Synchronizer::comparedFileData, this, &SynchronizerGUI::addFile); + connect(&synchronizer, &Synchronizer::markChanged, this, &SynchronizerGUI::markChanged); + connect(&synchronizer, &Synchronizer::statusInfo, this, &SynchronizerGUI::statusInfo); + + connect(btnLeftToRight, &QPushButton::toggled, this, &SynchronizerGUI::refresh); + connect(btnEquals, &QPushButton::toggled, this, &SynchronizerGUI::refresh); + connect(btnDifferents, &QPushButton::toggled, this, &SynchronizerGUI::refresh); + connect(btnRightToLeft, &QPushButton::toggled, this, &SynchronizerGUI::refresh); + connect(btnDeletable, &QPushButton::toggled, this, &SynchronizerGUI::refresh); + connect(btnDuplicates, &QPushButton::toggled, this, &SynchronizerGUI::refresh); + connect(btnSingles, &QPushButton::toggled, this, &SynchronizerGUI::refresh); + + connect(fileFilter, &KHistoryComboBox::currentTextChanged, this, &SynchronizerGUI::connectFilters); + connect(generalFilter->searchFor, &KHistoryComboBox::currentTextChanged, this, &SynchronizerGUI::connectFilters); + connect(generalFilter->searchFor, &KHistoryComboBox::currentTextChanged, this, &SynchronizerGUI::setCompletion); + connect(generalFilter->dontSearchIn, &KURLListRequester::checkValidity, this, &SynchronizerGUI::checkExcludeURLValidity); + + connect(profileManager, &ProfileManager::loadFromProfile, filterTabs, &FilterTabs::loadFromProfile); + connect(profileManager, &ProfileManager::saveToProfile, filterTabs, &FilterTabs::saveToProfile); setPanelLabels(); setCompletion(); diff --git a/krusader/Synchronizer/synchronizertask.cpp b/krusader/Synchronizer/synchronizertask.cpp --- a/krusader/Synchronizer/synchronizertask.cpp +++ b/krusader/Synchronizer/synchronizertask.cpp @@ -70,12 +70,12 @@ m_loadFinished = m_otherLoadFinished = false; m_dirList = new SynchronizerDirList(parentWidget, ignoreHidden); - connect(m_dirList, SIGNAL(finished(bool)), this, SLOT(slotFinished(bool))); + connect(m_dirList, &SynchronizerDirList::finished, this, &CompareTask::slotFinished); m_dirList->load(m_url, false); if (m_duplicate) { m_otherDirList = new SynchronizerDirList(parentWidget, ignoreHidden); - connect(m_otherDirList, SIGNAL(finished(bool)), this, SLOT(slotOtherFinished(bool))); + connect(m_otherDirList, &SynchronizerDirList::finished, this, &CompareTask::slotOtherFinished); m_otherDirList->load(m_otherUrl, false); } } @@ -147,28 +147,24 @@ } timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(sendStatusMessage())); + connect(timer, &QTimer::timeout, this, &CompareContentTask::sendStatusMessage); timer->setSingleShot(true); timer->start(1000); localFileCompareCycle(); } else { leftReadJob = KIO::get(leftURL, KIO::NoReload, KIO::HideProgressInfo); rightReadJob = KIO::get(rightURL, KIO::NoReload, KIO::HideProgressInfo); - connect(leftReadJob, SIGNAL(data(KIO::Job*,QByteArray)), - this, SLOT(slotDataReceived(KIO::Job*,QByteArray))); - connect(rightReadJob, SIGNAL(data(KIO::Job*,QByteArray)), - this, SLOT(slotDataReceived(KIO::Job*,QByteArray))); - connect(leftReadJob, SIGNAL(result(KJob*)), - this, SLOT(slotFinished(KJob*))); - connect(rightReadJob, SIGNAL(result(KJob*)), - this, SLOT(slotFinished(KJob*))); + connect(leftReadJob, &KIO::TransferJob::data, this, &CompareContentTask::slotDataReceived); + connect(rightReadJob, &KIO::TransferJob::data, this, &CompareContentTask::slotDataReceived); + connect(leftReadJob, &KIO::TransferJob::result, this, &CompareContentTask::slotFinished); + connect(rightReadJob, &KIO::TransferJob::result, this, &CompareContentTask::slotFinished); rightReadJob->suspend(); timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(sendStatusMessage())); + connect(timer, &QTimer::timeout, this, &CompareContentTask::sendStatusMessage); timer->setSingleShot(true); timer->start(1000); } @@ -222,7 +218,7 @@ return; } - QTimer::singleShot(0, this, SLOT(localFileCompareCycle())); + QTimer::singleShot(0, this, &CompareContentTask::localFileCompareCycle); } diff --git a/krusader/UserAction/kraction.cpp b/krusader/UserAction/kraction.cpp --- a/krusader/UserAction/kraction.cpp +++ b/krusader/UserAction/kraction.cpp @@ -100,9 +100,9 @@ } _currentTextEdit = _stdout; - connect(_stdout, SIGNAL(textChanged()), SLOT(currentTextEditChanged())); + connect(_stdout, &KTextEdit::textChanged, this, &KrActionProcDlg::currentTextEditChanged); if (_stderr) - connect(_stderr, SIGNAL(textChanged()), SLOT(currentTextEditChanged())); + connect(_stderr, &KTextEdit::textChanged, this, &KrActionProcDlg::currentTextEditChanged); KConfigGroup group(krConfig, "UserActions"); normalFont = group.readEntry("Normal Font", _UserActions_NormalFont); @@ -132,10 +132,10 @@ killButton->setDefault(true); buttonBox->addButton(killButton, QDialogButtonBox::ActionRole); - connect(killButton, SIGNAL(clicked()), this, SIGNAL(killClicked())); - connect(saveAsButton, SIGNAL(clicked()), this, SLOT(slotSaveAs())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(useFixedFont, SIGNAL(toggled(bool)), SLOT(toggleFixedFont(bool))); + connect(killButton, &QPushButton::clicked, this, &KrActionProcDlg::killClicked); + connect(saveAsButton, &QPushButton::clicked, this, &KrActionProcDlg::slotSaveAs); + connect(buttonBox, &QDialogButtonBox::rejected, this, &KrActionProcDlg::reject); + connect(useFixedFont, &QCheckBox::toggled, this, &KrActionProcDlg::toggleFixedFont); resize(sizeHint() * 2); } @@ -284,8 +284,7 @@ _proc = new KProcess(this); _proc->clearProgram(); // this clears the arglist too _proc->setWorkingDirectory(workingDir); - connect(_proc, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(processExited(int,QProcess::ExitStatus))); + connect(_proc, QOverload::of(&KProcess::finished), this, &KrActionProc::processExited); if (_action->execType() == KrAction::Normal || _action->execType() == KrAction::Terminal) { // not collect output if (_action->execType() == KrAction::Terminal) { // run in terminal @@ -319,9 +318,9 @@ _output = new KrActionProcDlg(_action->text(), separateStderr); // connect the output to the dialog _proc->setOutputChannelMode(KProcess::SeparateChannels); - connect(_proc, SIGNAL(readyReadStandardError()), SLOT(addStderr())); - connect(_proc, SIGNAL(readyReadStandardOutput()), SLOT(addStdout())); - connect(_output, SIGNAL(killClicked()), this, SLOT(kill())); + connect(_proc, &KProcess::readyReadStandardError, this, &KrActionProc::addStderr); + connect(_proc, &KProcess::readyReadStandardOutput, this, &KrActionProc::addStdout); + connect(_output, &KrActionProcDlg::killClicked, this, &KrActionProc::kill); _output->show(); if (!_action->user().isEmpty()) { @@ -369,7 +368,7 @@ setObjectName(name); parent->addAction(name, this); - connect(this, SIGNAL(triggered()), this, SLOT(exec())); + connect(this, &KrAction::triggered, this, &KrAction::exec); } KrAction::~KrAction() diff --git a/krusader/panelmanager.cpp b/krusader/panelmanager.cpp --- a/krusader/panelmanager.cpp +++ b/krusader/panelmanager.cpp @@ -70,7 +70,7 @@ 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, &PanelTabBar::newTab, this, [=] (const QUrl &url) { slotNewTab(url); }); connect(_tabbar, &PanelTabBar::draggingTab, this, &PanelManager::slotDraggingTab); connect(_tabbar, &PanelTabBar::draggingTabFinished, this, &PanelManager::slotDraggingTabFinished); @@ -225,7 +225,7 @@ { // delayed url refreshes may be pending - // delay the layout too so it happens after them - QTimer::singleShot(0, _tabbar, SLOT(layoutTabs())); + QTimer::singleShot(0, _tabbar, &PanelTabBar::layoutTabs); } KrPanel *PanelManager::currentPanel() const {