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

Const'ify pointer/variable

parent 12ef9cbc
Pipeline #33397 passed with stage
in 22 minutes and 35 seconds
......@@ -53,8 +53,8 @@ private:
void fillCombo();
private:
Ui::AlarmDialog *mUi = nullptr;
KCalendarCore::Incidence::IncidenceType mIncidenceType;
Ui::AlarmDialog *const mUi;
const KCalendarCore::Incidence::IncidenceType mIncidenceType;
bool mAllowBeginReminders = true;
bool mAllowEndReminders = true;
};
......
......@@ -43,7 +43,7 @@ private:
KCalendarCore::Attachment mAttachment;
AttachmentIconItem *mItem = nullptr;
QMimeType mMimeType;
Ui::AttachmentEditDialog *mUi = nullptr;
Ui::AttachmentEditDialog *const mUi;
QPushButton *mOkButton = nullptr;
};
}
......
......@@ -118,7 +118,7 @@ QPixmap AttachmentIconItem::icon() const
QPixmap AttachmentIconItem::icon(const QMimeType &mimeType, const QString &uri, bool binary)
{
QString iconStr = mimeType.iconName();
const QString iconStr = mimeType.iconName();
QStringList overlays;
if (!uri.isEmpty() && !binary) {
overlays << QStringLiteral("emblem-link");
......
......@@ -19,7 +19,6 @@ using namespace IncidenceEditorNG;
AttendeeComboBoxDelegate::AttendeeComboBoxDelegate(QObject *parent)
: QStyledItemDelegate(parent)
, mStandardIndex(0)
{
connect(this, &AttendeeComboBoxDelegate::closeEditor, this,
&AttendeeComboBoxDelegate::doCloseEditor);
......
......@@ -56,7 +56,7 @@ private:
QString mToolTip;
QString mWhatsThis;
/**fallback index */
int mStandardIndex;
int mStandardIndex = 0;
};
}
......
......@@ -27,7 +27,6 @@ typedef QPair<QString, QIcon> TextIconPair;
AttendeeComboBox::AttendeeComboBox(QWidget *parent)
: QToolButton(parent)
, mMenu(new QMenu(this))
, mCurrentIndex(-1)
{
setPopupMode(QToolButton::InstantPopup);
setToolButtonStyle(Qt::ToolButtonIconOnly);
......
......@@ -49,7 +49,7 @@ private:
void slotActionTriggered();
QMenu *mMenu = nullptr;
QVector<QPair<QString, QIcon> > mList;
int mCurrentIndex;
int mCurrentIndex = -1;
};
class AttendeeLineEdit : public PimCommon::AddresseeLineEdit
......
......@@ -49,7 +49,7 @@ Q_SIGNALS:
private:
QStringList mCategoryList;
CategorySelectWidgetBase *mWidgets = nullptr;
CalendarSupport::CategoryConfig *mCategoryConfig = nullptr;
CalendarSupport::CategoryConfig * const mCategoryConfig;
};
class CategorySelectDialog : public QDialog
......
......@@ -15,7 +15,6 @@ using namespace IncidenceEditorNG;
CombinedIncidenceEditor::CombinedIncidenceEditor(QWidget *parent)
: IncidenceEditor(parent)
, mDirtyEditorCount(0)
{
}
......
......@@ -55,7 +55,7 @@ Q_SIGNALS:
private:
void handleDirtyStatusChange(bool isDirty);
QVector<IncidenceEditor *> mCombinedEditors;
int mDirtyEditorCount;
int mDirtyEditorCount = 0;
};
}
......
......@@ -44,7 +44,7 @@ private:
QString stringForAlarm(const KCalendarCore::Alarm::Ptr &alarm);
private:
Ui::EventOrTodoDesktop *mUi = nullptr;
Ui::EventOrTodoDesktop *const mUi;
KCalendarCore::Alarm::List mAlarms;
IncidenceDateTime *mDateTime = nullptr;
......
......@@ -70,7 +70,7 @@ private:
private:
AttachmentIconView *mAttachmentView = nullptr;
Ui::EventOrTodoDesktop *mUi = nullptr;
Ui::EventOrTodoDesktop *const mUi;
QMenu *mPopupMenu = nullptr;
QAction *mOpenAction = nullptr;
......
......@@ -43,7 +43,6 @@ using namespace IncidenceEditorNG;
IncidenceAttendee::IncidenceAttendee(QWidget *parent, IncidenceDateTime *dateTime, Ui::EventOrTodoDesktop *ui)
: mUi(ui)
, mParentWidget(parent)
, mConflictResolver(nullptr)
, mDateTime(dateTime)
, mStateDelegate(new AttendeeComboBoxDelegate(this))
, mRoleDelegate(new AttendeeComboBoxDelegate(this))
......
......@@ -127,7 +127,7 @@ private:
/** used dataModel to rely on*/
AttendeeTableModel *mDataModel = nullptr;
AttendeeLineEditDelegate *mAttendeeDelegate = nullptr;
AttendeeComboBoxDelegate *mStateDelegate = nullptr;
AttendeeComboBoxDelegate *const mStateDelegate;
AttendeeComboBoxDelegate *mRoleDelegate = nullptr;
AttendeeComboBoxDelegate *mResponseDelegate = nullptr;
......
......@@ -112,8 +112,8 @@ protected:
protected:
KCalendarCore::Incidence::Ptr mLoadedIncidence;
mutable QString mLastErrorString;
bool mWasDirty;
bool mLoadingIncidence;
bool mWasDirty = false;
bool mLoadingIncidence = false;
};
} // IncidenceEditorNG
......
......@@ -13,8 +13,6 @@ using namespace IncidenceEditorNG;
IncidenceEditor::IncidenceEditor(QObject *parent)
: QObject(parent)
, mWasDirty(false)
, mLoadingIncidence(false)
{
}
......
......@@ -24,8 +24,6 @@ IndividualMessageQueueJob::IndividualMessageQueueJob(const KIdentityManagement::
, mUpdate(update)
, mEdit(edit)
, mIdentity(identity)
, mQueueJob(nullptr)
, mComposerJob(nullptr)
{
}
......
......@@ -27,9 +27,9 @@ public:
private:
QString mDBusService;
QString mError;
QString mTo, mCc, mBcc;
KMime::Message::Ptr mMessage;
KIdentityManagement::Identity mIdentity;
const QString mTo, mCc, mBcc;
const KMime::Message::Ptr mMessage;
const KIdentityManagement::Identity mIdentity;
};
}
#endif
......@@ -14,7 +14,6 @@ using namespace IncidenceEditorNG;
ResourceModel::ResourceModel(const QStringList &headers, QObject *parent)
: QAbstractItemModel(parent)
, foundCollection(false)
{
this->headers = headers;
rootItem = ResourceItem::Ptr(new ResourceItem(KLDAP::LdapDN(), headers, KLDAP::LdapClient(0)));
......
......@@ -92,7 +92,7 @@ private:
/* Is the search of collections ended
*
*/
bool foundCollection;
bool foundCollection = false;
/* List of all attributes in LDAP an the headers of the model
*
......
......@@ -56,7 +56,7 @@ private:
int mDuration; //!< In seconds
ConflictResolver *mResolver = nullptr;
CalendarSupport::FreePeriodModel *mPeriodModel = nullptr;
CalendarSupport::FreePeriodModel *const mPeriodModel;
VisualFreeBusyWidget *mVisualWidget = nullptr;
};
}
......
......@@ -26,7 +26,6 @@ TemplateManagementDialog::TemplateManagementDialog(
: QDialog(parent)
, m_templates(templates)
, m_type(incidenceType)
, m_changed(false)
{
QString m_type_translated = i18n(qPrintable(m_type));
setWindowTitle(i18nc("@title:window", "Manage %1 Templates", m_type_translated));
......
......@@ -52,7 +52,7 @@ private:
QStringList m_templates;
QString m_type;
QString m_newTemplate;
bool m_changed;
bool m_changed = false;
};
}
......
......@@ -125,8 +125,6 @@ public:
VisualFreeBusyWidget::VisualFreeBusyWidget(CalendarSupport::FreeBusyItemModel *model, int spacing, QWidget *parent)
: QWidget(parent)
, mGanttGrid(nullptr)
, mScaleCombo(nullptr)
{
QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setSpacing(spacing);
......
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