Commit 0ffe6a4a authored by Laurent Montel's avatar Laurent Montel 😁

Port to new connect api

parent e5079768
......@@ -77,7 +77,7 @@ DropTarget::DropTarget(MainWindow * mw)
QAction * downloadAction = mw->actionCollection()->action("start_all_download");
popupMenu->addAction( downloadAction );
connect( downloadAction, SIGNAL(toggled(bool)), this, SLOT(slotStartStopToggled(bool)) );
connect(downloadAction, &QAction::toggled, this, &DropTarget::slotStartStopToggled);
popupMenu->addSeparator();
pop_show = popupMenu->addAction( QString(), this, SLOT(toggleMinimizeRestore()) );
popupMenu->addAction(parentWidget->actionCollection()->action("show_drop_target"));
......@@ -110,8 +110,7 @@ DropTarget::DropTarget(MainWindow * mw)
connect(KGet::model(), SIGNAL(transfersChangedEvent(QMap<TransferHandler*,Transfer::ChangesFlags>)),
this, SLOT(slotToolTipUpdate()));
connect(popupTimer, SIGNAL(timeout()),
this, SLOT(slotToolTipTimer()));
connect(popupTimer, &QTimer::timeout, this, &DropTarget::slotToolTipTimer);
}
......@@ -159,8 +158,7 @@ void DropTarget::playAnimationShow()
if (animTimer->isActive())
animTimer->stop();
animTimer->disconnect();
connect( animTimer, SIGNAL(timeout()),
this, SLOT(slotAnimateShow()));
connect(animTimer, &QTimer::timeout, this, &DropTarget::slotAnimateShow);
move(position.x(), -TARGET_SIZE);
......@@ -176,8 +174,7 @@ void DropTarget::playAnimationHide()
animTimer->stop();
animTimer->disconnect();
connect( animTimer, SIGNAL(timeout()),
this, SLOT(slotAnimateHide()));
connect(animTimer, &QTimer::timeout, this, &DropTarget::slotAnimateHide);
ani_y = (float)y();
ani_vy = 0;
animTimer->start(TARGET_ANI_MS);
......@@ -189,8 +186,7 @@ void DropTarget::playAnimationSync()
animTimer->stop();
animTimer->disconnect();
connect( animTimer, SIGNAL(timeout()),
this, SLOT(slotAnimateSync()));
connect(animTimer, &QTimer::timeout, this, &DropTarget::slotAnimateSync);
ani_y = (float)y();
ani_vy = -1;
animTimer->start(TARGET_ANI_MS);
......
......@@ -49,7 +49,7 @@ GroupSettingsDialog::GroupSettingsDialog(QWidget *parent, TransferGroupHandler *
ui.nepomukWidget->hide();
#endif
connect(this, SIGNAL(accepted()), SLOT(save()));
connect(this, &GroupSettingsDialog::accepted, this, &GroupSettingsDialog::save);
}
GroupSettingsDialog::~GroupSettingsDialog()
......
......@@ -53,9 +53,8 @@ TransferHistoryCategorizedView::TransferHistoryCategorizedView(QWidget *parent)
m_proxyModel->setSourceModel(m_model);
m_view->setModel(m_proxyModel);
connect(item_delegate, SIGNAL(deletedTransfer(QString,QModelIndex)),
SIGNAL(deletedTransfer(QString,QModelIndex)));
connect(m_view, SIGNAL(doubleClicked(QModelIndex)), SIGNAL(doubleClicked(QModelIndex)));
connect(item_delegate, &TransferHistoryItemDelegate::deletedTransfer, this, &TransferHistoryCategorizedView::deletedTransfer);
connect(m_view, &KCategorizedView::doubleClicked, this, &TransferHistoryCategorizedView::doubleClicked);
setLayout(layout);
}
......
......@@ -40,17 +40,17 @@ TransferHistoryItemDelegate::TransferHistoryItemDelegate(QWidget *parent) : QSty
m_actionDownload = new QAction(this);
m_actionDownload->setText(i18n("Download again"));
m_actionDownload->setIcon(KIcon("document-new"));
connect(m_actionDownload, SIGNAL(triggered()), SLOT(slotDownload()));
connect(m_actionDownload, &QAction::triggered, this, &TransferHistoryItemDelegate::slotDownload);
m_actionDelete_Selected = new QAction(this);
m_actionDelete_Selected->setText(i18nc("Delete selected history-item", "Delete selected"));
m_actionDelete_Selected->setIcon(KIcon("edit-delete"));
connect(m_actionDelete_Selected, SIGNAL(triggered()), SLOT(slotDeleteTransfer()));
connect(m_actionDelete_Selected, &QAction::triggered, this, &TransferHistoryItemDelegate::slotDeleteTransfer);
m_openFile = new QAction(this);
m_openFile->setText(i18n("Open file"));
m_openFile->setIcon(KIcon("document-open"));
connect(m_openFile, SIGNAL(triggered()), SLOT(slotOpenFile()));
connect(m_openFile, &QAction::triggered, this, &TransferHistoryItemDelegate::slotOpenFile);
}
TransferHistoryItemDelegate::~TransferHistoryItemDelegate()
......
......@@ -64,7 +64,7 @@ DragDlg::DragDlg(KGetMetalink::Resources *resources, KGetMetalink::CommonData *c
uiData.language->setModel(languageSort);
uiData.language->setCurrentIndex(-1);
connect(this, SIGNAL(accepted()), this, SLOT(slotFinished()));
connect(this, &DragDlg::accepted, this, &DragDlg::slotFinished);
setCaption(i18n("Import dropped files"));
}
......
......@@ -47,7 +47,7 @@ FileDlg::FileDlg(KGetMetalink::File *file, const QStringList &currentFileNames,
m_urlWidget = new UrlWidget(this);
m_urlWidget->init(&m_file->resources, countrySort);
ui.urlLayout->addWidget(m_urlWidget->widget());
connect(m_urlWidget, SIGNAL(urlsChanged()), this, SLOT(slotUpdateOkButton()));
connect(m_urlWidget, &UrlWidget::urlsChanged, this, &FileDlg::slotUpdateOkButton);
QWidget *data = new QWidget(this);
uiData.setupUi(data);
......@@ -102,13 +102,13 @@ FileDlg::FileDlg(KGetMetalink::File *file, const QStringList &currentFileNames,
ui.used_hashes->setItemDelegate(new VerificationDelegate(this));
slotUpdateVerificationButtons();
connect(m_verificationModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(slotUpdateVerificationButtons()));
connect(m_verificationModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(slotUpdateVerificationButtons()));
connect(ui.used_hashes, SIGNAL(clicked(QModelIndex)), this, SLOT(slotUpdateVerificationButtons()));
connect(ui.add_hash, SIGNAL(clicked()), this, SLOT(slotAddHash()));
connect(ui.remove_hash, SIGNAL(clicked()), this, SLOT(slotRemoveHash()));
connect(ui.name, SIGNAL(textEdited(QString)), this, SLOT(slotUpdateOkButton()));
connect(this, SIGNAL(okClicked()), this, SLOT(slotOkClicked()));
connect(m_verificationModel, &VerificationModel::dataChanged, this, &FileDlg::slotUpdateVerificationButtons);
connect(m_verificationModel, &VerificationModel::rowsRemoved, this, &FileDlg::slotUpdateVerificationButtons);
connect(ui.used_hashes, &QTreeView::clicked, this, &FileDlg::slotUpdateVerificationButtons);
connect(ui.add_hash, &KPushButton::clicked, this, &FileDlg::slotAddHash);
connect(ui.remove_hash, &KPushButton::clicked, this, &FileDlg::slotRemoveHash);
connect(ui.name, &KLineEdit::textEdited, this, &FileDlg::slotUpdateOkButton);
connect(this, &FileDlg::okClicked, this, &FileDlg::slotOkClicked);
slotUpdateOkButton();
......
......@@ -156,8 +156,8 @@ void DirectoryHandler::slotFiles(const QList<QUrl> &files)
KIO::ListJob *listJob = KIO::listRecursive(url);
m_jobs[listJob] = url;
connect(listJob, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), this, SLOT(slotDirEntries(KIO::Job*,KIO::UDSEntryList)));
connect(listJob, SIGNAL(result(KJob*)), this, SLOT(slotFinished(KJob*)));
connect(listJob, &KIO::ListJob::entries, this, &DirectoryHandler::slotDirEntries);
connect(listJob, &KIO::ListJob::result, this, &DirectoryHandler::slotFinished);
} else {
FileData data;
data.url = url;
......
......@@ -30,8 +30,8 @@ GeneralWidget::GeneralWidget(QWidget *parent)
ui.dynamic->setToolTip(ui.labelDynamic->toolTip());
connect(ui.publishedGroupBox, SIGNAL(toggled(bool)), this, SLOT(slotPublishedEnabled(bool)));
connect(ui.updatedGroupBox, SIGNAL(toggled(bool)), this, SLOT(slotUpdatedEnabled(bool)));
connect(ui.publishedGroupBox, &QGroupBox::toggled, this, &GeneralWidget::slotPublishedEnabled);
connect(ui.updatedGroupBox, &QGroupBox::toggled, this, &GeneralWidget::slotUpdatedEnabled);
}
void GeneralWidget::load(const KGetMetalink::Metalink &metalink) const
......
......@@ -46,11 +46,11 @@ UrlWidget::UrlWidget(QObject *parent)
ui.remove_mirror->setGuiItem(KStandardGuiItem::remove());
ui.remove_mirror->setEnabled(false);
connect(ui.used_mirrors->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotUrlClicked()));
connect(ui.add_mirror, SIGNAL(clicked(bool)), this, SLOT(slotAddMirror()));
connect(ui.remove_mirror, SIGNAL(clicked(bool)), this, SLOT(slotRemoveMirror()));
connect(m_mirrorModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(urlsChanged()));
connect(m_mirrorModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(urlsChanged()));
connect(m_mirrorModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(urlsChanged()));
connect(ui.add_mirror, &KPushButton::clicked, this, &UrlWidget::slotAddMirror);
connect(ui.remove_mirror, &KPushButton::clicked, this, &UrlWidget::slotRemoveMirror);
connect(m_mirrorModel, &MirrorModel::dataChanged, this, &UrlWidget::urlsChanged);
connect(m_mirrorModel, &MirrorModel::rowsInserted, this, &UrlWidget::urlsChanged);
connect(m_mirrorModel, &MirrorModel::rowsRemoved, this, &UrlWidget::urlsChanged);
}
UrlWidget::~UrlWidget()
......
......@@ -68,7 +68,7 @@ void MirrorAddDlg::init()
updateButton();
connect(ui.url, SIGNAL(textChanged(QString)), this, SLOT(updateButton(QString)));
connect(this, SIGNAL(yesClicked()), this, SLOT(addMirror()));
connect(this, &MirrorAddDlg::yesClicked, this, &MirrorAddDlg::addMirror);
}
void MirrorAddDlg::showItem(MirrorItem::DataType type, bool show)
......@@ -143,9 +143,9 @@ MirrorSettings::MirrorSettings(QWidget *parent, TransferHandler *handler, const
updateButton();
connect(ui.treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(updateButton()));
connect(ui.add, SIGNAL(clicked()), this, SLOT(addClicked()));
connect(ui.remove, SIGNAL(clicked()), this, SLOT(removeMirror()));
connect(this, SIGNAL(finished()), this, SLOT(save()));
connect(ui.add, &KPushButton::clicked, this, &MirrorSettings::addClicked);
connect(ui.remove, &KPushButton::clicked, this, &MirrorSettings::removeMirror);
connect(this, &MirrorSettings::finished, this, &MirrorSettings::save);
setMainWidget(widget);
setCaption(i18n("Modify the used mirrors"));
......
......@@ -44,8 +44,8 @@ RenameFile::RenameFile(FileModel *model, const QModelIndex &index, QWidget *pare
setButtonText(KDialog::Ok, i18n("&Rename"));
enableButtonOk(false);
connect(ui.name, SIGNAL(textEdited(QString)), this, SLOT(updateButton()));
connect(this, SIGNAL(okClicked()), this, SLOT(rename()));
connect(ui.name, &KLineEdit::textEdited, this, &RenameFile::updateButton);
connect(this, &RenameFile::okClicked, this, &RenameFile::rename);
}
void RenameFile::updateButton()
......
......@@ -64,14 +64,14 @@ TransferSettingsDialog::TransferSettingsDialog(QWidget *parent, TransferHandler
updateCapabilities();
connect(m_transfer, SIGNAL(capabilitiesChanged()), this, SLOT(updateCapabilities()));
connect(this, SIGNAL(accepted()), SLOT(save()));
connect(this, SIGNAL(finished()), this, SLOT(slotFinished()));
connect(m_transfer, &TransferHandler::capabilitiesChanged, this, &TransferSettingsDialog::updateCapabilities);
connect(this, &TransferSettingsDialog::accepted, this, &TransferSettingsDialog::save);
connect(this, &TransferSettingsDialog::finished, this, &TransferSettingsDialog::slotFinished);
connect(ui.treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(slotSelectionChanged()));
connect(ui.rename, SIGNAL(clicked(bool)), this, SLOT(slotRename()));
connect(ui.mirrors, SIGNAL(clicked(bool)), this, SLOT(slotMirrors()));
connect(ui.verification, SIGNAL(clicked(bool)), this, SLOT(slotVerification()));
connect(ui.signature, SIGNAL(clicked(bool)), this, SLOT(slotSignature()));
connect(ui.rename, &KPushButton::clicked, this, &TransferSettingsDialog::slotRename);
connect(ui.mirrors, &KPushButton::clicked, this, &TransferSettingsDialog::slotMirrors);
connect(ui.verification, &KPushButton::clicked, this, &TransferSettingsDialog::slotVerification);
connect(ui.signature, &KPushButton::clicked, this, &TransferSettingsDialog::slotSignature);
}
TransferSettingsDialog::~TransferSettingsDialog()
......
......@@ -241,7 +241,7 @@ GroupStatusEditor::GroupStatusEditor(const QModelIndex &index, QWidget *parent)
m_layout->addStretch();
m_layout->setMargin(1);
connect(m_startBt, SIGNAL(toggled(bool)), this, SLOT(slotStatusChanged()));
connect(m_startBt, &GroupStatusButton::toggled, this, &GroupStatusEditor::slotStatusChanged);
}
void GroupStatusEditor::setRunning(bool running)
......@@ -275,7 +275,7 @@ QWidget *BasicTransfersViewDelegate::createEditor(QWidget *parent, const QStyleO
{
if (index.column() == TransferTreeModel::Status) {
GroupStatusEditor *qroupStatusEditor = new GroupStatusEditor(index, parent);
connect(qroupStatusEditor, SIGNAL(changedStatus(GroupStatusEditor*)), this, SLOT(slotGroupStatusChanged(GroupStatusEditor*)));
connect(qroupStatusEditor, &GroupStatusEditor::changedStatus, this, &BasicTransfersViewDelegate::slotGroupStatusChanged);
return qroupStatusEditor;
} else {
return KExtendableItemDelegate::createEditor(parent, option, index);
......
......@@ -48,8 +48,7 @@ Tray::Tray(MainWindow * parent)
// setToolTipSubTitle("[..]");
// filter middle mouse clicks to ask scheduler to paste URL
connect( this, SIGNAL(secondaryActivateRequested(QPoint)),
this, SLOT(slotActivated()) );
connect(this, &Tray::secondaryActivateRequested, this, &Tray::slotActivated);
}
......
......@@ -50,9 +50,9 @@ VerificationAddDlg::VerificationAddDlg(VerificationModel *model, QWidget *parent
updateButton();
connect(ui.newHash, SIGNAL(textChanged(QString)), this, SLOT(updateButton()));
connect(ui.hashTypes, SIGNAL(currentIndexChanged(int)), this, SLOT(updateButton()));
connect(this, SIGNAL(yesClicked()), this, SLOT(addChecksum()));
connect(ui.newHash, &KLineEdit::textChanged, this, &VerificationAddDlg::updateButton);
connect(ui.hashTypes, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &VerificationAddDlg::updateButton);
connect(this, &VerificationAddDlg::yesClicked, this, &VerificationAddDlg::addChecksum);
}
QSize VerificationAddDlg::sizeHint() const
......@@ -90,7 +90,7 @@ VerificationDialog::VerificationDialog(QWidget *parent, TransferHandler *transfe
{
if (m_verifier) {
m_model = m_verifier->model();
connect(m_verifier, SIGNAL(verified(bool)), this, SLOT(slotVerified(bool)));
connect(m_verifier, &Verifier::verified, this, &VerificationDialog::slotVerified);
}
setCaption(i18n("Transfer Verification for %1", file.fileName()));
......@@ -116,22 +116,22 @@ VerificationDialog::VerificationDialog(QWidget *parent, TransferHandler *transfe
m_fileModel = m_transfer->fileModel();
if (m_fileModel) {
m_file = m_fileModel->index(file, FileItem::File);
connect(m_fileModel, SIGNAL(fileFinished(QUrl)), this, SLOT(fileFinished(QUrl)));
connect(m_fileModel, &FileModel::fileFinished, this, &VerificationDialog::fileFinished);
}
updateButtons();
connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(updateButtons()));
connect(m_model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(updateButtons()));
connect(ui.usedHashes, SIGNAL(clicked(QModelIndex)), this, SLOT(updateButtons()));
connect(ui.add, SIGNAL(clicked()), this, SLOT(addClicked()));
connect(ui.remove, SIGNAL(clicked()), this, SLOT(removeClicked()));
connect(ui.verify, SIGNAL(clicked()), this, SLOT(verifyClicked()));
connect(m_model, &VerificationModel::dataChanged, this, &VerificationDialog::updateButtons);
connect(m_model, &VerificationModel::rowsRemoved, this, &VerificationDialog::updateButtons);
connect(ui.usedHashes, &QTreeView::clicked, this, &VerificationDialog::updateButtons);
connect(ui.add, &KPushButton::clicked, this, &VerificationDialog::addClicked);
connect(ui.remove, &KPushButton::clicked, this, &VerificationDialog::removeClicked);
connect(ui.verify, &KPushButton::clicked, this, &VerificationDialog::verifyClicked);
}
setButtons(KDialog::Close);
connect(this, SIGNAL(finished()), this, SLOT(slotFinished()));
connect(this, &VerificationDialog::finished, this, &VerificationDialog::slotFinished);
}
QSize VerificationDialog::sizeHint() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment