Commit e3b3610e authored by Laurent Montel's avatar Laurent Montel 😁

Make sure that all pointer is initialized

parent 4b885b49
......@@ -74,10 +74,10 @@ public:
int todayColumn() const;
public:
EventView *mEventView;
Agenda *mAgenda;
QTimer *mTimer;
QLabel *mTimeBox; // Label showing the current time
EventView *mEventView = nullptr;
Agenda *mAgenda = nullptr;
QTimer *mTimer = nullptr;
QLabel *mTimeBox = nullptr; // Label showing the current time
KDateTime mOldDateTime;
int mOldTodayCol;
};
......@@ -234,8 +234,8 @@ public:
QMultiHash<QString, AgendaItem::QPtr> mAgendaItemsById; // It's a QMultiHash because recurring incidences might have many agenda items
QSet<QString> mItemsQueuedForDeletion;
AgendaView *mAgendaView;
QScrollArea *mScrollArea;
AgendaView *mAgendaView = nullptr;
QScrollArea *mScrollArea = nullptr;
bool mAllDayMode;
......
......@@ -204,29 +204,29 @@ public:
public:
// view widgets
QGridLayout *mGridLayout;
QFrame *mTopDayLabels;
QBoxLayout *mLayoutTopDayLabels;
QFrame *mTopDayLabelsFrame;
QGridLayout *mGridLayout = nullptr;
QFrame *mTopDayLabels = nullptr;
QBoxLayout *mLayoutTopDayLabels = nullptr;
QFrame *mTopDayLabelsFrame = nullptr;
QList<AlternateLabel *> mDateDayLabels;
QBoxLayout *mLayoutBottomDayLabels;
QFrame *mBottomDayLabels;
QFrame *mBottomDayLabelsFrame;
QFrame *mAllDayFrame;
QWidget *mTimeBarHeaderFrame;
QSplitter *mSplitterAgenda;
QBoxLayout *mLayoutBottomDayLabels = nullptr;
QFrame *mBottomDayLabels = nullptr;
QFrame *mBottomDayLabelsFrame = nullptr;
QFrame *mAllDayFrame = nullptr;
QWidget *mTimeBarHeaderFrame = nullptr;
QSplitter *mSplitterAgenda = nullptr;
QList<QLabel *> mTimeBarHeaders;
Agenda *mAllDayAgenda;
Agenda *mAgenda;
Agenda *mAllDayAgenda = nullptr;
Agenda *mAgenda = nullptr;
TimeLabelsZone *mTimeLabelsZone;
TimeLabelsZone *mTimeLabelsZone = nullptr;
KCalCore::DateList mSelectedDates; // List of dates to be displayed
KCalCore::DateList mSaveSelectedDates; // Save the list of dates between updateViews
int mViewType;
EventIndicator *mEventIndicatorTop;
EventIndicator *mEventIndicatorBottom;
EventIndicator *mEventIndicatorTop = nullptr;
EventIndicator *mEventIndicatorBottom = nullptr;
QVector<int> mMinY;
QVector<int> mMaxY;
......@@ -242,7 +242,7 @@ public:
const bool mIsSideBySide;
QWidget *mDummyAllDayLeft;
QWidget *mDummyAllDayLeft = nullptr;
bool mUpdateAllDayAgenda;
bool mUpdateAgenda;
bool mIsInteractive;
......
......@@ -64,7 +64,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *) override;
virtual void squeezeContentsToLabel();
bool mAutomaticSqueeze;
EventViews::CalendarDecoration::Element *mDecorationElement;
EventViews::CalendarDecoration::Element *mDecorationElement = nullptr;
QString mShortText, mLongText, mExtensiveText;
QPixmap mPixmap;
QUrl mUrl;
......
......@@ -71,11 +71,11 @@ public:
private:
void setupTimeLabel(QScrollArea *area);
Agenda *mAgenda;
Agenda *mAgenda = nullptr;
PrefsPtr mPrefs;
AgendaView *mParent;
AgendaView *mParent = nullptr;
QHBoxLayout *mTimeLabelsLayout;
QHBoxLayout *mTimeLabelsLayout = nullptr;
QList<QScrollArea *> mTimeLabelsList;
};
......
......@@ -74,7 +74,7 @@ public:
KDateTime::Spec timeSpec() const;
Akonadi::ETMCalendar::Ptr mCalendar;
AgendaView *mAgendaView;
AgendaView *mAgendaView = nullptr;
};
class MultiViewCalendar : public ViewCalendar
......@@ -100,7 +100,7 @@ public:
KCalCore::Calendar::Ptr getCalendar() const override;
KCalCore::Incidence::List incidences() const;
AgendaView *mAgendaView;
AgendaView *mAgendaView = nullptr;
AkonadiViewCalendar::Ptr mETMCalendar;
QList<ViewCalendar::Ptr> mSubCalendars;
};
......
......@@ -68,7 +68,7 @@ public: /// Members
bool mReturnPressed;
bool mDateRangeSelectionEnabled;
bool mTypeAhead;
QObject *mTypeAheadReceiver;
QObject *mTypeAheadReceiver = nullptr;
QList<QEvent *> mTypeAheadEvents;
static CalendarSupport::CollectionSelection *sGlobalCollectionSelection;
......@@ -76,7 +76,7 @@ public: /// Members
PrefsPtr mPrefs;
KCalPrefsPtr mKCalPrefs;
Akonadi::IncidenceChanger *mChanger;
Akonadi::IncidenceChanger *mChanger = nullptr;
EventView::Changes mChanges;
Akonadi::Collection::Id mCollectionId;
};
......
......@@ -96,15 +96,15 @@ private:
Akonadi::ETMCalendar::Ptr mCalendar;
QDate mDate;
QTextBrowser *mBrowser;
QPushButton *mEditButton;
QPushButton *mDeleteButton;
QPushButton *mPrintButton;
QPushButton *mPrintPreviewButton;
QTextBrowser *mBrowser = nullptr;
QPushButton *mEditButton = nullptr;
QPushButton *mDeleteButton = nullptr;
QPushButton *mPrintButton = nullptr;
QPushButton *mPrintPreviewButton = nullptr;
bool mDirty;
bool mWriteInProgress;
Akonadi::IncidenceChanger *mChanger;
Akonadi::IncidenceChanger *mChanger = nullptr;
};
class JournalDateView : public QFrame
......
......@@ -90,10 +90,10 @@ protected:
void clearEntries();
private:
QScrollArea *mSA;
QWidget *mCurrentWidget;
QScrollArea *mSA = nullptr;
QWidget *mCurrentWidget = nullptr;
QMap<QDate, EventViews::JournalDateView *> mEntries;
Akonadi::IncidenceChanger *mChanger;
Akonadi::IncidenceChanger *mChanger = nullptr;
// DateList mSelectedDates; // List of dates to be displayed
};
......
......@@ -82,7 +82,7 @@ public:
bool operator<(const QTreeWidgetItem &other) const override;
const QTreeWidget *mTreeWidget;
const QTreeWidget *mTreeWidget = nullptr;
const Akonadi::Item mIncidence;
QDateTime start;
QDateTime end;
......@@ -130,8 +130,8 @@ public:
const Akonadi::Item &, const QDate &date);
ListViewItem *getItemForIncidence(const Akonadi::Item &);
QTreeWidget *mTreeWidget;
ListViewItem *mActiveItem;
QTreeWidget *mTreeWidget = nullptr;
ListViewItem *mActiveItem = nullptr;
QHash<Akonadi::Item::Id, Akonadi::Item> mItems;
QHash<Akonadi::Item::Id, QDate> mDateList;
QDate mStartDate;
......@@ -166,7 +166,7 @@ public:
}
private:
ListViewItem *mItem;
ListViewItem *mItem = nullptr;
QDate mStartDate;
};
......@@ -449,7 +449,7 @@ void ListView::showIncidences(const Akonadi::Item::List &itemList, const QDate &
void ListView::changeIncidenceDisplay(const Akonadi::Item &aitem, int action)
{
const Incidence::Ptr incidence = CalendarSupport::incidence(aitem);
ListViewItem *item;
ListViewItem *item = nullptr;
QDate f = d->mSelectedDates.first();
QDate l = d->mSelectedDates.last();
......
......@@ -118,10 +118,10 @@ private:
int mId;
QDate mDate;
QGraphicsScene *mScene;
QGraphicsScene *mScene = nullptr;
ScrollIndicator *mUpArrow;
ScrollIndicator *mDownArrow;
ScrollIndicator *mUpArrow = nullptr;
ScrollIndicator *mDownArrow = nullptr;
};
/**
......@@ -216,7 +216,7 @@ private:
int mDaySpan;
// The current item is part of a MonthItem
MonthItem *mMonthItem;
MonthItem *mMonthItem = nullptr;
};
}
......
......@@ -273,7 +273,7 @@ private:
QList<MonthGraphicsItem *> mMonthGraphicsItemList;
MonthScene *mMonthScene;
MonthScene *mMonthScene = nullptr;
bool mSelected;
bool mMoving; // during move
......
......@@ -72,7 +72,7 @@ public:
int itemHeight();
int itemHeightIncludingSpacing();
QList<MonthItem *> mManagerList;
MonthView *mMonthView;
MonthView *mMonthView = nullptr;
MonthView *monthView() const
{
......@@ -284,14 +284,14 @@ private:
bool mInitialized;
// User interaction.
MonthItem *mClickedItem; // todo ini in ctor
MonthItem *mActionItem;
MonthItem *mClickedItem = nullptr; // todo ini in ctor
MonthItem *mActionItem = nullptr;
bool mActionInitiated;
MonthItem *mSelectedItem;
MonthItem *mSelectedItem = nullptr;
QDate mSelectedCellDate;
MonthCell *mStartCell; // start cell when dragging
MonthCell *mPreviousCell; // the cell before that one during dragging
MonthCell *mStartCell = nullptr; // start cell when dragging
MonthCell *mPreviousCell = nullptr; // the cell before that one during dragging
ActionType mActionType;
ResizeType mResizeType;
......
......@@ -63,11 +63,11 @@ public: /// Methods
public: /// Members
QTimer reloadTimer;
MonthScene *scene;
MonthScene *scene = nullptr;
QDate selectedItemDate;
Akonadi::Item::Id selectedItemId;
MonthGraphicsView *view;
QToolButton *fullView;
MonthGraphicsView *view = nullptr;
QToolButton *fullView = nullptr;
// List of uids for QDate
QMap<QDate, QStringList > mBusyDays;
......
......@@ -136,12 +136,14 @@ public:
MultiAgendaView *q;
QList<AgendaView *> mAgendaViews;
QList<QWidget *> mAgendaWidgets;
QWidget *mTopBox;
QScrollArea *mScrollArea;
TimeLabelsZone *mTimeLabelsZone;
QSplitter *mLeftSplitter, *mRightSplitter;
QScrollBar *mScrollBar;
QWidget *mLeftBottomSpacer, *mRightBottomSpacer;
QWidget *mTopBox = nullptr;
QScrollArea *mScrollArea = nullptr;
TimeLabelsZone *mTimeLabelsZone = nullptr;
QSplitter *mLeftSplitter = nullptr;
QSplitter *mRightSplitter = nullptr;
QScrollBar *mScrollBar = nullptr;
QWidget *mLeftBottomSpacer = nullptr;
QWidget *mRightBottomSpacer = nullptr;
QDate mStartDate, mEndDate;
bool mUpdateOnShow;
bool mPendingChanges;
......@@ -149,8 +151,8 @@ public:
QVector<KCheckableProxyModel *> mCollectionSelectionModels;
QStringList mCustomColumnTitles;
int mCustomNumberOfColumns;
QLabel *mLabel;
QWidget *mRightDummyWidget;
QLabel *mLabel = nullptr;
QWidget *mRightDummyWidget = nullptr;
QHash<QString, KViewStateMaintainer<ETMViewStateSaver>* > mSelectionSavers;
};
......
......@@ -56,7 +56,7 @@ public:
private:
Akonadi::ETMCalendar::Ptr mCalendar;
QMap<Akonadi::Item::Id, QList<QStandardItem *> > mItemMap;
QStandardItemModel *mModel;
QStandardItemModel *mModel = nullptr;
QColor mColor;
uint mIndex;
};
......@@ -100,7 +100,7 @@ private:
Akonadi::ETMCalendar::Ptr mCalendar;
Akonadi::Item mIncidence;
KDateTime mStart;
TimelineItem *mParent;
TimelineItem *mParent = nullptr;
bool mToolTipNeedsUpdate;
};
......
......@@ -70,9 +70,9 @@ public Q_SLOTS:
public:
Akonadi::Item::List mSelectedItemList;
KGantt::GraphicsView *mGantt;
QTreeWidget *mLeftView;
RowController *mRowController;
KGantt::GraphicsView *mGantt = nullptr;
QTreeWidget *mLeftView = nullptr;
RowController *mRowController = nullptr;
QMap<Akonadi::Collection::Id, TimelineItem *> mCalendarItemMap;
QDate mStartDate, mEndDate;
QDateTime mHintDate;
......
......@@ -189,7 +189,7 @@ public:
}
KCalCore::Event::List mEventList;
TimeSpentView *mTimeSpentView;
TimeSpentView *mTimeSpentView = nullptr;
};
}
......
......@@ -64,7 +64,7 @@ public Q_SLOTS:
void changeIncidenceDisplay(const Akonadi::Item &, Akonadi::IncidenceChanger::ChangeType);
private:
TimeSpentWidget *mView;
TimeSpentWidget *mView = nullptr;
QDate mStartDate;
QDate mEndDate;
......
......@@ -61,7 +61,7 @@ void TodoCompleteDelegate::paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QStyle *style;
QStyle *style = nullptr;
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
......
......@@ -176,7 +176,7 @@ public:
QSize sizeHint(const QStyleOptionViewItem &option,
const QModelIndex &index) const override;
private:
QTextDocument *m_textDoc;
QTextDocument *m_textDoc = nullptr;
};
#endif
......@@ -48,7 +48,7 @@ public:
public:
Akonadi::ETMCalendar::Ptr m_calendar;
Akonadi::IncidenceChanger *m_changer;
Akonadi::IncidenceChanger *m_changer = nullptr;
//For adjusting persistent indexes
QList<QPersistentModelIndex> m_layoutChangePersistentIndexes;
......
......@@ -165,13 +165,13 @@ public:
return todoFlatModel != nullptr;
}
TodoModel *todoModel;
TodoModel *todoModel = nullptr;
QList<TodoView *> views;
QObject *parent;
QObject *parent = nullptr;
Akonadi::ETMCalendar::Ptr calendar;
IncidenceTreeModel *todoTreeModel;
Akonadi::EntityMimeTypeFilterModel *todoFlatModel;
IncidenceTreeModel *todoTreeModel = nullptr;
Akonadi::EntityMimeTypeFilterModel *todoFlatModel = nullptr;
EventViews::PrefsPtr prefs;
};
}
......
......@@ -165,25 +165,25 @@ private:
const Akonadi::Item &parentItem,
const QStringList &categories = QStringList());
TodoViewView *mView;
TodoViewSortFilterProxyModel *mProxyModel;
TodoCategoriesDelegate *mCategoriesDelegate;
TodoViewQuickSearch *mQuickSearch;
TodoViewQuickAddLine *mQuickAdd;
QToolButton *mFullViewButton;
QToolButton *mFlatViewButton;
QMenu *mItemPopupMenu;
KPIM::KDatePickerPopup *mCopyPopupMenu;
KPIM::KDatePickerPopup *mMovePopupMenu;
QMenu *mPriorityPopupMenu;
QMenu *mPercentageCompletedPopupMenu;
TodoViewView *mView = nullptr;
TodoViewSortFilterProxyModel *mProxyModel = nullptr;
TodoCategoriesDelegate *mCategoriesDelegate = nullptr;
TodoViewQuickSearch *mQuickSearch = nullptr;
TodoViewQuickAddLine *mQuickAdd = nullptr;
QToolButton *mFullViewButton = nullptr;
QToolButton *mFlatViewButton = nullptr;
QMenu *mItemPopupMenu = nullptr;
KPIM::KDatePickerPopup *mCopyPopupMenu = nullptr;
KPIM::KDatePickerPopup *mMovePopupMenu = nullptr;
QMenu *mPriorityPopupMenu = nullptr;
QMenu *mPercentageCompletedPopupMenu = nullptr;
QList<QAction *> mItemPopupMenuItemOnlyEntries;
QList<QAction *> mItemPopupMenuReadWriteEntries;
QAction *mMakeTodoIndependent;
QAction *mMakeSubtodosIndependent;
QAction *mMakeTodoIndependent = nullptr;
QAction *mMakeSubtodosIndependent = nullptr;
QPointer<Akonadi::ETMViewStateSaver> mTreeStateRestorer;
......@@ -191,7 +191,7 @@ private:
QMap<QAction *, int> mPriority;
bool mSidebarView;
bool mResizeColumnsScheduled;
QTimer *mResizeColumnsTimer;
QTimer *mResizeColumnsTimer = nullptr;
};
}
......
......@@ -73,9 +73,9 @@ private:
Akonadi::ETMCalendar::Ptr mCalendar;
QLineEdit *mSearchLine;
KPIM::TagSelectionCombo *mCategoryCombo;
KPIM::KCheckComboBox *mPriorityCombo;
QLineEdit *mSearchLine = nullptr;
KPIM::TagSelectionCombo *mCategoryCombo = nullptr;
KPIM::KCheckComboBox *mPriorityCombo = nullptr;
};
#endif
......@@ -50,7 +50,7 @@ protected:
private:
QModelIndex getNextEditableIndex(const QModelIndex &cur, int inc);
QMenu *mHeaderPopup;
QMenu *mHeaderPopup = nullptr;
QList<QAction *> mColumnActions;
QTimer mExpandTimer;
bool mIgnoreNextMouseRelease;
......
......@@ -53,9 +53,9 @@ private:
Ui_MainWindow mUi;
Akonadi::ETMCalendar::Ptr mCalendar;
Akonadi::IncidenceChanger *mIncidenceChanger;
Settings *mSettings;
EventViews::PrefsPtr *mViewPreferences;
Akonadi::IncidenceChanger *mIncidenceChanger = nullptr;
Settings *mSettings = nullptr;
EventViews::PrefsPtr *mViewPreferences = nullptr;
private:
void addView(const QString &viewName);
......
......@@ -89,7 +89,7 @@ private Q_SLOTS:
private:
void createTaskRow(KIconLoader *kil);
WhatsNextTextBrowser *mView;
WhatsNextTextBrowser *mView = nullptr;
QString mText;
QDate mStartDate;
QDate mEndDate;
......
......@@ -28,7 +28,7 @@ public:
~CreateColorGui_test();
private:
void createListWidgetItem();
QListWidget *mListWidget;
QListWidget *mListWidget = nullptr;
};
#endif // CREATECOLORGUI_TEST_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