Commit f92b1f3f authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Port some Qt4 style connects

parent 54762a17
......@@ -24,7 +24,7 @@ DlgWebinterface::DlgWebinterface(QDialog *parent)
readConfig();
connect(parent, SIGNAL(accepted()), SLOT(saveSettings()));
connect(parent, &QDialog::accepted, this, &DlgWebinterface::saveSettings);
connect(webinterfacePwd, &KLineEdit::textChanged, this, &DlgWebinterface::changed);
}
......
......@@ -30,8 +30,8 @@ PluginSelector::PluginSelector(QDialog * parent)
load();
connect(parent, SIGNAL(accepted()), SLOT(saveState()));
connect(parent, SIGNAL(rejected()), SLOT(loadDefaults()));
connect(parent, &QDialog::accepted, this, &PluginSelector::saveState);
connect(parent, &QDialog::rejected, this, &PluginSelector::loadDefaults);
}
PluginSelector::~PluginSelector()
......
......@@ -91,7 +91,7 @@ void DataSourceFactory::init()
{
m_speedTimer = new QTimer(this);
m_speedTimer->setInterval(SPEEDTIMER);
connect(m_speedTimer, SIGNAL(timeout()), this, SLOT(speedChanged()));
connect(m_speedTimer, &QTimer::timeout, this, &DataSourceFactory::speedChanged);
}
if (m_segSize && m_size)
......@@ -122,8 +122,8 @@ void DataSourceFactory::findFileSize()
if (!m_size && !m_dest.isEmpty() && !m_sources.isEmpty()) {
foreach (TransferDataSource *source, m_sources) {
if (source->capabilities() & Transfer::Cap_FindFilesize) {
connect(source, SIGNAL(foundFileSize(TransferDataSource*,KIO::filesize_t,QPair<int,int>)), this, SLOT(slotFoundFileSize(TransferDataSource*,KIO::filesize_t,QPair<int,int>)));
connect(source, SIGNAL(finishedDownload(TransferDataSource*,KIO::filesize_t)), this, SLOT(slotFinishedDownload(TransferDataSource*,KIO::filesize_t)));
connect(source, &TransferDataSource::foundFileSize, this, &DataSourceFactory::slotFoundFileSize);
connect(source, &TransferDataSource::finishedDownload, this, &DataSourceFactory::slotFinishedDownload);
m_speedTimer->start();
source->findFileSize(m_segSize);
......@@ -220,8 +220,8 @@ void DataSourceFactory::start()
if (checkLocalFile()) {
if (!m_putJob) {
m_putJob = KIO::open(m_dest, QIODevice::WriteOnly | QIODevice::ReadOnly);
connect(m_putJob, SIGNAL(open(KIO::Job*)), this, SLOT(slotOpen(KIO::Job*)));
connect(m_putJob, SIGNAL(destroyed(QObject*)), this, SLOT(slotPutJobDestroyed(QObject*)));
connect(m_putJob, &KIO::FileJob::open, this, &DataSourceFactory::slotOpen);
connect(m_putJob, &QObject::destroyed, this, &DataSourceFactory::slotPutJobDestroyed);
m_startTried = true;
return;
}
......@@ -314,8 +314,8 @@ void DataSourceFactory::slotOpen(KIO::Job *job)
init();
}
connect(m_putJob, SIGNAL(position(KIO::Job*,KIO::filesize_t)), this, SLOT(slotOffset(KIO::Job*,KIO::filesize_t)));
connect(m_putJob, SIGNAL(written(KIO::Job*,KIO::filesize_t)), this, SLOT(slotDataWritten(KIO::Job*,KIO::filesize_t)));
connect(m_putJob, &KIO::FileJob::position, this, &DataSourceFactory::slotOffset);
connect(m_putJob, &KIO::FileJob::written, this, &DataSourceFactory::slotDataWritten);
m_open = true;
if (m_startTried)
......@@ -441,14 +441,14 @@ void DataSourceFactory::addMirror(const QUrl &url, bool used, int numParallelCon
source->setSupposedSize(m_size);
}
connect(source, SIGNAL(capabilitiesChanged()), this, SLOT(slotUpdateCapabilities()));
connect(source, &TransferDataSource::capabilitiesChanged, this, &DataSourceFactory::slotUpdateCapabilities);
connect(source, SIGNAL(brokenSegments(TransferDataSource*,QPair<int,int>)), this, SLOT(brokenSegments(TransferDataSource*,QPair<int,int>)));
connect(source, SIGNAL(broken(TransferDataSource*,TransferDataSource::Error)), this, SLOT(broken(TransferDataSource*,TransferDataSource::Error)));
connect(source, SIGNAL(finishedSegment(TransferDataSource*,int,bool)), this, SLOT(finishedSegment(TransferDataSource*,int,bool)));
connect(source, &TransferDataSource::broken, this, &DataSourceFactory::broken);
connect(source, &TransferDataSource::finishedSegment, this, &DataSourceFactory::finishedSegment);
connect(source, SIGNAL(data(KIO::fileoffset_t,QByteArray,bool&)), this, SLOT(slotWriteData(KIO::fileoffset_t,QByteArray,bool&)));
connect(source, SIGNAL(freeSegments(TransferDataSource*,QPair<int,int>)), this, SLOT(slotFreeSegments(TransferDataSource*,QPair<int,int>)));
connect(source, SIGNAL(log(QString,Transfer::LogLevel)), this, SIGNAL(log(QString,Transfer::LogLevel)));
connect(source, SIGNAL(urlChanged(QUrl, QUrl)), this, SLOT(slotUrlChanged(QUrl, QUrl)));
connect(source, &TransferDataSource::log, this, &DataSourceFactory::log);
connect(source, &TransferDataSource::urlChanged, this, &DataSourceFactory::slotUrlChanged);
slotUpdateCapabilities();
......@@ -849,7 +849,7 @@ bool DataSourceFactory::setNewDestination(const QUrl &newDestination)
//still a write in progress
if (m_blocked)
{
QTimer::singleShot(1000, this, SLOT(startMove()));
QTimer::singleShot(1000, this, &DataSourceFactory::startMove);
}
else
{
......@@ -866,7 +866,7 @@ void DataSourceFactory::startMove()
killPutJob();
KIO::Job *move = KIO::file_move(m_dest, m_newDest, -1, KIO::HideProgressInfo);
connect(move, SIGNAL(result(KJob*)), this, SLOT(newDestResult(KJob*)));
connect(move, &KJob::result, this, &DataSourceFactory::newDestResult);
connect(move, SIGNAL(percent(KJob*,ulong)), this, SLOT(slotPercent(KJob*,ulong)));
m_dest = m_newDest;
......
......@@ -20,8 +20,8 @@ Download::Download(const QUrl &srcUrl, const QUrl &destUrl)
{
qCDebug(KGET_DEBUG) << "DownloadFile: " << m_srcUrl.url() << " to dest: " << m_destUrl.url();
m_copyJob = KIO::get(m_srcUrl, KIO::NoReload, KIO::HideProgressInfo);
connect(m_copyJob, SIGNAL(data(KIO::Job*,QByteArray)), SLOT(slotData(KIO::Job*,QByteArray)));
connect(m_copyJob, SIGNAL(result(KJob*)), SLOT(slotResult(KJob*)));
connect(m_copyJob, &KIO::TransferJob::data, this, &Download::slotData);
connect(m_copyJob, &KJob::result, this, &Download::slotResult);
}
Download::~Download()
......
......@@ -110,7 +110,7 @@ void KeyDownloader::downloadKey(QString fingerprint, Signature *sig, bool mirror
KIO::StoredTransferJob *job = KIO::storedGet(url, KIO::Reload, KIO::HideProgressInfo);
m_jobs[job] = fingerprint;
connect(job, SIGNAL(finished(KJob*)), this, SLOT(slotDownloaded(KJob*)));
connect(job, &KJob::finished, this, &KeyDownloader::slotDownloaded);
}
}
......
......@@ -832,8 +832,8 @@ KGet::KGet()
QObject::connect(m_transferTreeModel, SIGNAL(transfersAddedEvent(QList<TransferHandler*>)),
m_jobManager, SLOT(slotTransfersAdded(QList<TransferHandler*>)));
QObject::connect(m_transferTreeModel, SIGNAL(transfersAboutToBeRemovedEvent(QList<TransferHandler*>)),
m_jobManager, SLOT(slotTransfersAboutToBeRemoved(QList<TransferHandler*>)));
QObject::connect(m_transferTreeModel, &TransferTreeModel::transfersAboutToBeRemovedEvent,
m_jobManager, &KUiServerJobs::slotTransfersAboutToBeRemoved);
QObject::connect(m_transferTreeModel, SIGNAL(transfersChangedEvent(QMap<TransferHandler*,Transfer::ChangesFlags>)),
m_jobManager, SLOT(slotTransfersChanged(QMap<TransferHandler*,Transfer::ChangesFlags>)));
......@@ -1175,7 +1175,7 @@ void KGet::loadPlugins()
const KConfigGroup plugins = KConfigGroup(KSharedConfig::openConfig(), "Plugins");
for (const KPluginMetaData& md : sortedOffers)
for (const KPluginMetaData& md : qAsConst(sortedOffers))
{
KPluginInfo info(md);
info.load(plugins);
......@@ -1290,20 +1290,20 @@ GenericObserver::GenericObserver(QObject *parent)
//check if there is a connection
KGet::setHasNetworkConnection(m_networkConfig.isOnline());
connect(KGet::model(), SIGNAL(groupRemovedEvent(TransferGroupHandler*)), SLOT(groupRemovedEvent(TransferGroupHandler*)));
connect(KGet::model(), &TransferTreeModel::groupRemovedEvent, this, &GenericObserver::groupRemovedEvent);
connect(KGet::model(), SIGNAL(transfersAddedEvent(QList<TransferHandler*>)),
SLOT(transfersAddedEvent(QList<TransferHandler*>)));
connect(KGet::model(), SIGNAL(groupAddedEvent(TransferGroupHandler*)), SLOT(groupAddedEvent(TransferGroupHandler*)));
connect(KGet::model(), SIGNAL(transfersRemovedEvent(QList<TransferHandler*>)),
SLOT(transfersRemovedEvent(QList<TransferHandler*>)));
connect(KGet::model(), &TransferTreeModel::groupAddedEvent, this, &GenericObserver::groupAddedEvent);
connect(KGet::model(), &TransferTreeModel::transfersRemovedEvent,
this, &GenericObserver::transfersRemovedEvent);
connect(KGet::model(), SIGNAL(transfersChangedEvent(QMap<TransferHandler*,Transfer::ChangesFlags>)),
SLOT(transfersChangedEvent(QMap<TransferHandler*,Transfer::ChangesFlags>)));
connect(KGet::model(), SIGNAL(groupsChangedEvent(QMap<TransferGroupHandler*,TransferGroup::ChangesFlags>)),
SLOT(groupsChangedEvent(QMap<TransferGroupHandler*,TransferGroup::ChangesFlags>)));
connect(KGet::model(), SIGNAL(transferMovedEvent(TransferHandler*,TransferGroupHandler*)),
SLOT(transferMovedEvent(TransferHandler*,TransferGroupHandler*)));
connect(&m_networkConfig, SIGNAL(onlineStateChanged(bool)),
this, SLOT(slotNetworkStatusChanged(bool)));
connect(KGet::model(), &TransferTreeModel::transferMovedEvent,
this, &GenericObserver::transferMovedEvent);
connect(&m_networkConfig, &QNetworkConfigurationManager::onlineStateChanged,
this, &GenericObserver::slotNetworkStatusChanged);
}
......@@ -1352,7 +1352,7 @@ void GenericObserver::requestSave()
if (!m_save) {
m_save = new QTimer(this);
m_save->setInterval(5000);
connect(m_save, SIGNAL(timeout()), this, SLOT(slotSave()));
connect(m_save, &QTimer::timeout, this, &GenericObserver::slotSave);
}
//save regularly if there are running jobs
......@@ -1395,8 +1395,8 @@ void GenericObserver::transfersChangedEvent(QMap<TransferHandler*, Transfer::Cha
if (transfer->error().type == Job::ManualSolve) {
m_notifications.insert(notification, transfer);
notification->setActions(QStringList() << i18n("Resolve"));
connect(notification, SIGNAL(action1Activated()), SLOT(slotResolveTransferError()));
connect(notification, SIGNAL(closed()), SLOT(slotNotificationClosed()));
connect(notification, &KNotification::action1Activated, this, &GenericObserver::slotResolveTransferError);
connect(notification, &KNotification::closed, this, &GenericObserver::slotNotificationClosed);
}
}
}
......@@ -1465,8 +1465,8 @@ void GenericObserver::transfersChangedEvent(QMap<TransferHandler*, Transfer::Cha
if (notification) {
notification->setActions(QStringList() << i18nc("abort the proposed action", "Abort"));
connect(notification, SIGNAL(action1Activated()), this, SLOT(slotAbortAfterFinishAction()));
connect(m_finishAction, SIGNAL(timeout()), notification, SLOT(close()));
connect(notification, &KNotification::action1Activated, this, &GenericObserver::slotAbortAfterFinishAction);
connect(m_finishAction, &QTimer::timeout, notification, &KNotification::close);
if (!m_finishAction->isActive()) {
m_finishAction->start();
......
......@@ -122,9 +122,9 @@ void KUiServerJobs::registerJob(KGetKJobAdapter *job, TransferHandler *transfer)
if (m_registeredJobs.contains(transfer) || !job) {
return;
}
connect(job, SIGNAL(requestStop(KJob*,TransferHandler*)), this, SLOT(slotRequestStop(KJob*,TransferHandler*)));
connect(job, SIGNAL(requestSuspend(KJob*,TransferHandler*)), this, SLOT(slotRequestSuspend(KJob*,TransferHandler*)));
connect(job, SIGNAL(requestResume(KJob*,TransferHandler*)), this, SLOT(slotRequestResume(KJob*,TransferHandler*)));
connect(job, &KGetKJobAdapter::requestStop, this, &KUiServerJobs::slotRequestStop);
connect(job, &KGetKJobAdapter::requestSuspend, this, &KUiServerJobs::slotRequestSuspend);
connect(job, &KGetKJobAdapter::requestResume, this, &KUiServerJobs::slotRequestResume);
KJob *j = job;
registerJob(j, transfer);
......@@ -203,7 +203,7 @@ KGetGlobalJob * KUiServerJobs::globalJob()
{
if (!m_globalJob) {
m_globalJob = new KGetGlobalJob();
connect(m_globalJob, SIGNAL(requestStop(KJob*,TransferHandler*)), this, SLOT(slotRequestStop(KJob*,TransferHandler*)));
connect(m_globalJob, &KGetGlobalJob::requestStop, this, &KUiServerJobs::slotRequestStop);
}
return m_globalJob;
}
......
......@@ -104,7 +104,7 @@ Signature::Signature(const QUrl &dest, QObject *object)
d->dest = dest;
#ifdef HAVE_QGPGME
qRegisterMetaType<GpgME::VerificationResult>("GpgME::VerificationResult");
connect(&d->thread, SIGNAL(verified(GpgME::VerificationResult)), this, SLOT(slotVerified(GpgME::VerificationResult)));
connect(&d->thread, &SignatureThread::verified, this, &Signature::slotVerified);
#endif //HAVE_QGPGME
}
......
......@@ -36,7 +36,7 @@ TransferHandler::TransferHandler(Transfer * parent, Scheduler * scheduler)
m_kjobAdapter = new KGetKJobAdapter(this, this);
connect(m_transfer, SIGNAL(capabilitiesChanged()), this, SIGNAL(capabilitiesChanged()));
connect(m_transfer, &Transfer::capabilitiesChanged, this, &TransferHandler::capabilitiesChanged);
}
TransferHandler::~TransferHandler()
......
......@@ -203,11 +203,11 @@ void XmlStore::load()
// TODO: only load if necessary
m_loadThread = new XmlStore::LoadThread(this, m_storeUrl);
connect(m_loadThread, SIGNAL(finished()), SIGNAL(loadFinished()));
connect(m_loadThread, SIGNAL(elementLoaded(int,int,TransferHistoryItem)),
SIGNAL(elementLoaded(int,int,TransferHistoryItem)));
connect(m_loadThread, SIGNAL(elementLoaded(int,int,TransferHistoryItem)),
SLOT(slotLoadElement(int,int,TransferHistoryItem)));
connect(m_loadThread, &QThread::finished, this, &TransferHistoryStore::loadFinished);
connect(m_loadThread, &LoadThread::elementLoaded,
this, &TransferHistoryStore::elementLoaded);
connect(m_loadThread, &LoadThread::elementLoaded,
this, &XmlStore::slotLoadElement);
m_loadThread->start();
}
......@@ -220,9 +220,9 @@ void XmlStore::saveItem(const TransferHistoryItem &item)
{
m_saveThread = new XmlStore::SaveThread(this, m_storeUrl, item);
connect(m_saveThread, SIGNAL(finished()), SIGNAL(saveFinished()));
connect(m_saveThread, SIGNAL(elementLoaded(int,int,TransferHistoryItem)),
SIGNAL(elementLoaded(int,int,TransferHistoryItem)));
connect(m_saveThread, &QThread::finished, this, &TransferHistoryStore::saveFinished);
connect(m_saveThread, &SaveThread::elementLoaded,
this, &TransferHistoryStore::elementLoaded);
m_saveThread->start();
}
......@@ -232,7 +232,7 @@ void XmlStore::deleteItem(const TransferHistoryItem &item)
m_deleteThread = new XmlStore::DeleteThread(this, m_storeUrl, item);
connect(m_deleteThread, SIGNAL(finished()), SLOT(slotDeleteElement()));
connect(m_deleteThread, &QThread::finished, this, &XmlStore::slotDeleteElement);
m_deleteThread->start();
}
......
......@@ -45,7 +45,7 @@ DBusKGetWrapper::DBusKGetWrapper(MainWindow *parent)
TransferTreeModel *model = KGet::model();
connect(model, SIGNAL(transfersAddedEvent(QList<TransferHandler*>)), this, SLOT(slotTransfersAdded(QList<TransferHandler*>)));
connect(model, SIGNAL(transfersRemovedEvent(QList<TransferHandler*>)), this, SLOT(slotTransfersRemoved(QList<TransferHandler*>)));
connect(model, &TransferTreeModel::transfersRemovedEvent, this, &DBusKGetWrapper::slotTransfersRemoved);
}
DBusKGetWrapper::~DBusKGetWrapper()
......
......@@ -16,8 +16,8 @@ DBusTransferWrapper::DBusTransferWrapper(TransferHandler *parent)
: QObject(parent),
m_transfer(parent)
{
connect(m_transfer, SIGNAL(transferChangedEvent(TransferHandler*,TransferHandler::ChangesFlags)), this, SLOT(slotTransferChanged(TransferHandler*,TransferHandler::ChangesFlags)));
connect(m_transfer, SIGNAL(capabilitiesChanged()), this, SIGNAL(capabilitiesChanged()));
connect(m_transfer, &TransferHandler::transferChangedEvent, this, &DBusTransferWrapper::slotTransferChanged);
connect(m_transfer, &TransferHandler::capabilitiesChanged, this, &DBusTransferWrapper::capabilitiesChanged);
}
DBusTransferWrapper::~DBusTransferWrapper()
......
......@@ -26,7 +26,7 @@ DBusVerifierWrapper::DBusVerifierWrapper(Verifier *verifier)
m_verifier(verifier)
{
connect(m_verifier, SIGNAL(brokenPieces(QList<KIO::fileoffset_t>,KIO::filesize_t)), this, SLOT(slotBrokenPieces(QList<KIO::fileoffset_t>,KIO::filesize_t)));
connect(m_verifier, SIGNAL(verified(bool)), this, SIGNAL(verified(bool)));
connect(m_verifier, &Verifier::verified, this, &DBusVerifierWrapper::verified);
}
DBusVerifierWrapper::~DBusVerifierWrapper()
......
......@@ -56,22 +56,22 @@ KGetPlugin::KGetPlugin(QObject *parent, const QVariantList&)
actionCollection()->addAction("kget_menu", menu);
menu->setDelayed( false );
connect( menu->menu(), SIGNAL(aboutToShow()), SLOT(showPopup()));
connect( menu->menu(), &QMenu::aboutToShow, this, &KGetPlugin::showPopup);
m_dropTargetAction = new KToggleAction(i18n("Show Drop Target"), actionCollection());
connect(m_dropTargetAction, SIGNAL(triggered()), this, SLOT(slotShowDrop()));
connect(m_dropTargetAction, &QAction::triggered, this, &KGetPlugin::slotShowDrop);
actionCollection()->addAction(QL1S("show_drop"), m_dropTargetAction);
menu->addAction(m_dropTargetAction);
QAction *showLinksAction = actionCollection()->addAction(QL1S("show_links"));
showLinksAction->setText(i18n("List All Links"));
connect(showLinksAction, SIGNAL(triggered()), SLOT(slotShowLinks()));
connect(showLinksAction, &QAction::triggered, this, &KGetPlugin::slotShowLinks);
menu->addAction(showLinksAction);
QAction *showSelectedLinksAction = actionCollection()->addAction(QL1S("show_selected_links"));
showSelectedLinksAction->setText(i18n("List Selected Links"));
connect(showSelectedLinksAction, SIGNAL(triggered()), SLOT(slotShowSelectedLinks()));
connect(showSelectedLinksAction, &QAction::triggered, this, &KGetPlugin::slotShowSelectedLinks);
menu->addAction(showSelectedLinksAction);
// Hide this plugin if the parent part does not support either
......
......@@ -149,73 +149,73 @@ void MainWindow::setupActions()
newDownloadAction->setIcon(QIcon::fromTheme("document-new"));
//newDownloadAction->setHelpText(i18n("Opens a dialog to add a transfer to the list"));
actionCollection()->setDefaultShortcut(newDownloadAction, QKeySequence(Qt::CTRL + Qt::Key_N));
connect(newDownloadAction, SIGNAL(triggered()), SLOT(slotNewTransfer()));
connect(newDownloadAction, &QAction::triggered, this, &MainWindow::slotNewTransfer);
QAction *openAction = actionCollection()->addAction("import_transfers");
openAction->setText(i18n("&Import Transfers..."));
openAction->setIcon(QIcon::fromTheme("document-open"));
//openAction->setHelpText(i18n("Imports a list of transfers"));
actionCollection()->setDefaultShortcut(openAction, QKeySequence(Qt::CTRL + Qt::Key_I));
connect(openAction, SIGNAL(triggered()), SLOT(slotImportTransfers()));
connect(openAction, &QAction::triggered, this, &MainWindow::slotImportTransfers);
QAction *exportAction = actionCollection()->addAction("export_transfers");
exportAction->setText(i18n("&Export Transfers List..."));
exportAction->setIcon(QIcon::fromTheme("document-export"));
//exportAction->setHelpText(i18n("Exports the current transfers into a file"));
actionCollection()->setDefaultShortcut(exportAction, QKeySequence(Qt::CTRL + Qt::Key_E));
connect(exportAction, SIGNAL(triggered()), SLOT(slotExportTransfers()));
connect(exportAction, &QAction::triggered, this, &MainWindow::slotExportTransfers);
QAction *createMetalinkAction = actionCollection()->addAction("create_metalink");
createMetalinkAction->setText(i18n("&Create a Metalink..."));
createMetalinkAction->setIcon(QIcon::fromTheme("journal-new"));
//createMetalinkAction->setHelpText(i18n("Creates or modifies a metalink and saves it on disk"));
connect(createMetalinkAction, SIGNAL(triggered()), SLOT(slotCreateMetalink()));
connect(createMetalinkAction, &QAction::triggered, this, &MainWindow::slotCreateMetalink);
QAction *priorityTop = actionCollection()->addAction("priority_top");
priorityTop->setText(i18n("Top Priority"));
priorityTop->setIcon(QIcon::fromTheme("arrow-up-double"));
//priorityTop->setHelpText(i18n("Download selected transfer first"));
actionCollection()->setDefaultShortcut(priorityTop, QKeySequence(Qt::CTRL + Qt::Key_PageUp));
connect(priorityTop, SIGNAL(triggered()), this, SLOT(slotPriorityTop()));
connect(priorityTop, &QAction::triggered, this, &MainWindow::slotPriorityTop);
QAction *priorityBottom = actionCollection()->addAction("priority_bottom");
priorityBottom->setText(i18n("Least Priority"));
priorityBottom->setIcon(QIcon::fromTheme("arrow-down-double"));
//priorityBottom->setHelpText(i18n("Download selected transfer last"));
actionCollection()->setDefaultShortcut(priorityBottom, QKeySequence(Qt::CTRL + Qt::Key_PageDown));
connect(priorityBottom, SIGNAL(triggered()), this, SLOT(slotPriorityBottom()));
connect(priorityBottom, &QAction::triggered, this, &MainWindow::slotPriorityBottom);
QAction *priorityUp = actionCollection()->addAction("priority_up");
priorityUp->setText(i18n("Increase Priority"));
priorityUp->setIcon(QIcon::fromTheme("arrow-up"));
//priorityUp->setHelpText(i18n("Increase priority for selected transfer"));
actionCollection()->setDefaultShortcut(priorityUp, QKeySequence(Qt::CTRL + Qt::Key_Up));
connect(priorityUp, SIGNAL(triggered()), this, SLOT(slotPriorityUp()));
connect(priorityUp, &QAction::triggered, this, &MainWindow::slotPriorityUp);
QAction *priorityDown = actionCollection()->addAction("priority_down");
priorityDown->setText(i18n("Decrease Priority"));
priorityDown->setIcon(QIcon::fromTheme("arrow-down"));
//priorityDown->setHelpText(i18n("Decrease priority for selected transfer"));
actionCollection()->setDefaultShortcut(priorityDown, QKeySequence(Qt::CTRL + Qt::Key_Down));
connect(priorityDown, SIGNAL(triggered()), this, SLOT(slotPriorityDown()));
connect(priorityDown, &QAction::triggered, this, &MainWindow::slotPriorityDown);
//FIXME: Not needed maybe because the normal delete already deletes groups?
QAction *deleteGroupAction = actionCollection()->addAction("delete_groups");
deleteGroupAction->setText(i18n("Delete Group"));
deleteGroupAction->setIcon(QIcon::fromTheme("edit-delete"));
//deleteGroupAction->setHelpText(i18n("Delete selected group"));
connect(deleteGroupAction, SIGNAL(triggered()), SLOT(slotDeleteGroup()));
connect(deleteGroupAction, &QAction::triggered, this, &MainWindow::slotDeleteGroup);
QAction *renameGroupAction = actionCollection()->addAction("rename_groups");
renameGroupAction->setText(i18n("Rename Group..."));
renameGroupAction->setIcon(QIcon::fromTheme("edit-rename"));
connect(renameGroupAction, SIGNAL(triggered()), SLOT(slotRenameGroup()));
connect(renameGroupAction, &QAction::triggered, this, &MainWindow::slotRenameGroup);
QAction *setIconGroupAction = actionCollection()->addAction("seticon_groups");
setIconGroupAction->setText(i18n("Set Icon..."));
setIconGroupAction->setIcon(QIcon::fromTheme("preferences-desktop-icons"));
//setIconGroupAction->setHelpText(i18n("Select a custom icon for the selected group"));
connect(setIconGroupAction, SIGNAL(triggered()), SLOT(slotSetIconGroup()));
connect(setIconGroupAction, &QAction::triggered, this, &MainWindow::slotSetIconGroup);
m_autoPasteAction = new KToggleAction(QIcon::fromTheme("edit-paste"),
i18n("Auto-Paste Mode"), actionCollection());
......@@ -224,12 +224,12 @@ void MainWindow::setupActions()
m_autoPasteAction->setWhatsThis(i18n("<b>Auto paste</b> button toggles the auto-paste mode "
"on and off.\nWhen set, KGet will periodically scan "
"the clipboard for URLs and paste them automatically."));
connect(m_autoPasteAction, SIGNAL(triggered()), SLOT(slotToggleAutoPaste()));
connect(m_autoPasteAction, &QAction::triggered, this, &MainWindow::slotToggleAutoPaste);
m_konquerorIntegration = new KToggleAction(QIcon::fromTheme("konqueror"),
i18n("Use KGet as Konqueror Download Manager"), actionCollection());
actionCollection()->addAction("konqueror_integration", m_konquerorIntegration);
connect(m_konquerorIntegration, SIGNAL(triggered(bool)), SLOT(slotTrayKonquerorIntegration(bool)));
connect(m_konquerorIntegration, &QAction::triggered, this, &MainWindow::slotTrayKonquerorIntegration);
m_konquerorIntegration->setChecked(Settings::konquerorIntegration());
// local - Destroys all sub-windows and exits
......@@ -249,50 +249,50 @@ void MainWindow::setupActions()
deleteSelectedAction->setIcon(QIcon::fromTheme("edit-delete"));
// deleteSelectedAction->setHelpText(i18n("Removes selected transfer and deletes files from disk if it's not finished"));
actionCollection()->setDefaultShortcut(deleteSelectedAction, QKeySequence(Qt::Key_Delete));
connect(deleteSelectedAction, SIGNAL(triggered()), SLOT(slotDeleteSelected()));
connect(deleteSelectedAction, &QAction::triggered, this, &MainWindow::slotDeleteSelected);
QAction *deleteAllFinishedAction = actionCollection()->addAction("delete_all_finished");
deleteAllFinishedAction->setText(i18nc("delete all finished transfers", "Remove All Finished"));
deleteAllFinishedAction->setIcon(QIcon::fromTheme("edit-clear-list"));
// deleteAllFinishedAction->setHelpText(i18n("Removes all finished transfers and leaves all files on disk"));
connect(deleteAllFinishedAction, SIGNAL(triggered()), SLOT(slotDeleteFinished()));
connect(deleteAllFinishedAction, &QAction::triggered, this, &MainWindow::slotDeleteFinished);
QAction *deleteSelectedIncludingFilesAction = actionCollection()->addAction("delete_selected_download_including_files");
deleteSelectedIncludingFilesAction->setText(i18nc("delete selected transfer item and files", "Remove Selected and Delete Files"));
deleteSelectedIncludingFilesAction->setIcon(QIcon::fromTheme("edit-delete"));
// deleteSelectedIncludingFilesAction->setHelpText(i18n("Removes selected transfer and deletes files from disk in any case"));
connect(deleteSelectedIncludingFilesAction, SIGNAL(triggered()), SLOT(slotDeleteSelectedIncludingFiles()));
connect(deleteSelectedIncludingFilesAction, &QAction::triggered, this, &MainWindow::slotDeleteSelectedIncludingFiles);
QAction *redownloadSelectedAction = actionCollection()->addAction("redownload_selected_download");
redownloadSelectedAction->setText(i18nc("redownload selected transfer item", "Redownload Selected"));
redownloadSelectedAction->setIcon(QIcon::fromTheme("view-refresh"));
connect(redownloadSelectedAction, SIGNAL(triggered()), SLOT(slotRedownloadSelected()));
connect(redownloadSelectedAction, &QAction::triggered, this, &MainWindow::slotRedownloadSelected);
QAction *startAllAction = actionCollection()->addAction("start_all_download");
startAllAction->setText(i18n("Start All"));
startAllAction->setIcon(QIcon::fromTheme("media-seek-forward"));
// startAllAction->setHelpText(i18n("Starts / resumes all transfers"));
actionCollection()->setDefaultShortcut(startAllAction, QKeySequence(Qt::CTRL + Qt::Key_R));
connect(startAllAction, SIGNAL(triggered()), SLOT(slotStartAllDownload()));
connect(startAllAction, &QAction::triggered, this, &MainWindow::slotStartAllDownload);
QAction *startSelectedAction = actionCollection()->addAction("start_selected_download");
startSelectedAction->setText(i18n("Start Selected"));
startSelectedAction->setIcon(QIcon::fromTheme("media-playback-start"));
// startSelectedAction->setHelpText(i18n("Starts / resumes selected transfer"));
connect(startSelectedAction, SIGNAL(triggered()), SLOT(slotStartSelectedDownload()));
connect(startSelectedAction, &QAction::triggered, this, &MainWindow::slotStartSelectedDownload);
QAction *stopAllAction = actionCollection()->addAction("stop_all_download");
stopAllAction->setText(i18n("Pause All"));
stopAllAction->setIcon(QIcon::fromTheme("media-playback-pause"));
// stopAllAction->setHelpText(i18n("Pauses all transfers"));
actionCollection()->setDefaultShortcut(stopAllAction, QKeySequence(Qt::CTRL + Qt::Key_P));
connect(stopAllAction, SIGNAL(triggered()), SLOT(slotStopAllDownload()));
connect(stopAllAction, &QAction::triggered, this, &MainWindow::slotStopAllDownload);
QAction *stopSelectedAction = actionCollection()->addAction("stop_selected_download");
stopSelectedAction->setText(i18n("Stop Selected"));
stopSelectedAction->setIcon(QIcon::fromTheme("media-playback-pause"));
//stopSelectedAction->setHelpText(i18n("Pauses selected transfer"));
connect(stopSelectedAction, SIGNAL(triggered()), SLOT(slotStopSelectedDownload()));
connect(stopSelectedAction, &QAction::triggered, this, &MainWindow::slotStopSelectedDownload);
KActionMenu *startActionMenu = new KActionMenu(QIcon::fromTheme("media-playback-start"), i18n("Start"),
actionCollection());
......@@ -300,7 +300,7 @@ void MainWindow::setupActions()
startActionMenu->setDelayed(true);
startActionMenu->addAction(startSelectedAction);
startActionMenu->addAction(startAllAction);
connect(startActionMenu, SIGNAL(triggered()), SLOT(slotStartDownload()));
connect(startActionMenu, &QAction::triggered, this, &MainWindow::slotStartDownload);
KActionMenu *stopActionMenu = new KActionMenu(QIcon::fromTheme("media-playback-pause"), i18n("Pause"),
actionCollection());
......@@ -308,50 +308,50 @@ void MainWindow::setupActions()
stopActionMenu->setDelayed(true);
stopActionMenu->addAction(stopSelectedAction);
stopActionMenu->addAction(stopAllAction);
connect(stopActionMenu, SIGNAL(triggered()), SLOT(slotStopDownload()));
connect(stopActionMenu, &QAction::triggered, this, &MainWindow::slotStopDownload);
QAction *openDestAction = actionCollection()->addAction("transfer_open_dest");
openDestAction->setText(i18n("Open Destination"));
openDestAction->setIcon(QIcon::fromTheme("document-open"));
connect(openDestAction, SIGNAL(triggered()), SLOT(slotTransfersOpenDest()));
connect(openDestAction, &QAction::triggered, this, &MainWindow::slotTransfersOpenDest);
QAction *openFileAction = actionCollection()->addAction("transfer_open_file");
openFileAction->setText(i18n("Open File"));
openFileAction->setIcon(QIcon::fromTheme("document-open"));
connect(openFileAction, SIGNAL(triggered()), SLOT(slotTransfersOpenFile()));
connect(openFileAction, &QAction::triggered, this, &MainWindow::slotTransfersOpenFile);
QAction *showDetailsAction = new KToggleAction(QIcon::fromTheme("document-properties"), i18n("Show Details"), actionCollection());
actionCollection()->addAction("transfer_show_details", showDetailsAction);
connect(showDetailsAction, SIGNAL(triggered()), SLOT(slotTransfersShowDetails()));
connect(showDetailsAction, &QAction::triggered, this, &MainWindow::slotTransfersShowDetails);
QAction *copyUrlAction = actionCollection()->addAction("transfer_copy_source_url");