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

Modernize code

parent 160fa697
Pipeline #33665 passed with stage
in 36 minutes and 43 seconds
......@@ -60,8 +60,8 @@ private:
void writeConfig();
void updateMatchesText();
Ui::SearchDialog *m_ui = nullptr;
CalendarView *m_calendarview = nullptr; // parent
Ui::SearchDialog *const m_ui;
CalendarView *const m_calendarview; // parent
KOEventPopupMenu *m_popupMenu = nullptr;
Akonadi::Item::List mMatchedEvents;
EventViews::ListView *listView = nullptr;
......
......@@ -81,7 +81,7 @@ public Q_SLOTS:
Q_REQUIRED_RESULT bool handleCommandLine(const QStringList &args);
private:
ActionManager *mActionManager = nullptr;
ActionManager *const mActionManager;
};
#endif // KORGANIZER_SHARED_H
......@@ -40,7 +40,6 @@ public:
PageItem(QTreeWidget *parent, const QString &path)
: QTreeWidgetItem(parent)
, mPath(path)
, mIsActive(false)
{
setFlags(flags() | Qt::ItemIsUserCheckable);
setCheckState(0, Qt::Unchecked);
......@@ -122,9 +121,9 @@ public:
private:
QString mName;
QString mPath;
const QString mPath;
QPixmap mPreview;
bool mIsActive;
bool mIsActive = false;
};
KCMDesignerFields::KCMDesignerFields(QWidget *parent, const QVariantList &args)
......
......@@ -39,7 +39,6 @@ const int KODayMatrix::NUMDAYS = 42;
KODayMatrix::KODayMatrix(QWidget *parent)
: QFrame(parent)
, mStartDate()
, mPendingChanges(false)
{
// initialize dynamic arrays
mDays = new QDate[NUMDAYS];
......
......@@ -68,7 +68,7 @@ private:
class DialogManagerVisitor;
class EditorDialogVisitor;
CalendarView *mMainView = nullptr;
CalendarView *const mMainView;
KCMultiDialog *mOptionsDialog = nullptr;
QPointer<Akonadi::TagManagementDialog> mCategoryEditDialog;
SearchDialog *mSearchDialog = nullptr;
......
......@@ -169,7 +169,7 @@ private Q_SLOTS:
private:
QWidget *widgetForView(KOrg::BaseView *) const;
QList<KOrg::BaseView *> mViews;
CalendarView *mMainView = nullptr;
CalendarView *const mMainView;
KOAgendaView *mAgendaView = nullptr;
KOrg::MultiAgendaView *mAgendaSideBySideView = nullptr;
......
......@@ -13,7 +13,6 @@
KOWindowList::KOWindowList()
: QObject(nullptr)
, mDefaultWindow(nullptr)
{
}
......
......@@ -13,12 +13,12 @@
#include "korganizer_options.h"
#include "korganizer_debug.h"
#include "korgmigrateapplication.h"
#include <KLocalizedString>
#include <KCrash>
#ifdef WITH_KUSERFEEDBACK
#include "userfeedback/korganizeruserfeedbackprovider.h"
#endif
#include <KLocalizedString>
#include <KCrash>
int main(int argc, char **argv)
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
......
......@@ -30,7 +30,7 @@ private:
void slotCollectionPropertiesFinished(KJob *job);
QHash<Akonadi::Collection::Id, QPointer<Akonadi::CollectionPropertiesDialog> > mHashDialogBox;
QStringList mPages;
AkonadiCollectionView *mCollectionView = nullptr;
AkonadiCollectionView *const mCollectionView;
};
#endif // MANAGESHOWCOLLECTIONPROPERTIES_H
......@@ -23,7 +23,7 @@ public:
delete prefs;
}
KOPrefs *prefs = nullptr;
KOPrefs *const prefs;
};
Q_GLOBAL_STATIC(KOPrefsPrivate, sInstance)
......
......@@ -26,13 +26,13 @@ class PluginItem : public QTreeWidgetItem
{
public:
PluginItem(QTreeWidget *parent, const KService::Ptr &service)
: QTreeWidgetItem(parent, QStringList(service->name()))
: QTreeWidgetItem(parent, {service->name()})
, mService(service)
{
}
PluginItem(QTreeWidgetItem *parent, const KService::Ptr &service)
: QTreeWidgetItem(parent, QStringList(service->name()))
: QTreeWidgetItem(parent, {service->name()})
, mService(service)
{
}
......@@ -43,7 +43,7 @@ public:
}
private:
KService::Ptr mService;
const KService::Ptr mService;
};
/**
......
......@@ -28,8 +28,8 @@ public:
private:
void slotConfigChanged();
private:
KItemIconCheckCombo *mMonthIconComboBox = nullptr;
KItemIconCheckCombo *mAgendaIconComboBox = nullptr;
KItemIconCheckCombo *const mMonthIconComboBox;
KItemIconCheckCombo *const mAgendaIconComboBox;
QCheckBox *mEnableToolTipsCheckBox = nullptr;
QCheckBox *mTodosUseCategoryColorsCheckBox = nullptr;
QCheckBox *mRecordTodosInJournalsCheckBox = nullptr;
......
......@@ -9,8 +9,8 @@
UserFeedBackManager::UserFeedBackManager(QObject *parent)
: QObject(parent)
, mUserFeedbackProvider(new KOrganizerUserFeedbackProvider(this))
{
mUserFeedbackProvider = new KOrganizerUserFeedbackProvider(this);
}
UserFeedBackManager *UserFeedBackManager::self()
......
......@@ -22,7 +22,7 @@ public:
KUserFeedback::Provider *userFeedbackProvider() const;
private:
KUserFeedback::Provider *mUserFeedbackProvider = nullptr;
KUserFeedback::Provider *const mUserFeedbackProvider;
};
#endif // USERFEEDBACKMANAGER_H
......@@ -32,7 +32,6 @@ Quickview::Quickview(const Akonadi::Collection &col)
: QDialog()
, mUi(new Ui_quickview)
, mCollection(col)
, mDayRange(7)
{
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
QWidget *mainWidget = new QWidget(this);
......
......@@ -34,9 +34,9 @@ private:
void readConfig();
void writeConfig();
Ui_quickview *mUi = nullptr;
Ui_quickview *const mUi;
EventViews::AgendaView *mAgendaView = nullptr;
Akonadi::Collection mCollection;
const Akonadi::Collection mCollection;
int mDayRange = 7;
};
......
......@@ -16,14 +16,14 @@
*/
ReparentingModel::Node::Node(ReparentingModel &model)
: parent(nullptr)
: parent(nullptr)
, personModel(model)
, mIsSourceNode(false)
{
}
ReparentingModel::Node::Node(ReparentingModel &model, ReparentingModel::Node *p, const QModelIndex &srcIndex)
: sourceIndex(srcIndex)
: sourceIndex(srcIndex)
, parent(p)
, personModel(model)
, mIsSourceNode(true)
......
......@@ -29,7 +29,7 @@ public:
Q_REQUIRED_RESULT QSet<EventViews::EventView::ItemIcon> checkedIcons() const;
private:
KItemIconCheckCombo::ViewType mViewType;
const KItemIconCheckCombo::ViewType mViewType;
};
#endif // KITEMICONCHECKCOMBO_H
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