Commit bb94f2a4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some cppcheck warnings

parent 8b0d1ff7
Pipeline #83656 passed with stage
in 9 minutes and 28 seconds
......@@ -134,8 +134,8 @@ void CreateNewNoteJob::slotFetchCollection(KJob *job)
== KMessageBox::warningYesNo(nullptr,
i18n("Collection is hidden. New note will be stored but not displayed. Do you want to show collection?"))) {
col.addAttribute(new NoteShared::ShowFolderNotesAttribute());
auto job = new Akonadi::CollectionModifyJob(col);
connect(job, &Akonadi::CollectionModifyJob::result, this, &CreateNewNoteJob::slotCollectionModifyFinished);
auto modifyJob = new Akonadi::CollectionModifyJob(col);
connect(modifyJob, &Akonadi::CollectionModifyJob::result, this, &CreateNewNoteJob::slotCollectionModifyFinished);
}
}
Akonadi::Item newItem;
......@@ -173,8 +173,8 @@ void CreateNewNoteJob::slotFetchCollection(KJob *job)
eda->setIconName(QStringLiteral("text-plain"));
newItem.addAttribute(eda);
auto job = new Akonadi::ItemCreateJob(newItem, col, this);
connect(job, &Akonadi::ItemCreateJob::result, this, &CreateNewNoteJob::slotNoteCreationFinished);
auto createJob = new Akonadi::ItemCreateJob(newItem, col, this);
connect(createJob, &Akonadi::ItemCreateJob::result, this, &CreateNewNoteJob::slotNoteCreationFinished);
} else {
deleteLater();
}
......
......@@ -241,9 +241,9 @@ void KNotesApp::slotDeleteSelectedNotes()
}
dlg->setNotes(lst);
if (dlg->exec()) {
const Akonadi::Item::List lst = dlg->selectedNotes();
if (!lst.isEmpty()) {
auto deleteJob = new Akonadi::ItemDeleteJob(lst, this);
const Akonadi::Item::List lstItem = dlg->selectedNotes();
if (!lstItem.isEmpty()) {
auto deleteJob = new Akonadi::ItemDeleteJob(lstItem, this);
connect(deleteJob, &KJob::result, this, &KNotesApp::slotNoteDeleteFinished);
}
}
......
......@@ -417,16 +417,16 @@ void KNotesPart::killSelectedNotes()
}
QPointer<KNotesSelectDeleteNotesDialog> dlg = new KNotesSelectDeleteNotesDialog(items, widget());
if (dlg->exec()) {
Akonadi::Item::List lst;
Akonadi::Item::List lstItem;
QListIterator<KNotesIconViewItem *> kniviIt(items);
while (kniviIt.hasNext()) {
KNotesIconViewItem *iconViewIcon = kniviIt.next();
if (!iconViewIcon->readOnly()) {
lst.append(iconViewIcon->item());
lstItem.append(iconViewIcon->item());
}
}
if (!lst.isEmpty()) {
auto job = new Akonadi::ItemDeleteJob(lst);
if (!lstItem.isEmpty()) {
auto job = new Akonadi::ItemDeleteJob(lstItem);
connect(job, &Akonadi::ItemDeleteJob::result, this, &KNotesPart::slotDeleteNotesFinished);
}
}
......
......@@ -35,10 +35,9 @@
KNotesSummaryWidget::KNotesSummaryWidget(KontactInterface::Plugin *plugin, QWidget *parent)
: KontactInterface::Summary(parent)
, mDefaultPixmap(KIconLoader::global()->loadIcon(QStringLiteral("knotes"), KIconLoader::Desktop))
, mPlugin(plugin)
, mInProgress(false)
{
mDefaultPixmap = KIconLoader::global()->loadIcon(QStringLiteral("knotes"), KIconLoader::Desktop);
auto mainLayout = new QVBoxLayout(this);
mainLayout->setSpacing(3);
mainLayout->setContentsMargins(3, 3, 3, 3);
......
......@@ -721,8 +721,8 @@ void KNote::createActions()
actionCollection()->addAssociatedWidget(this);
const auto lst = actionCollection()->actions();
for (QAction *action : lst) {
action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
for (QAction *act : lst) {
act->setShortcutContext(Qt::WidgetWithChildrenShortcut);
}
if (mAllowDebugAkonadiSearch) {
// Don't translate it it's just for debugging
......
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