Commit 12ebe1b3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

const'ify pointer + use auto

parent 14efb8e6
Pipeline #77526 passed with stage
in 14 minutes and 21 seconds
......@@ -22,8 +22,8 @@
DateNavigatorContainer::DateNavigatorContainer(QWidget *parent)
: QFrame(parent)
, mNavigatorView(new KDateNavigator(this))
{
mNavigatorView = new KDateNavigator(this);
mNavigatorView->setWhatsThis(
i18n("<qt><p>Select the dates you want to "
"display in KOrganizer's main view here. Hold the "
......
......@@ -131,7 +131,7 @@ private:
*/
KDateNavigator *firstNavigatorForDate(const QDate &date) const;
KDateNavigator *mNavigatorView = nullptr;
KDateNavigator *const mNavigatorView;
Akonadi::ETMCalendar::Ptr mCalendar;
......
......@@ -27,8 +27,8 @@ using namespace KOrg;
SearchCollectionHelper::SearchCollectionHelper(QObject *parent)
: QObject(parent)
, mIdentityManager(KIdentityManagement::IdentityManager::self())
{
mIdentityManager = KIdentityManagement::IdentityManager::self();
setupSearchCollections();
connect(mIdentityManager, qOverload<>(&KIdentityManagement::IdentityManager::changed), this, &SearchCollectionHelper::updateOpenInvitation);
connect(mIdentityManager, qOverload<>(&KIdentityManagement::IdentityManager::changed), this, &SearchCollectionHelper::updateDeclinedInvitation);
......
......@@ -37,7 +37,7 @@ private:
void updateSearchCollection(Akonadi::Collection col, KCalendarCore::Attendee::PartStat status, const QString &name, const QString &displayName);
private:
KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
KIdentityManagement::IdentityManager *const mIdentityManager;
Akonadi::Collection mOpenInvitationCollection;
Akonadi::Collection mDeclineCollection;
};
......
......@@ -21,20 +21,20 @@ K_PLUGIN_CLASS_WITH_JSON(KCMApptSummary, "kcmapptsummary.json")
KCMApptSummary::KCMApptSummary(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
, mDaysButtonGroup(new QButtonGroup(this)) // krazy:exclude=tipsandthis
, mShowButtonGroup(new QButtonGroup(this)) // krazy:exclude=tipsandthis
, mGroupwareButtonGroup(new QButtonGroup(this)) // krazy:exclude=tipsandthis
{
setupUi(this);
mDaysButtonGroup = new QButtonGroup(this); // krazy:exclude=tipsandthis
mDaysButtonGroup->addButton(mDateTodayButton, 0);
mDaysButtonGroup->addButton(mDateMonthButton, 1);
mDaysButtonGroup->addButton(mDateRangeButton, 2);
mShowButtonGroup = new QButtonGroup(this); // krazy:exclude=tipsandthis
mShowButtonGroup->setExclusive(false);
mShowButtonGroup->addButton(mShowBirthdaysFromCal);
mShowButtonGroup->addButton(mShowAnniversariesFromCal);
mGroupwareButtonGroup = new QButtonGroup(this); // krazy:exclude=tipsandthis
mGroupwareButtonGroup->setExclusive(false);
mGroupwareButtonGroup->addButton(mShowMineOnly);
......
......@@ -29,8 +29,8 @@ private Q_SLOTS:
void customDaysChanged(int value);
private:
QButtonGroup *mDaysButtonGroup = nullptr;
QButtonGroup *mShowButtonGroup = nullptr;
QButtonGroup *mGroupwareButtonGroup = nullptr;
QButtonGroup *const mDaysButtonGroup;
QButtonGroup *const mShowButtonGroup;
QButtonGroup *const mGroupwareButtonGroup;
};
......@@ -40,6 +40,7 @@
KOrganizer::KOrganizer()
: KParts::MainWindow()
, KOrg::MainWindow()
, mCalendarView(new CalendarView(this))
{
// Set this to be the group leader for all subdialogs - this means
// modal subdialogs will only affect this dialog, not the other windows
......@@ -48,7 +49,6 @@ KOrganizer::KOrganizer()
KOCore::self()->addXMLGUIClient(this, this);
// setMinimumSize(600,400); // make sure we don't get resized too small...
mCalendarView = new CalendarView(this);
mCalendarView->setObjectName(QStringLiteral("KOrganizer::CalendarView"));
setCentralWidget(mCalendarView);
......
......@@ -102,7 +102,7 @@ protected:
void readProperties(const KConfigGroup &) override;
private:
CalendarView *mCalendarView = nullptr; // Main view widget
CalendarView *const mCalendarView; // Main view widget
KOrg::Part::List mParts; // List of parts loaded
ActionManager *mActionManager = nullptr;
......
......@@ -30,7 +30,7 @@ K_PLUGIN_CLASS_WITH_JSON(KOPrefsDialogColorsAndFonts, "korganizer_configcolorsan
KOPrefsDialogColorsAndFonts::KOPrefsDialogColorsAndFonts(QWidget *parent, const QVariantList &args)
: Korganizer::KPrefsModule(KOPrefs::instance(), parent, args)
{
QBoxLayout *topTopLayout = new QVBoxLayout(this);
auto topTopLayout = new QVBoxLayout(this);
auto tabWidget = new QTabWidget(this);
topTopLayout->addWidget(tabWidget);
......
......@@ -23,7 +23,7 @@ K_PLUGIN_CLASS_WITH_JSON(KOPrefsDialogGroupScheduling, "korganizer_configgroupsc
KOPrefsDialogGroupScheduling::KOPrefsDialogGroupScheduling(QWidget *parent, const QVariantList &args)
: Korganizer::KPrefsModule(KOPrefs::instance(), parent, args)
{
QBoxLayout *topTopLayout = new QVBoxLayout(this);
auto topTopLayout = new QVBoxLayout(this);
auto topFrame = new QWidget(this);
topTopLayout->addWidget(topFrame);
......
......@@ -20,8 +20,8 @@ K_PLUGIN_CLASS_WITH_JSON(KOPrefsDialogGroupwareScheduling, "korganizer_configfre
KOPrefsDialogGroupwareScheduling::KOPrefsDialogGroupwareScheduling(QWidget *parent, const QVariantList &args)
: KPrefsModule(CalendarSupport::KCalPrefs::instance(), parent, args)
, mGroupwarePage(new Ui::KOGroupwarePrefsPage())
{
mGroupwarePage = new Ui::KOGroupwarePrefsPage();
auto widget = new QWidget(this);
widget->setObjectName(QStringLiteral("KOGrouparePrefsPage"));
......@@ -97,4 +97,4 @@ void KOPrefsDialogGroupwareScheduling::usrWriteConfig()
Akonadi::CalendarSettings::self()->save();
}
#include "koprefsdialoggroupwarescheduling.moc"
\ No newline at end of file
#include "koprefsdialoggroupwarescheduling.moc"
......@@ -26,6 +26,6 @@ protected:
void usrReadConfig() override;
private:
Ui::KOGroupwarePrefsPage *mGroupwarePage = nullptr;
Ui::KOGroupwarePrefsPage *const mGroupwarePage;
};
......@@ -29,7 +29,7 @@ K_PLUGIN_CLASS_WITH_JSON(KOPrefsDialogMain, "korganizer_configmain.json")
KOPrefsDialogMain::KOPrefsDialogMain(QWidget *parent, const QVariantList &args)
: KPrefsModule(KOPrefs::instance(), parent, args)
{
QBoxLayout *topTopLayout = new QVBoxLayout(this);
auto topTopLayout = new QVBoxLayout(this);
auto tabWidget = new QTabWidget(this);
topTopLayout->addWidget(tabWidget);
......
......@@ -55,7 +55,7 @@ K_PLUGIN_CLASS_WITH_JSON(KOPrefsDialogPlugins, "korganizer_configplugins.json")
KOPrefsDialogPlugins::KOPrefsDialogPlugins(QWidget *parent, const QVariantList &args)
: KPrefsModule(KOPrefs::instance(), parent, args)
{
QBoxLayout *topTopLayout = new QVBoxLayout(this);
auto topTopLayout = new QVBoxLayout(this);
mTreeWidget = new QTreeWidget(this);
mTreeWidget->setColumnCount(1);
mTreeWidget->setHeaderLabel(i18nc("@title:column plugin name", "Name"));
......
......@@ -30,7 +30,7 @@ KOPrefsDialogViews::KOPrefsDialogViews(QWidget *parent, const QVariantList &args
, mMonthIconComboBox(new KItemIconCheckCombo(KItemIconCheckCombo::MonthType, this))
, mAgendaIconComboBox(new KItemIconCheckCombo(KItemIconCheckCombo::AgendaType, this))
{
QBoxLayout *topTopLayout = new QVBoxLayout(this);
auto topTopLayout = new QVBoxLayout(this);
auto tabWidget = new QTabWidget(this);
topTopLayout->addWidget(tabWidget);
......
......@@ -23,6 +23,7 @@ K_PLUGIN_CLASS_WITH_JSON(KOPrefsUserFeedBack, "korganizer_userfeedback.json")
KOPrefsUserFeedBack::KOPrefsUserFeedBack(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
, mUserFeedbackWidget(new KUserFeedback::FeedbackConfigWidget(this))
{
auto about = new KAboutData(QStringLiteral("KCMUserFeedBack"),
i18n("KCMUserFeedBack"),
......@@ -35,7 +36,6 @@ KOPrefsUserFeedBack::KOPrefsUserFeedBack(QWidget *parent, const QVariantList &ar
auto layout = new QVBoxLayout(this);
layout->setContentsMargins({});
mUserFeedbackWidget = new KUserFeedback::FeedbackConfigWidget(this);
connect(mUserFeedbackWidget, &KUserFeedback::FeedbackConfigWidget::configurationChanged, this, &KOPrefsUserFeedBack::markAsChanged);
layout->addWidget(mUserFeedbackWidget);
......
......@@ -26,7 +26,7 @@ protected:
void save() override;
private:
KUserFeedback::FeedbackConfigWidget *mUserFeedbackWidget = nullptr;
KUserFeedback::FeedbackConfigWidget *const mUserFeedbackWidget;
};
#endif
......@@ -22,13 +22,13 @@
KDateNavigator::KDateNavigator(QWidget *parent)
: QFrame(parent)
, mNavigatorBar(new NavigatorBar(this))
, mBaseDate(1970, 1, 1)
{
auto topLayout = new QGridLayout(this);
topLayout->setContentsMargins({});
topLayout->setSpacing(0);
mNavigatorBar = new NavigatorBar(this);
topLayout->addWidget(mNavigatorBar, 0, 0, 1, 8);
connect(mNavigatorBar, &NavigatorBar::prevYearClicked, this, &KDateNavigator::prevYearClicked);
......
......@@ -101,7 +101,7 @@ protected:
private:
void selectMonthHelper(int monthDifference);
NavigatorBar *mNavigatorBar = nullptr;
NavigatorBar *const mNavigatorBar;
QLabel *mHeadings[7];
QLabel *mWeeknos[7];
......
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