summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Martins <[email protected]>2015-09-19 11:14:59 +0100
committerSergio Martins <[email protected]>2015-09-19 11:14:59 +0100
commit63aa2d9c6b7dab5fbded558b0139922347e3fc7a (patch)
treece1a316a29dfe50eb9c12656e9259b508520c512
parente8d37a9dcc2de95bfd4033efc0cf65a829827f18 (diff)
knotes: Port to Qt5 connect syntax, which is faster
-rw-r--r--knotes/apps/knotesapp.cpp14
-rw-r--r--knotes/configdialog/knotecollectionconfigwidget.cpp4
-rw-r--r--knotes/kontactplugin/kcmknotessummary.cpp4
-rw-r--r--knotes/kontactplugin/knotes_part.cpp8
-rw-r--r--knotes/kontactplugin/summarywidget.cpp4
5 files changed, 17 insertions, 17 deletions
diff --git a/knotes/apps/knotesapp.cpp b/knotes/apps/knotesapp.cpp
index 53c0ae0..1fc2af8 100644
--- a/knotes/apps/knotesapp.cpp
+++ b/knotes/apps/knotesapp.cpp
@@ -208,10 +208,10 @@ KNotesApp::KNotesApp()
connect(mNoteTreeModel, &QAbstractItemModel::rowsInserted,
this, &KNotesApp::slotRowInserted);
- connect(mNoteRecorder->changeRecorder(), SIGNAL(itemChanged(Akonadi::Item,QSet<QByteArray>)), SLOT(slotItemChanged(Akonadi::Item,QSet<QByteArray>)));
- connect(mNoteRecorder->changeRecorder(), SIGNAL(itemRemoved(Akonadi::Item)), SLOT(slotItemRemoved(Akonadi::Item)));
+ connect(mNoteRecorder->changeRecorder(), &Akonadi::Monitor::itemChanged, this, &KNotesApp::slotItemChanged);
+ connect(mNoteRecorder->changeRecorder(), &Akonadi::Monitor::itemRemoved, this, &KNotesApp::slotItemRemoved);
connect(mNoteRecorder->changeRecorder(), SIGNAL(collectionChanged(Akonadi::Collection,QSet<QByteArray>)), SLOT(slotCollectionChanged(Akonadi::Collection,QSet<QByteArray>)));
- connect(qApp, SIGNAL(commitDataRequest(QSessionManager&)), this, SLOT(slotCommitData(QSessionManager&)), Qt::DirectConnection);
+ connect(qApp, &QGuiApplication::commitDataRequest, this, &KNotesApp::slotCommitData, Qt::DirectConnection);
updateNoteActions();
}
@@ -245,7 +245,7 @@ void KNotesApp::slotDeleteSelectedNotes()
Akonadi::Item::List lst = dlg->selectedNotes();
if (!lst.isEmpty()) {
Akonadi::ItemDeleteJob *deleteJob = new Akonadi::ItemDeleteJob(lst, this);
- connect(deleteJob, SIGNAL(result(KJob*)), SLOT(slotNoteDeleteFinished(KJob*)));
+ connect(deleteJob, &KJob::result, this, &KNotesApp::slotNoteDeleteFinished);
}
}
delete dlg;
@@ -475,7 +475,7 @@ void KNotesApp::updateNoteActions()
QAction *action = new QAction(replaceText.replace(QLatin1String("&"), QStringLiteral("&&")), this);
action->setToolTip(realName);
action->setObjectName(QString::number(note->noteId()));
- connect(action, SIGNAL(triggered(bool)), SLOT(slotShowNote()));
+ connect(action, &QAction::triggered, this, &KNotesApp::slotShowNote);
KIconEffect effect;
QPixmap icon =
effect.apply(qApp->windowIcon().pixmap(IconSize(KIconLoader::Small),
@@ -673,7 +673,7 @@ void KNotesApp::slotOpenFindDialog()
{
if (!mFindDialog) {
mFindDialog = new KNoteFindDialog(this);
- connect(mFindDialog, SIGNAL(noteSelected(Akonadi::Item::Id)), this, SLOT(slotSelectNote(Akonadi::Item::Id)));
+ connect(mFindDialog, &KNoteFindDialog::noteSelected, this, &KNotesApp::slotSelectNote);
}
QHash<Akonadi::Item::Id , Akonadi::Item> lst;
@@ -694,7 +694,7 @@ void KNotesApp::fetchNotesFromCollection(const Akonadi::Collection &col)
job->fetchScope().fetchAttribute<NoteShared::NoteDisplayAttribute>();
job->fetchScope().fetchAttribute<NoteShared::NoteAlarmAttribute>();
job->fetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent);
- connect(job, SIGNAL(result(KJob*)), SLOT(slotItemFetchFinished(KJob*)));
+ connect(job, &KJob::result, this, &KNotesApp::slotItemFetchFinished);
}
void KNotesApp::slotItemFetchFinished(KJob *job)
diff --git a/knotes/configdialog/knotecollectionconfigwidget.cpp b/knotes/configdialog/knotecollectionconfigwidget.cpp
index 5143bab..11c0623 100644
--- a/knotes/configdialog/knotecollectionconfigwidget.cpp
+++ b/knotes/configdialog/knotecollectionconfigwidget.cpp
@@ -111,7 +111,7 @@ KNoteCollectionConfigWidget::KNoteCollectionConfigWidget(QWidget *parent)
vbox->addWidget(mFolderView);
mFolderView->setModel(mCollectionFilter);
- connect(mFolderView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(slotUpdateButtons()));
+ connect(mFolderView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &KNoteCollectionConfigWidget::slotUpdateButtons);
QHBoxLayout *hbox = new QHBoxLayout;
vbox->addLayout(hbox);
@@ -154,7 +154,7 @@ KNoteCollectionConfigWidget::KNoteCollectionConfigWidget(QWidget *parent)
manageAccountWidget->setCapabilityFilter(QStringList() << QStringLiteral("Resource")); // show only resources, no agents
tabWidget->addTab(accountWidget, i18n("Accounts"));
- QTimer::singleShot(1000, this, SLOT(slotUpdateCollectionStatus()));
+ QTimer::singleShot(1000, this, &KNoteCollectionConfigWidget::slotUpdateCollectionStatus);
slotUpdateButtons();
}
diff --git a/knotes/kontactplugin/kcmknotessummary.cpp b/knotes/kontactplugin/kcmknotessummary.cpp
index d7b8d5b..b964bb9 100644
--- a/knotes/kontactplugin/kcmknotessummary.cpp
+++ b/knotes/kontactplugin/kcmknotessummary.cpp
@@ -50,8 +50,8 @@ KCMKNotesSummary::KCMKNotesSummary(QWidget *parent)
{
initGUI();
- connect(mCheckedCollectionWidget->folderTreeView(), SIGNAL(clicked(QModelIndex)),
- SLOT(modified()));
+ connect(mCheckedCollectionWidget->folderTreeView(), &QAbstractItemView::clicked,
+ this, &KCMKNotesSummary::modified);
KAcceleratorManager::manage(this);
diff --git a/knotes/kontactplugin/knotes_part.cpp b/knotes/kontactplugin/knotes_part.cpp
index 4b7e27b..96776ef 100644
--- a/knotes/kontactplugin/knotes_part.cpp
+++ b/knotes/kontactplugin/knotes_part.cpp
@@ -217,8 +217,8 @@ KNotesPart::KNotesPart(QObject *parent)
connect(mNoteTreeModel, &NoteShared::NotesAkonadiTreeModel::rowsInserted, this, &KNotesPart::slotRowInserted);
- connect(mNoteRecorder->changeRecorder(), SIGNAL(itemChanged(Akonadi::Item,QSet<QByteArray>)), SLOT(slotItemChanged(Akonadi::Item,QSet<QByteArray>)));
- connect(mNoteRecorder->changeRecorder(), SIGNAL(itemRemoved(Akonadi::Item)), SLOT(slotItemRemoved(Akonadi::Item)));
+ connect(mNoteRecorder->changeRecorder(), &Akonadi::Monitor::itemChanged, this, &KNotesPart::slotItemChanged);
+ connect(mNoteRecorder->changeRecorder(), &Akonadi::Monitor::itemRemoved, this, &KNotesPart::slotItemRemoved);
connect(mNoteRecorder->changeRecorder(), SIGNAL(collectionChanged(Akonadi::Collection,QSet<QByteArray>)), SLOT(slotCollectionChanged(Akonadi::Collection,QSet<QByteArray>)));
mSelectionModel = new QItemSelectionModel(mNoteTreeModel);
@@ -243,8 +243,8 @@ KNotesPart::KNotesPart(QObject *parent)
connect(mNotesWidget->notesView(), SIGNAL(itemDoubleClicked(QListWidgetItem*)),
this, SLOT(editNote(QListWidgetItem*)));
- connect(mNotesWidget->notesView(), SIGNAL(itemSelectionChanged()),
- this, SLOT(slotOnCurrentChanged()));
+ connect(mNotesWidget->notesView(), &QListWidget::itemSelectionChanged,
+ this, &KNotesPart::slotOnCurrentChanged);
slotOnCurrentChanged();
setWidget(mNotesWidget);
diff --git a/knotes/kontactplugin/summarywidget.cpp b/knotes/kontactplugin/summarywidget.cpp
index 08cf051..16149dc 100644
--- a/knotes/kontactplugin/summarywidget.cpp
+++ b/knotes/kontactplugin/summarywidget.cpp
@@ -86,8 +86,8 @@ KNotesSummaryWidget::KNotesSummaryWidget(KontactInterface::Plugin *plugin, QWidg
connect(mNoteTreeModel, &NoteShared::NotesAkonadiTreeModel::rowsInserted, this, &KNotesSummaryWidget::updateFolderList);
- connect(mNoteRecorder->changeRecorder(), SIGNAL(itemChanged(Akonadi::Item,QSet<QByteArray>)), SLOT(updateFolderList()));
- connect(mNoteRecorder->changeRecorder(), SIGNAL(itemRemoved(Akonadi::Item)), SLOT(updateFolderList()));
+ connect(mNoteRecorder->changeRecorder(), &Akonadi::Monitor::itemChanged, this, &KNotesSummaryWidget::updateFolderList);
+ connect(mNoteRecorder->changeRecorder(), &Akonadi::Monitor::itemRemoved, this, &KNotesSummaryWidget::updateFolderList);
mSelectionModel = new QItemSelectionModel(mNoteTreeModel);
mModelProxy = new KCheckableProxyModel(this);