summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-08-30 13:54:50 +0200
committerMontel Laurent <[email protected]>2017-08-30 13:54:50 +0200
commitd9c897114673600e1729ba592fcd2f8820f6a5f4 (patch)
tree8dc8957335c65dc79878d47099135c5761da5bd3
parentf4e360dcacdb2309c46620cb1867c99aabc78597 (diff)
initialize some variables
-rw-r--r--autotests/modeltest.h4
-rw-r--r--src/attachmenticonview.cpp2
-rw-r--r--src/autochecktreewidget.cpp2
-rw-r--r--src/categorydialog.h8
-rw-r--r--src/categoryeditdialog.h4
-rw-r--r--src/categoryselectdialog.h6
-rw-r--r--src/conflictresolver.h4
-rw-r--r--src/editoritemmanager.cpp8
-rw-r--r--src/freebusyurldialog.h4
-rw-r--r--src/incidencealarm.h8
-rw-r--r--src/incidenceattachment.cpp2
-rw-r--r--src/incidenceattachment.h18
-rw-r--r--src/incidenceattendee.h18
-rw-r--r--src/incidencecategories.h4
-rw-r--r--src/incidencecompletionpriority.cpp4
-rw-r--r--src/incidencedatetime.h2
-rw-r--r--src/incidencedescription.h2
-rw-r--r--src/incidencedialog.cpp22
-rw-r--r--src/incidencerecurrence.h8
-rw-r--r--src/incidenceresource.h10
-rw-r--r--src/incidencesecrecy.h2
-rw-r--r--src/incidencewhatwhere.h2
-rw-r--r--src/individualmailcomponentfactory.h6
-rw-r--r--src/individualmaildialog.h4
-rw-r--r--src/resourcemanagement.cpp4
-rw-r--r--src/resourcemanagement.h8
-rw-r--r--src/schedulingdialog.h6
-rw-r--r--src/visualfreebusywidget.h12
28 files changed, 92 insertions, 92 deletions
diff --git a/autotests/modeltest.h b/autotests/modeltest.h
index d9161c3..13284ff 100644
--- a/autotests/modeltest.h
+++ b/autotests/modeltest.h
@@ -61,7 +61,7 @@ protected Q_SLOTS:
private:
void checkChildren(const QModelIndex &parent, int currentDepth = 0);
- QAbstractItemModel *model;
+ QAbstractItemModel *model = nullptr;
struct Changing {
QModelIndex parent;
@@ -72,7 +72,7 @@ private:
QStack<Changing> insert;
QStack<Changing> remove;
- bool fetchingMore;
+ bool fetchingMore = false;
QList<QPersistentModelIndex> changing;
};
diff --git a/src/attachmenticonview.cpp b/src/attachmenticonview.cpp
index d92ee72..93b34f7 100644
--- a/src/attachmenticonview.cpp
+++ b/src/attachmenticonview.cpp
@@ -190,7 +190,7 @@ QUrl AttachmentIconView::tempFileForAttachment(const KCalCore::Attachment::Ptr &
if (url.isValid()) {
return url;
}
- QTemporaryFile *file;
+ QTemporaryFile *file = nullptr;
QMimeDatabase db;
QStringList patterns = db.mimeTypeForName(attachment->mimeType()).globPatterns();
diff --git a/src/autochecktreewidget.cpp b/src/autochecktreewidget.cpp
index 1343711..9e7de8f 100644
--- a/src/autochecktreewidget.cpp
+++ b/src/autochecktreewidget.cpp
@@ -126,7 +126,7 @@ void AutoCheckTreeWidget::slotRowsInserted(const QModelIndex &parent, int start,
{
if (d->mAutoCheck) {
QTreeWidgetItem *item = itemFromIndex(parent);
- QTreeWidgetItem *child;
+ QTreeWidgetItem *child = nullptr;
if (item) {
QBrush b(Qt::yellow);
item->setBackground(0, b);
diff --git a/src/categorydialog.h b/src/categorydialog.h
index dd8c795..e177533 100644
--- a/src/categorydialog.h
+++ b/src/categorydialog.h
@@ -66,8 +66,8 @@ private:
void addCategory();
void removeCategory();
QStringList mCategoryList;
- CategoryWidgetBase *mWidgets;
- CalendarSupport::CategoryConfig *mCategoryConfig;
+ CategoryWidgetBase *mWidgets = nullptr;
+ CalendarSupport::CategoryConfig *mCategoryConfig = nullptr;
};
class CategoryDialog : public QDialog
@@ -93,8 +93,8 @@ Q_SIGNALS:
void categoriesSelected(const QStringList &);
private:
- CategoryWidget *mWidgets;
- CalendarSupport::CategoryConfig *mCategoryConfig;
+ CategoryWidget *mWidgets = nullptr;
+ CalendarSupport::CategoryConfig *mCategoryConfig = nullptr;
class CategorySelectDialogPrivate;
CategorySelectDialogPrivate *d;
};
diff --git a/src/categoryeditdialog.h b/src/categoryeditdialog.h
index 8c9e480..edc4b5e 100644
--- a/src/categoryeditdialog.h
+++ b/src/categoryeditdialog.h
@@ -67,8 +67,8 @@ protected:
private:
void deleteItem(QTreeWidgetItem *item, QList<QTreeWidgetItem *> &to_remove);
- CalendarSupport::CategoryConfig *mCategoryConfig;
- Ui::CategoryEditDialog_base *mWidgets;
+ CalendarSupport::CategoryConfig *mCategoryConfig = nullptr;
+ Ui::CategoryEditDialog_base *mWidgets = nullptr;
};
}
diff --git a/src/categoryselectdialog.h b/src/categoryselectdialog.h
index 5413647..4f7ea03 100644
--- a/src/categoryselectdialog.h
+++ b/src/categoryselectdialog.h
@@ -62,8 +62,8 @@ Q_SIGNALS:
private:
QStringList mCategoryList;
- CategorySelectWidgetBase *mWidgets;
- CalendarSupport::CategoryConfig *mCategoryConfig;
+ CategorySelectWidgetBase *mWidgets = nullptr;
+ CalendarSupport::CategoryConfig *mCategoryConfig = nullptr;
};
class CategorySelectDialog : public QDialog
@@ -90,7 +90,7 @@ Q_SIGNALS:
void editCategories();
private:
- CategorySelectWidget *mWidgets;
+ CategorySelectWidget *mWidgets = nullptr;
class CategorySelectDialogPrivate;
CategorySelectDialogPrivate *d;
diff --git a/src/conflictresolver.h b/src/conflictresolver.h
index 2182618..0b11969 100644
--- a/src/conflictresolver.h
+++ b/src/conflictresolver.h
@@ -189,8 +189,8 @@ private:
// to prevent the process from being repeated many times
// after a series of quick parameter changes.
- CalendarSupport::FreeBusyItemModel *mFBModel;
- QWidget *mParentWidget;
+ CalendarSupport::FreeBusyItemModel *mFBModel = nullptr;
+ QWidget *mParentWidget = nullptr;
QSet<KCalCore::Attendee::Role> mMandatoryRoles;
QBitArray mWeekdays; //!< a 7 bit array indicating the allowed days
diff --git a/src/editoritemmanager.cpp b/src/editoritemmanager.cpp
index 39bfc3f..f9e5a4c 100644
--- a/src/editoritemmanager.cpp
+++ b/src/editoritemmanager.cpp
@@ -52,11 +52,11 @@ public:
Akonadi::Item mItem;
Akonadi::Item mPrevItem;
Akonadi::ItemFetchScope mFetchScope;
- Akonadi::Monitor *mItemMonitor;
- ItemEditorUi *mItemUi;
- bool mIsCounterProposal;
+ Akonadi::Monitor *mItemMonitor = nullptr;
+ ItemEditorUi *mItemUi = nullptr;
+ bool mIsCounterProposal = false;
EditorItemManager::SaveAction currentAction;
- Akonadi::IncidenceChanger *mChanger;
+ Akonadi::IncidenceChanger *mChanger = nullptr;
public:
ItemEditorPrivate(Akonadi::IncidenceChanger *changer, EditorItemManager *qq);
diff --git a/src/freebusyurldialog.h b/src/freebusyurldialog.h
index a63ab8f..1a662d3 100644
--- a/src/freebusyurldialog.h
+++ b/src/freebusyurldialog.h
@@ -41,7 +41,7 @@ public Q_SLOTS:
void slotOk();
private:
- FreeBusyUrlWidget *mWidget;
+ FreeBusyUrlWidget *mWidget = nullptr;
};
class FreeBusyUrlWidget : public QWidget
@@ -55,7 +55,7 @@ public:
void saveConfig();
private:
- KLineEdit *mUrlEdit;
+ KLineEdit *mUrlEdit = nullptr;
AttendeeData::Ptr mAttendee;
};
}
diff --git a/src/incidencealarm.h b/src/incidencealarm.h
index 737301b..723854a 100644
--- a/src/incidencealarm.h
+++ b/src/incidencealarm.h
@@ -57,12 +57,12 @@ private:
QString stringForAlarm(const KCalCore::Alarm::Ptr &alarm);
private:
- Ui::EventOrTodoDesktop *mUi;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
KCalCore::Alarm::List mAlarms;
- IncidenceDateTime *mDateTime;
- int mEnabledAlarmCount;
- bool mIsTodo;
+ IncidenceDateTime *mDateTime = nullptr;
+ int mEnabledAlarmCount = 0;
+ bool mIsTodo = false;
};
}
diff --git a/src/incidenceattachment.cpp b/src/incidenceattachment.cpp
index 13d0758..02f2b26 100644
--- a/src/incidenceattachment.cpp
+++ b/src/incidenceattachment.cpp
@@ -422,7 +422,7 @@ void IncidenceAttachment::handlePasteOrDrop(const QMimeData *mimeData)
probablyWeHaveUris = true;
}
QMenu menu;
- QAction *linkAction = nullptr, *cancelAction;
+ QAction *linkAction = nullptr, *cancelAction = nullptr;
if (probablyWeHaveUris) {
linkAction
= menu.addAction(QIcon::fromTheme(QStringLiteral("insert-link")),
diff --git a/src/incidenceattachment.h b/src/incidenceattachment.h
index 569fb34..234e27d 100644
--- a/src/incidenceattachment.h
+++ b/src/incidenceattachment.h
@@ -85,18 +85,18 @@ private:
void setupAttachmentIconView();
private:
- AttachmentIconView *mAttachmentView;
- Ui::EventOrTodoDesktop *mUi;
+ AttachmentIconView *mAttachmentView = nullptr;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
- QMenu *mPopupMenu;
- QAction *mOpenAction;
- QAction *mSaveAsAction;
+ QMenu *mPopupMenu = nullptr;
+ QAction *mOpenAction = nullptr;
+ QAction *mSaveAsAction = nullptr;
#ifndef QT_NO_CLIPBOARD
- QAction *mCopyAction;
- QAction *mCutAction;
+ QAction *mCopyAction = nullptr;
+ QAction *mCutAction = nullptr;
#endif
- QAction *mDeleteAction;
- QAction *mEditAction;
+ QAction *mDeleteAction = nullptr;
+ QAction *mEditAction = nullptr;
};
}
diff --git a/src/incidenceattendee.h b/src/incidenceattendee.h
index 0b9695c..987f5a5 100644
--- a/src/incidenceattendee.h
+++ b/src/incidenceattendee.h
@@ -128,20 +128,20 @@ private:
void fillOrganizerCombo();
void setActions(KCalCore::Incidence::IncidenceType actions);
- Ui::EventOrTodoDesktop *mUi;
- QWidget *mParentWidget;
- ConflictResolver *mConflictResolver;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
+ QWidget *mParentWidget = nullptr;
+ ConflictResolver *mConflictResolver = nullptr;
- IncidenceDateTime *mDateTime;
+ IncidenceDateTime *mDateTime = nullptr;
QString mOrganizer;
QString mOldIconName;
/** used dataModel to rely on*/
- AttendeeTableModel *mDataModel;
- AttendeeLineEditDelegate *mAttendeeDelegate;
- AttendeeComboBoxDelegate *mStateDelegate;
- AttendeeComboBoxDelegate *mRoleDelegate;
- AttendeeComboBoxDelegate *mResponseDelegate;
+ AttendeeTableModel *mDataModel = nullptr;
+ AttendeeLineEditDelegate *mAttendeeDelegate = nullptr;
+ AttendeeComboBoxDelegate *mStateDelegate = nullptr;
+ AttendeeComboBoxDelegate *mRoleDelegate = nullptr;
+ AttendeeComboBoxDelegate *mResponseDelegate = nullptr;
QMap<KCalCore::Attendee::Ptr, KContacts::ContactGroup> mGroupList;
QMap<KJob *, KCalCore::Attendee::Ptr> mMightBeGroupJobs;
diff --git a/src/incidencecategories.h b/src/incidencecategories.h
index f368e87..8264c3e 100644
--- a/src/incidencecategories.h
+++ b/src/incidencecategories.h
@@ -55,7 +55,7 @@ private Q_SLOTS:
void onMissingTagCreated(KJob *);
private:
- Ui::EventOrTodoDesktop *mUi;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
/**
* List of categories for which no tag might exist.
@@ -66,7 +66,7 @@ private:
* categories, this list still holds these categories so they don't get lost
*/
QStringList mMissingCategories;
- bool mDirty;
+ bool mDirty = false;
};
}
diff --git a/src/incidencecompletionpriority.cpp b/src/incidencecompletionpriority.cpp
index 28199f8..8d131b0 100644
--- a/src/incidencecompletionpriority.cpp
+++ b/src/incidencecompletionpriority.cpp
@@ -37,8 +37,8 @@ public:
}
public:
- Ui::EventOrTodoDesktop *mUi;
- int mOrigPercentCompleted;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
+ int mOrigPercentCompleted = -1;
public: // slots
void sliderValueChanged(int);
diff --git a/src/incidencedatetime.h b/src/incidencedatetime.h
index 00fe5f9..403c607 100644
--- a/src/incidencedatetime.h
+++ b/src/incidencedatetime.h
@@ -130,7 +130,7 @@ private:
private:
QVector<QByteArray> mTimeZones;
- Ui::EventOrTodoDesktop *mUi;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
QDate mActiveDate;
/**
diff --git a/src/incidencedescription.h b/src/incidencedescription.h
index 775f846..fa1c3bd 100644
--- a/src/incidencedescription.h
+++ b/src/incidencedescription.h
@@ -60,7 +60,7 @@ private:
void setupToolBar();
private:
- Ui::EventOrTodoDesktop *mUi;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
//@cond PRIVATE
Q_DECLARE_PRIVATE(IncidenceDescription)
IncidenceDescriptionPrivate *const d;
diff --git a/src/incidencedialog.cpp b/src/incidencedialog.cpp
index 00f163c..069be4b 100644
--- a/src/incidencedialog.cpp
+++ b/src/incidencedialog.cpp
@@ -77,17 +77,17 @@ class IncidenceDialogPrivate : public ItemEditorUi
Q_DECLARE_PUBLIC(IncidenceDialog)
public:
- Ui::EventOrTodoDesktop *mUi;
- Akonadi::CollectionComboBox *mCalSelector;
- bool mCloseOnSave;
-
- EditorItemManager *mItemManager;
- CombinedIncidenceEditor *mEditor;
- IncidenceDateTime *mIeDateTime;
- IncidenceAttendee *mIeAttendee;
- IncidenceRecurrence *mIeRecurrence;
- IncidenceResource *mIeResource;
- bool mInitiallyDirty;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
+ Akonadi::CollectionComboBox *mCalSelector = nullptr;
+ bool mCloseOnSave = false;
+
+ EditorItemManager *mItemManager = nullptr;
+ CombinedIncidenceEditor *mEditor = nullptr;
+ IncidenceDateTime *mIeDateTime = nullptr;
+ IncidenceAttendee *mIeAttendee = nullptr;
+ IncidenceRecurrence *mIeRecurrence = nullptr;
+ IncidenceResource *mIeResource = nullptr;
+ bool mInitiallyDirty = false;
Akonadi::Item mItem;
QString typeToString(const int type) const;
diff --git a/src/incidencerecurrence.h b/src/incidencerecurrence.h
index 73286b9..e16b909 100644
--- a/src/incidencerecurrence.h
+++ b/src/incidencerecurrence.h
@@ -117,15 +117,15 @@ private:
QDate currentDate() const;
private:
- Ui::EventOrTodoDesktop *mUi;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
QDate mCurrentDate;
- IncidenceDateTime *mDateTime;
+ IncidenceDateTime *mDateTime = nullptr;
KCalCore::DateList mExceptionDates;
// So we can easily detect if the user changed the type,
// without going through complicated recurrence logic:
- int mMonthlyInitialType;
- int mYearlyInitialType;
+ int mMonthlyInitialType = -1;
+ int mYearlyInitialType = -1;
};
}
diff --git a/src/incidenceresource.h b/src/incidenceresource.h
index 7cb078e..812e130 100644
--- a/src/incidenceresource.h
+++ b/src/incidenceresource.h
@@ -67,16 +67,16 @@ private:
void slotDateChanged();
void dialogOkPressed();
- Ui::EventOrTodoDesktop *mUi;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
/** completer for findResources */
- QCompleter *completer;
+ QCompleter *completer = nullptr;
/** used dataModel to rely on*/
- AttendeeTableModel *dataModel;
- IncidenceDateTime *mDateTime;
+ AttendeeTableModel *dataModel = nullptr;
+ IncidenceDateTime *mDateTime = nullptr;
- ResourceManagement *resourceDialog;
+ ResourceManagement *resourceDialog = nullptr;
};
}
diff --git a/src/incidencesecrecy.h b/src/incidencesecrecy.h
index 3f044ef..eba1375 100644
--- a/src/incidencesecrecy.h
+++ b/src/incidencesecrecy.h
@@ -42,7 +42,7 @@ public:
bool isDirty() const override;
private:
- Ui::EventOrTodoDesktop *mUi;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
};
}
diff --git a/src/incidencewhatwhere.h b/src/incidencewhatwhere.h
index bd7b7e2..e5e99a4 100644
--- a/src/incidencewhatwhere.h
+++ b/src/incidencewhatwhere.h
@@ -50,7 +50,7 @@ public:
virtual void validate();
private:
- Ui::EventOrTodoDesktop *mUi;
+ Ui::EventOrTodoDesktop *mUi = nullptr;
};
} // IncidenceEditorNG
diff --git a/src/individualmailcomponentfactory.h b/src/individualmailcomponentfactory.h
index d367de8..ed5e7dd 100644
--- a/src/individualmailcomponentfactory.h
+++ b/src/individualmailcomponentfactory.h
@@ -50,8 +50,8 @@ private:
KCalCore::Attendee::List mUpdate;
KCalCore::Attendee::List mEdit;
KIdentityManagement::Identity mIdentity;
- MailTransport::MessageQueueJob *mQueueJob;
- OpenComposerJob *mComposerJob;
+ MailTransport::MessageQueueJob *mQueueJob = nullptr;
+ OpenComposerJob *mComposerJob = nullptr;
};
class IndividualMailITIPHandlerDialogDelegate : public Akonadi::ITIPHandlerDialogDelegate
@@ -96,7 +96,7 @@ protected:
private:
void onDialogClosed(int result);
- IndividualMailDialog *mDialog;
+ IndividualMailDialog *mDialog = nullptr;
};
class INCIDENCEEDITOR_EXPORT IndividualMailComponentFactory : public Akonadi::
diff --git a/src/individualmaildialog.h b/src/individualmaildialog.h
index fd8c1d3..87333d8 100644
--- a/src/individualmaildialog.h
+++ b/src/individualmaildialog.h
@@ -59,8 +59,8 @@ private:
void updateButtonState();
QHash<KCalCore::Attendee::Ptr, QComboBox *> mAttendeeDecision;
- QDialogButtonBox *m_buttons;
- QWidget *m_detailsWidget;
+ QDialogButtonBox *m_buttons = nullptr;
+ QWidget *m_detailsWidget = nullptr;
};
}
diff --git a/src/resourcemanagement.cpp b/src/resourcemanagement.cpp
index eb1567a..fc2ac71 100644
--- a/src/resourcemanagement.cpp
+++ b/src/resourcemanagement.cpp
@@ -210,7 +210,7 @@ void ResourceManagement::slotShowDetails(const QModelIndex &current)
void ResourceManagement::showDetails(const KLDAP::LdapObject &obj, const KLDAP::LdapClient &client)
{
// Clean up formDetails
- QLayoutItem *child;
+ QLayoutItem *child = nullptr;
while ((child = mUi->formDetails->takeAt(0)) != nullptr) {
delete child->widget();
delete child;
@@ -265,7 +265,7 @@ void ResourceManagement::slotLayoutChanged()
void ResourceManagement::slotOwnerSearchFinished()
{
// Clean up formDetails
- QLayoutItem *child;
+ QLayoutItem *child = nullptr;
while ((child = mUi->formOwner->takeAt(0)) != nullptr) {
delete child->widget();
delete child;
diff --git a/src/resourcemanagement.h b/src/resourcemanagement.h
index f1023e5..992c7c4 100644
--- a/src/resourcemanagement.h
+++ b/src/resourcemanagement.h
@@ -63,7 +63,7 @@ private:
*/
void showDetails(const KLDAP::LdapObject &, const KLDAP::LdapClient &client);
- QItemSelectionModel *selectionModel;
+ QItemSelectionModel *selectionModel = nullptr;
private Q_SLOTS:
/* A new searchString is entered
@@ -86,14 +86,14 @@ private Q_SLOTS:
private:
void readConfig();
void writeConfig();
- CalendarSupport::FreeBusyItemModel *mModel;
+ CalendarSupport::FreeBusyItemModel *mModel = nullptr;
CalendarSupport::FreeBusyCalendar mFreebusyCalendar;
ResourceItem::Ptr mOwnerItem;
ResourceItem::Ptr mSelectedItem;
EventViews::ViewCalendar::Ptr mFbCalendar;
- Ui_resourceManagement *mUi;
+ Ui_resourceManagement *mUi = nullptr;
QMap<QModelIndex, KCalCore::Event::Ptr> mFbEvent;
- EventViews::AgendaView *mAgendaView;
+ EventViews::AgendaView *mAgendaView = nullptr;
};
}
#endif // RESOURCEMANAGEMENT_H
diff --git a/src/schedulingdialog.h b/src/schedulingdialog.h
index 377514e..7ecd867 100644
--- a/src/schedulingdialog.h
+++ b/src/schedulingdialog.h
@@ -69,9 +69,9 @@ private:
QTime mSelectedTime;
int mDuration; //!< In seconds
- ConflictResolver *mResolver;
- CalendarSupport::FreePeriodModel *mPeriodModel;
- VisualFreeBusyWidget *mVisualWidget;
+ ConflictResolver *mResolver = nullptr;
+ CalendarSupport::FreePeriodModel *mPeriodModel = nullptr;
+ VisualFreeBusyWidget *mVisualWidget = nullptr;
};
}
diff --git a/src/visualfreebusywidget.h b/src/visualfreebusywidget.h
index c54c483..817c79f 100644
--- a/src/visualfreebusywidget.h
+++ b/src/visualfreebusywidget.h
@@ -66,13 +66,13 @@ protected Q_SLOTS:
private:
void splitterMoved();
- KGantt::GraphicsView *mGanttGraphicsView;
- QTreeView *mLeftView;
- RowController *mRowController;
- KGantt::DateTimeGrid *mGanttGrid;
+ KGantt::GraphicsView *mGanttGraphicsView = nullptr;
+ QTreeView *mLeftView = nullptr;
+ RowController *mRowController = nullptr;
+ KGantt::DateTimeGrid *mGanttGrid = nullptr;
- KComboBox *mScaleCombo;
- FreeBusyGanttProxyModel *mModel;
+ KComboBox *mScaleCombo = nullptr;
+ FreeBusyGanttProxyModel *mModel = nullptr;
KDateTime mDtStart, mDtEnd;
};