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

initialize some variables

parent f4e360dc
......@@ -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;
};
......
......@@ -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();
......
......@@ -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);
......
......@@ -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;
};
......
......@@ -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;
};
}
......
......@@ -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;
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
};
}
......
......@@ -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;
};
}
......
......@@ -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")),
......
......@@ -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;
};
}
......
......@@ -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;
......
......@@ -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;
};
}
......
......@@ -37,8 +37,8 @@ public:
}
public:
Ui::EventOrTodoDesktop *mUi;
int mOrigPercentCompleted;
Ui::EventOrTodoDesktop *mUi = nullptr;
int mOrigPercentCompleted = -1;
public: // slots
void sliderValueChanged(int);
......
......@@ -130,7 +130,7 @@ private:
private:
QVector<QByteArray> mTimeZones;
Ui::EventOrTodoDesktop *mUi;
Ui::EventOrTodoDesktop *mUi = nullptr;
QDate mActiveDate;
/**
......
......@@ -60,7 +60,7 @@ private:
void setupToolBar();
private:
Ui::EventOrTodoDesktop *mUi;
Ui::EventOrTodoDesktop *mUi = nullptr;
//@cond PRIVATE
Q_DECLARE_PRIVATE(IncidenceDescription)
IncidenceDescriptionPrivate *const d;
......
......@@ -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;
......
......@@ -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;
};
}
......
......@@ -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;
};
}
......
......@@ -42,7 +42,7 @@ public:
bool isDirty() const override;
private:
Ui::EventOrTodoDesktop *mUi;
Ui::EventOrTodoDesktop *mUi = nullptr;
};
}
......
......@@ -50,7 +50,7 @@ public:
virtual void validate();
private:
Ui::EventOrTodoDesktop *mUi;
Ui::EventOrTodoDesktop *mUi = nullptr;
};
} // IncidenceEditorNG
......
......@@ -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::
......
......@@ -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;
};
}
......
......@@ -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;
......
......@@ -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
......@@ -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;
};
}
......
......@@ -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;
};
......
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