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

const'ify variable/pointer

parent a6fcdf5d
Pipeline #78128 passed with stage
in 6 minutes and 36 seconds
......@@ -42,7 +42,7 @@ ArchiveDialog::ArchiveDialog(const Akonadi::ETMCalendar::Ptr &cal, Akonadi::Inci
setWindowTitle(i18nc("@title:window", "Archive/Delete Past Events and To-dos"));
auto mainLayout = new QVBoxLayout(this);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel, this);
mUser1Button = new QPushButton;
mUser1Button = new QPushButton(this);
buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ArchiveDialog::reject);
mUser1Button->setDefault(true);
......
......@@ -55,13 +55,13 @@ NoteEditDialog::NoteEditDialog(QWidget *parent)
hbox->setContentsMargins(0, 0, 0, 0);
hbox->setSpacing(2);
mNoteTitle = new QLineEdit;
mNoteTitle = new QLineEdit(this);
mNoteTitle->setClearButtonEnabled(true);
mNoteTitle->setObjectName(QStringLiteral("notetitle"));
mNoteTitle->setFocus();
connect(mNoteTitle, &QLineEdit::textChanged, this, &NoteEditDialog::slotUpdateButtons);
mCollectionCombobox = new Akonadi::CollectionComboBox(_k_noteEditStubModel);
mCollectionCombobox = new Akonadi::CollectionComboBox(_k_noteEditStubModel, this);
mCollectionCombobox->setAccessRightsFilter(Akonadi::Collection::CanCreateItem);
mCollectionCombobox->setMinimumWidth(250);
mCollectionCombobox->setMimeTypeFilter(QStringList() << Akonadi::NoteUtils::noteMimeType());
......
......@@ -30,10 +30,10 @@ using namespace CalendarSupport;
CalPrinter::CalPrinter(QWidget *parent, const Akonadi::ETMCalendar::Ptr &calendar, bool uniqItem)
: QObject(parent)
, mParent(parent)
, mConfig(new KConfig(QStringLiteral("calendar_printing.rc"), KConfig::SimpleConfig))
, mUniqItem(uniqItem)
{
mParent = parent;
mConfig = new KConfig(QStringLiteral("calendar_printing.rc"), KConfig::SimpleConfig);
init(calendar);
}
......
......@@ -66,8 +66,8 @@ protected:
private:
Akonadi::ETMCalendar::Ptr mCalendar;
QWidget *mParent = nullptr;
KConfig *mConfig = nullptr;
QWidget *const mParent;
KConfig *const mConfig;
const bool mUniqItem;
};
......
......@@ -75,12 +75,12 @@ bool UriHandler::process(const QString &uri)
const QString uid = QUrl::fromPercentEncoding(uri.toLatin1()).mid(11);
return startKOrganizer(QStringLiteral("akonadi://?item=%1").arg(uid));
} else if (uri.startsWith(QLatin1String("akonadi:"))) {
const QString mimeType = QUrlQuery(QUrl(uri)).queryItemValue(QStringLiteral("type"));
if (mimeType.toLower() == QLatin1String("message/rfc822")) {
const QString mimeType = QUrlQuery(QUrl(uri)).queryItemValue(QStringLiteral("type")).toLower();
if (mimeType == QLatin1String("message/rfc822")) {
return startKMail(uri);
} else if (mimeType.toLower() == QLatin1String("text/calendar")) {
} else if (mimeType == QLatin1String("text/calendar")) {
return startKOrganizer(uri);
} else if (mimeType.toLower() == QLatin1String("text/directory")) {
} else if (mimeType == QLatin1String("text/directory")) {
return startKAddressbook(uri);
}
} else { // no special URI, let KDE handle it
......
Supports Markdown
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