Commit 4d953bb8 authored by Laurent Montel's avatar Laurent Montel 😁

Initialize variables

parent d59d3b13
......@@ -126,19 +126,19 @@ private:
void showDetails(QTreeWidgetItem *item);
Akonadi::ETMCalendar::Ptr mCalendar;
QTreeWidget *mIncidenceTree;
CalendarSupport::IncidenceViewer *mDetailView;
KIdentityManagement::IdentityManager *mIdentityManager;
QTreeWidget *mIncidenceTree = nullptr;
CalendarSupport::IncidenceViewer *mDetailView = nullptr;
KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
QPoint mPos;
QSpinBox *mSuspendSpin;
KComboBox *mSuspendUnit;
QSpinBox *mSuspendSpin = nullptr;
KComboBox *mSuspendUnit = nullptr;
QTimer mSuspendTimer;
QTreeWidgetItem *mLastItem;
QPushButton *mUser1Button;
QPushButton *mUser2Button;
QPushButton *mUser3Button;
QPushButton *mOkButton;
QTreeWidgetItem *mLastItem = nullptr;
QPushButton *mUser1Button = nullptr;
QPushButton *mUser2Button = nullptr;
QPushButton *mUser3Button = nullptr;
QPushButton *mOkButton = nullptr;
};
......
......@@ -61,12 +61,12 @@ private:
QIcon mIconDisabled;
QString mName;
QAction *mAlarmsEnabled;
QAction *mAutostart;
QAction *mSuspendAll;
QAction *mDismissAll;
QAction *mAlarmsEnabled = nullptr;
QAction *mAutostart = nullptr;
QAction *mSuspendAll = nullptr;
QAction *mDismissAll = nullptr;
bool mAutostartSet;
bool mAutostartSet = false;
};
#endif
......@@ -74,14 +74,14 @@ private:
const QDateTime &dt, const QString &displayText);
void saveLastCheckTime();
AlarmDockWindow *mDocker; // the panel icon
AlarmDockWindow *mDocker = nullptr; // the panel icon
Akonadi::ETMCalendar::Ptr mCalendar;
Akonadi::EntityTreeModel *mETM;
Akonadi::EntityTreeModel *mETM = nullptr;
QDateTime mLastChecked;
QTimer mCheckTimer;
AlarmDialog *mDialog;
AlarmDialog *mDialog = nullptr;
};
#endif
......@@ -239,7 +239,7 @@ void ActionManager::createCalendarAkonadi()
void ActionManager::initActions()
{
QAction *action;
QAction *action = nullptr;
/*************************** FILE MENU **********************************/
......@@ -306,7 +306,7 @@ void ActionManager::initActions()
/************************** EDIT MENU *********************************/
QAction *pasteAction;
QAction *pasteAction = nullptr;
Akonadi::History *history = mCalendarView->history();
if (mIsPart) {
// edit menu
......@@ -1326,9 +1326,9 @@ protected:
}
return true;
}
QAction *mShow;
QAction *mEdit;
QAction *mDelete;
QAction *mShow = nullptr;
QAction *mEdit = nullptr;
QAction *mDelete = nullptr;
};
void ActionManager::processIncidenceSelection(const Akonadi::Item &item, const QDate &date)
......
......@@ -328,61 +328,61 @@ private:
QString mFile; // Local name of calendar file
QString mLastUrl; // URL of last loaded calendar.
QTemporaryFile *mTempFile;
QTimer *mAutoExportTimer; // used if calendar is to be autoexported
QTimer *mAutoArchiveTimer; // used for the auto-archiving feature
QTemporaryFile *mTempFile = nullptr;
QTimer *mAutoExportTimer = nullptr; // used if calendar is to be autoexported
QTimer *mAutoArchiveTimer = nullptr; // used for the auto-archiving feature
// list of all existing KOrganizer instances
static KOWindowList *mWindowList;
KToggleAction *mDateNavigatorShowAction;
KToggleAction *mTodoViewShowAction;
KToggleAction *mCollectionViewShowAction;
KToggleAction *mEventViewerShowAction;
KToggleAction *mDateNavigatorShowAction = nullptr;
KToggleAction *mTodoViewShowAction = nullptr;
KToggleAction *mCollectionViewShowAction = nullptr;
KToggleAction *mEventViewerShowAction = nullptr;
KToggleAction *mHideMenuBarAction;
KToggleAction *mHideMenuBarAction = nullptr;
QAction *mImportAction;
QAction *mImportAction = nullptr;
QAction *mNewEventAction;
QAction *mNewTodoAction;
QAction *mNewSubtodoAction;
QAction *mNewJournalAction;
QAction *mConfigureViewAction;
QAction *mNewEventAction = nullptr;
QAction *mNewTodoAction = nullptr;
QAction *mNewSubtodoAction = nullptr;
QAction *mNewJournalAction = nullptr;
QAction *mConfigureViewAction = nullptr;
QAction *mShowIncidenceAction;
QAction *mEditIncidenceAction;
QAction *mDeleteIncidenceAction;
QAction *mShowIncidenceAction = nullptr;
QAction *mEditIncidenceAction = nullptr;
QAction *mDeleteIncidenceAction = nullptr;
QAction *mCutAction;
QAction *mCopyAction;
QAction *mDeleteAction;
QAction *mNextXDays;
QAction *mPublishEvent;
QAction *mForwardEvent;
QAction *mCutAction = nullptr;
QAction *mCopyAction = nullptr;
QAction *mDeleteAction = nullptr;
QAction *mNextXDays = nullptr;
QAction *mPublishEvent = nullptr;
QAction *mForwardEvent = nullptr;
QAction *mSendInvitation;
QAction *mSendCancel;
QAction *mSendStatusUpdate;
QAction *mSendInvitation = nullptr;
QAction *mSendCancel = nullptr;
QAction *mSendStatusUpdate = nullptr;
QAction *mRequestChange;
QAction *mRequestUpdate;
QAction *mRequestChange = nullptr;
QAction *mRequestUpdate = nullptr;
QAction *mUndoAction;
QAction *mRedoAction;
QMenuBar *mMenuBar;
QAction *mUndoAction = nullptr;
QAction *mRedoAction = nullptr;
QMenuBar *mMenuBar = nullptr;
KSelectAction *mFilterAction;
KSelectAction *mFilterAction = nullptr;
KXMLGUIClient *mGUIClient;
KActionCollection *mACollection;
CalendarView *mCalendarView;
KOrg::MainWindow *mMainWindow;
KXMLGUIClient *mGUIClient = nullptr;
KActionCollection *mACollection = nullptr;
CalendarView *mCalendarView = nullptr;
KOrg::MainWindow *mMainWindow = nullptr;
bool mIsPart;
AkonadiCollectionView *mCollectionView;
KViewStateMaintainer<Akonadi::ETMViewStateSaver> *mCollectionViewStateSaver;
KViewStateMaintainer<Akonadi::ETMViewStateSaver> *mCollectionSelectionModelStateSaver;
AkonadiCollectionView *mCollectionView = nullptr;
KViewStateMaintainer<Akonadi::ETMViewStateSaver> *mCollectionViewStateSaver = nullptr;
KViewStateMaintainer<Akonadi::ETMViewStateSaver> *mCollectionSelectionModelStateSaver = nullptr;
};
#endif
......@@ -78,7 +78,7 @@
static Akonadi::EntityTreeModel *findEtm(QAbstractItemModel *model)
{
QAbstractProxyModel *proxyModel;
QAbstractProxyModel *proxyModel = nullptr;
while (model) {
proxyModel = qobject_cast<QAbstractProxyModel *>(model);
if (proxyModel && proxyModel->sourceModel()) {
......@@ -128,7 +128,7 @@ private Q_SLOTS:
}
private:
QAbstractItemModel *mCheckableProxy;
QAbstractItemModel *mCheckableProxy = nullptr;
};
/**
......@@ -236,8 +236,8 @@ private:
}
QPointer<Akonadi::ETMViewStateSaver> treeStateRestorer;
QTreeView *mTreeView;
bool mExpandAll;
QTreeView *mTreeView = nullptr;
bool mExpandAll = false;
QString mTreeStateConfig;
};
......
......@@ -61,8 +61,8 @@ public:
CalendarViewExtension *create(QWidget *) override;
private:
CalendarView *mView;
AkonadiCollectionView *mAkonadiCollectionView;
CalendarView *mView = nullptr;
AkonadiCollectionView *mAkonadiCollectionView = nullptr;
};
class NewNodeExpander;
......@@ -113,21 +113,21 @@ private Q_SLOTS:
private:
Akonadi::EntityTreeModel *entityTreeModel() const;
Akonadi::StandardCalendarActionManager *mActionManager;
Akonadi::EntityTreeView *mCollectionView;
QStackedWidget *mStackedWidget;
QAbstractProxyModel *mBaseModel;
KCheckableProxyModel *mSelectionProxyModel;
QAction *mAssignColor;
QAction *mDisableColor;
QAction *mDefaultCalendar;
QAction *mServerSideSubscription;
Akonadi::StandardCalendarActionManager *mActionManager = nullptr;
Akonadi::EntityTreeView *mCollectionView = nullptr;
QStackedWidget *mStackedWidget = nullptr;
QAbstractProxyModel *mBaseModel = nullptr;
KCheckableProxyModel *mSelectionProxyModel = nullptr;
QAction *mAssignColor = nullptr;
QAction *mDisableColor = nullptr;
QAction *mDefaultCalendar = nullptr;
QAction *mServerSideSubscription = nullptr;
bool mNotSendAddRemoveSignal;
bool mWasDefaultCalendar;
bool mHasContextMenu;
Controller *mController;
NewNodeExpander *mNewNodeExpander;
ManageShowCollectionProperties *mManagerShowCollectionProperties;
Controller *mController = nullptr;
NewNodeExpander *mNewNodeExpander = nullptr;
ManageShowCollectionProperties *mManagerShowCollectionProperties = nullptr;
};
#endif
......@@ -112,7 +112,7 @@ public:
class CalendarViewVisitor : public KCalCore::Visitor
{
public:
CalendarViewVisitor() : mView(nullptr)
CalendarViewVisitor()
{
}
......@@ -123,7 +123,7 @@ public:
}
protected:
CalendarView *mView;
CalendarView *mView = nullptr;
};
void setCalendar(const Akonadi::ETMCalendar::Ptr &);
......@@ -702,32 +702,32 @@ private:
IncidenceEditorNG::IncidenceDialog *createIncidenceEditor(
const Akonadi::Item &item, const Akonadi::Collection &collection = Akonadi::Collection());
CalendarSupport::CalPrinter *mCalPrinter;
Akonadi::TodoPurger *mTodoPurger;
CalendarSupport::CalPrinter *mCalPrinter = nullptr;
Akonadi::TodoPurger *mTodoPurger = nullptr;
QSplitter *mPanner;
QSplitter *mLeftSplitter;
QWidget *mLeftFrame;
QStackedWidget *mRightFrame;
CalendarSupport::MessageWidget *mMessageWidget;
QSplitter *mPanner = nullptr;
QSplitter *mLeftSplitter = nullptr;
QWidget *mLeftFrame = nullptr;
QStackedWidget *mRightFrame = nullptr;
CalendarSupport::MessageWidget *mMessageWidget = nullptr;
// This navigator bar is used when in full window month view
// It has nothing to do with the date navigator
NavigatorBar *mNavigatorBar;
NavigatorBar *mNavigatorBar = nullptr;
DateNavigatorContainer *mDateNavigatorContainer;
DateNavigatorContainer *mDateNavigatorContainer = nullptr;
QList<CalendarViewExtension *> mExtensions;
Akonadi::ETMCalendar::Ptr mCalendar;
DateNavigator *mDateNavigator;
DateChecker *mDateChecker;
DateNavigator *mDateNavigator = nullptr;
DateChecker *mDateChecker = nullptr;
QWidget *mEventViewerBox;
CalendarSupport::IncidenceViewer *mEventViewer;
KOViewManager *mViewManager;
KODialogManager *mDialogManager;
QWidget *mEventViewerBox = nullptr;
CalendarSupport::IncidenceViewer *mEventViewer = nullptr;
KOViewManager *mViewManager = nullptr;
KODialogManager *mDialogManager = nullptr;
// Calendar filters
QList<KCalCore::CalFilter *> mFilters;
......@@ -739,16 +739,16 @@ private:
Akonadi::Item mSelectedIncidence;
QDate mSaveDate;
KOTodoView *mTodoList;
Akonadi::IncidenceChanger *mChanger;
Akonadi::ITIPHandler *mITIPHandler;
KOTodoView *mTodoList = nullptr;
Akonadi::IncidenceChanger *mChanger = nullptr;
Akonadi::ITIPHandler *mITIPHandler = nullptr;
QList<int> mMainSplitterSizes; // temp store for main splitter sizes while left frame is hidden
bool mSplitterSizesValid;
bool mCreatingEnabled;
Akonadi::CalendarClipboard *mCalendarClipboard;
KOCheckableProxyModel *mCheckableProxyModel;
AkonadiCollectionView *mETMCollectionView;
Akonadi::CalendarClipboard *mCalendarClipboard = nullptr;
KOCheckableProxyModel *mCheckableProxyModel = nullptr;
AkonadiCollectionView *mETMCollectionView = nullptr;
SearchCollectionHelper mSearchCollectionHelper;
};
......
......@@ -48,11 +48,11 @@ public:
private:
void init(const Akonadi::Collection &collection);
QCheckBox *mBlockAlarmsCheckBox;
QLineEdit *mNameEdit;
QCheckBox *mIconCheckBox;
KIconButton *mIconButton;
PimCommon::IncidencesForWidget *mIncidencesForComboBox;
QCheckBox *mBlockAlarmsCheckBox = nullptr;
QLineEdit *mNameEdit = nullptr;
QCheckBox *mIconCheckBox = nullptr;
KIconButton *mIconButton = nullptr;
PimCommon::IncidencesForWidget *mIncidencesForComboBox = nullptr;
};
AKONADI_COLLECTION_PROPERTIES_PAGE_FACTORY(CollectionGeneralPageFactory, CollectionGeneralPage)
......
......@@ -79,7 +79,7 @@ protected Q_SLOTS:
void passedMidnight();
private:
QTimer *mUpdateTimer;
QTimer *mUpdateTimer = nullptr;
QDate mLastDayChecked;
RolloverType mUpdateRollover;
};
......
......@@ -154,7 +154,7 @@ private:
*/
KDateNavigator *firstNavigatorForDate(const QDate &date) const;
KDateNavigator *mNavigatorView;
KDateNavigator *mNavigatorView = nullptr;
Akonadi::ETMCalendar::Ptr mCalendar;
......
......@@ -66,9 +66,9 @@ public Q_SLOTS:
void setDialogConsistent(bool consistent);
private:
FilterEdit *mFilterEdit;
QPushButton *mOkButton;
QPushButton *mApplyButton;
FilterEdit *mFilterEdit = nullptr;
QPushButton *mOkButton = nullptr;
QPushButton *mApplyButton = nullptr;
protected Q_SLOTS:
void slotApply();
......@@ -104,9 +104,9 @@ private:
void filterSelected(KCalCore::CalFilter *f);
QString mNegativeBackground;
QList<KCalCore::CalFilter *> *mFilters;
KCalCore::CalFilter *mCurrent;
KPIM::TagSelectionDialog *mCategorySelectDialog;
QList<KCalCore::CalFilter *> *mFilters = nullptr;
KCalCore::CalFilter *mCurrent = nullptr;
KPIM::TagSelectionDialog *mCategorySelectDialog = nullptr;
};
#endif
......@@ -63,8 +63,8 @@ private Q_SLOTS:
void delayedDestruct();
private:
CalendarSupport::IncidenceViewer *mEventViewer;
QPushButton *mUser1Button;
CalendarSupport::IncidenceViewer *mEventViewer = nullptr;
QPushButton *mUser1Button = nullptr;
};
#endif
......@@ -75,10 +75,10 @@ private:
void writeConfig();
Akonadi::Collection mCollection;
Akonadi::Item mItem;
QLineEdit *mNoteTitle;
QPushButton *mOkButton;
KPIMTextEdit::RichTextEditorWidget *mNoteText;
Akonadi::CollectionComboBox *mCollectionCombobox;
QLineEdit *mNoteTitle = nullptr;
QPushButton *mOkButton = nullptr;
KPIMTextEdit::RichTextEditorWidget *mNoteText = nullptr;
Akonadi::CollectionComboBox *mCollectionCombobox = nullptr;
};
#endif // NOTEEDITDIALOG_H
......@@ -80,11 +80,11 @@ private:
void readConfig();
void writeConfig();
Ui::SearchDialog *m_ui;
CalendarView *m_calendarview; // parent
Ui::SearchDialog *m_ui = nullptr;
CalendarView *m_calendarview = nullptr; // parent
Akonadi::Item::List mMatchedEvents;
EventViews::ListView *listView;
QPushButton *mUser1Button;
EventViews::ListView *listView = nullptr;
QPushButton *mUser1Button = nullptr;
};
#endif
......@@ -56,7 +56,7 @@ private:
void updateSearchCollection(Akonadi::Collection col, KCalCore::Attendee::PartStat status, const QString &name, const QString &displayName);
private:
KIdentityManagement::IdentityManager *mIdentityManager;
KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
Akonadi::Collection mOpenInvitationCollection;
Akonadi::Collection mDeclineCollection;
};
......
......@@ -105,7 +105,7 @@ public Q_SLOTS:
bool handleCommandLine(const QStringList &args);
private:
ActionManager *mActionManager;
ActionManager *mActionManager = nullptr;
};
#endif // KORGANIZER_SHARED_H
......
......@@ -402,7 +402,7 @@ protected Q_SLOTS:
virtual void calendarReset();
protected:
Akonadi::IncidenceChanger *mChanger;
Akonadi::IncidenceChanger *mChanger = nullptr;
private:
class Private;
......
......@@ -68,7 +68,7 @@ public:
}
private:
MainWindow *mMainWindow;
MainWindow *mMainWindow = nullptr;
};
class PartFactory : public KPluginFactory
......
......@@ -288,11 +288,11 @@ private:
QDate mStartDate;
/** array of day labels to optimeize drawing performance. */
QString *mDayLabels;
QString *mDayLabels = nullptr;
/** array of days displayed to reduce memory consumption by
subsequently calling QDate::addDays(). */
QDate *mDays;
QDate *mDays = nullptr;
/** List for storing days which should be drawn using bold font. */
QList<QDate> mEvents;
......@@ -329,16 +329,16 @@ private:
/**
* Indicate pending calendar changes.
*/
bool mPendingChanges;
bool mPendingChanges = false;
/** Whether days with events are highlighted */
bool mHighlightEvents;
bool mHighlightEvents = false;
/** Whether days with to-dos (with due date) are highlighted */
bool mHighlightTodos;
bool mHighlightTodos = false;
/** Whether days with journals are highlighted */
bool mHighlightJournals;
bool mHighlightJournals = false;
};
#endif
......@@ -53,7 +53,7 @@ using namespace KOrg;
class KODialogManager::DialogManagerVisitor : public KCalCore::Visitor
{
public:
DialogManagerVisitor() : mDialogManager(nullptr) {}
DialogManagerVisitor() {}
bool act(KCalCore::IncidenceBase::Ptr incidence, KODialogManager *manager)
{
......@@ -62,7 +62,7 @@ public:
}
protected:
KODialogManager *mDialogManager;
KODialogManager *mDialogManager = nullptr;
};
KODialogManager::KODialogManager(CalendarView *mainView)
......
......@@ -88,12 +88,12 @@ private:
class DialogManagerVisitor;
class EditorDialogVisitor;
CalendarView *mMainView;
KCMultiDialog *mOptionsDialog;
CalendarView *mMainView = nullptr;
KCMultiDialog *mOptionsDialog = nullptr;
QPointer<Akonadi::TagManagementDialog> mCategoryEditDialog;
SearchDialog *mSearchDialog;
CalendarSupport::ArchiveDialog *mArchiveDialog;
FilterEditDialog *mFilterEditDialog;
SearchDialog *mSearchDialog = nullptr;
CalendarSupport::ArchiveDialog *mArchiveDialog = nullptr;
FilterEditDialog *mFilterEditDialog = nullptr;
};
#endif
......@@ -83,8 +83,7 @@ KOEventPopupMenu::KOEventPopupMenu(Akonadi::ETMCalendar *calendar, QWidget *pare
this, SLOT(popupDelete())));
//------------------------------------------------------------------------
addSeparator();
QAction *action;
action = addAction(QIcon::fromTheme(QStringLiteral("task-new")),
QAction *action = addAction(QIcon::fromTheme(QStringLiteral("task-new")),
i18n("Create To-do"),
this, SLOT(createTodo()));
action->setObjectName(QStringLiteral("createtodo"));
......
......@@ -93,8 +93,8 @@ private:
QList<QAction *> mTodoOnlyItems;
QList<QAction *> mEventOnlyItems;
QList<QAction *> mRecurrenceItems;
QAction *mDissociateOccurrences;
QAction *mToggleReminder;
QAction *mDissociateOccurrences = nullptr;
QAction *mToggleReminder = nullptr;
};
#endif
......@@ -175,7 +175,7 @@ private:
bool mReturnPressed;
bool mTypeAhead;
QObject *mTypeAheadReceiver;
QObject *mTypeAheadReceiver = nullptr;
QList<QEvent *> mTypeAheadEvents;
};
......
......@@ -76,7 +76,7 @@ protected:
KOGlobals();
private:
KHolidays::HolidayRegion *mHolidays;
KHolidays::HolidayRegion *mHolidays = nullptr;
};
#endif
......@@ -73,15 +73,15 @@ private:
void dateDiff(const QDate &date, int &days);
Akonadi::ETMCalendar::Ptr mCalendar;
Akonadi::IncidenceChanger *mChanger;
Akonadi::IncidenceChanger *mChanger = nullptr;
QGridLayout *mLayout;
QGridLayout *mLayout = nullptr;
QList<QLabel *> mLabels;
KOrganizerPlugin *mPlugin;
KOrganizerPlugin *mPlugin = nullptr;
int mDaysAhead;
bool mShowBirthdaysFromCal;
bool mShowAnniversariesFromCal;
bool mShowMineOnly;
bool mShowBirthdaysFromCal = false;
bool mShowAnniversariesFromCal = false;
bool mShowMineOnly = false;
};
#endif
......@@ -60,8 +60,8 @@ private Q_SLOTS:
void slotNewJournal();
private:
OrgKdeKorganizerCalendarInterface *mIface;
KontactInterface::UniqueAppWatcher *mUniqueAppWatcher;
OrgKdeKorganizerCalendarInterface *mIface = nullptr;
KontactInterface::UniqueAppWatcher *mUniqueAppWatcher = nullptr;
};
#endif
......@@ -51,9 +51,9 @@ private Q_SLOTS:
void customDaysChanged(int value);
private:
QButtonGroup *mDaysButtonGroup;
QButtonGroup *mShowButtonGroup;
QButtonGroup *mGroupwareButtonGroup;
QButtonGroup *mDaysButtonGroup = nullptr;