Commit 25217cd7 authored by Laurent Montel's avatar Laurent Montel 😁

Initialize variables

parent e5b25cbd
......@@ -64,7 +64,7 @@ private:
KMime::Message::Ptr loadMessageFromFile(const QString &filename);
KMime::Message::Ptr createPlainTestMessageWithMultiEmails();
KMime::Message::Ptr loadMessage(const QString &filename);
KIdentityManagement::IdentityManager *mIdentMan;
KIdentityManagement::IdentityManager *mIdentMan = nullptr;
};
#endif
......@@ -65,8 +65,8 @@ public:
}
private:
MimeTreeParser::HtmlWriter *mWriter;
MessageViewer::CSSHelperBase *mCSSHelper;
MimeTreeParser::HtmlWriter *mWriter = nullptr;
MessageViewer::CSSHelperBase *mCSSHelper = nullptr;
};
}
......
......@@ -46,7 +46,7 @@ public:
QString toCleanHtml() const;
PimCommon::AutoCorrection *autoCorrection = nullptr;
RichTextComposerNg *richtextComposer = nullptr;
MessageComposer::RichTextComposerSignatures *richTextComposerSignatures;
MessageComposer::RichTextComposerSignatures *richTextComposerSignatures = nullptr;
};
RichTextComposerNg::RichTextComposerNg(QWidget *parent)
......
......@@ -35,7 +35,7 @@ public:
}
void cleanWhitespaceHelper(const QRegExp &regExp, const QString &newText, const KIdentityManagement::Signature &sig);
QList<QPair<int, int> > signaturePositions(const KIdentityManagement::Signature &sig) const;
RichTextComposerNg *richTextComposer;
RichTextComposerNg *richTextComposer = nullptr;
};
RichTextComposerSignatures::RichTextComposerSignatures(MessageComposer::RichTextComposerNg *composer, QObject *parent)
......
......@@ -88,17 +88,17 @@ public:
QList<KMime::Message::Ptr> resultMessages;
// Stuff that the application plays with.
GlobalPart *globalPart;
InfoPart *infoPart;
TextPart *textPart;
GlobalPart *globalPart = nullptr;
InfoPart *infoPart = nullptr;
TextPart *textPart = nullptr;
AttachmentPart::List attachmentParts;
// attachments with different sign/encrypt settings from
// main message body. added at the end of the process
AttachmentPart::List lateAttachmentParts;
// Stuff that we play with.
KMime::Message *skeletonMessage;
KMime::Content *resultContent;
KMime::Message *skeletonMessage = nullptr;
KMime::Content *resultContent = nullptr;
Q_DECLARE_PUBLIC(Composer)
};
......@@ -311,8 +311,8 @@ void ComposerPrivate::contentJobFinished(KJob *job)
}
qCDebug(MESSAGECOMPOSER_LOG) << "composing final message";
KMime::Message *headers;
KMime::Content *resultContent;
KMime::Message *headers = nullptr;
KMime::Content *resultContent = nullptr;
std::vector<GpgME::Key> keys;
QStringList recipients;
......
......@@ -39,7 +39,7 @@ public:
}
Akonadi::Collection mCollection;
FollowUpReminder::FollowUpReminderInfo *mInfo;
FollowUpReminder::FollowUpReminderInfo *mInfo = nullptr;
};
FollowupReminderCreateJob::FollowupReminderCreateJob(QObject *parent)
......
......@@ -42,15 +42,12 @@ class MessageComposer::FollowUpReminderSelectDateDialogPrivate
{
public:
FollowUpReminderSelectDateDialogPrivate()
: mDateComboBox(nullptr),
mCollectionCombobox(nullptr),
mOkButton(nullptr)
{
}
KDateComboBox *mDateComboBox;
Akonadi::CollectionComboBox *mCollectionCombobox;
QPushButton *mOkButton;
KDateComboBox *mDateComboBox = nullptr;
Akonadi::CollectionComboBox *mCollectionCombobox = nullptr;
QPushButton *mOkButton = nullptr;
};
FollowUpReminderSelectDateDialog::FollowUpReminderSelectDateDialog(QWidget *parent, QAbstractItemModel *model)
......
......@@ -60,7 +60,7 @@ private:
KMime::Message::Ptr mMsg;
KMime::Message::Ptr mOrigMsg;
Akonadi::Collection mCollection;
KIdentityManagement::IdentityManager *mIdentityManager;
KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
};
}
......
......@@ -254,7 +254,7 @@ private:
QByteArray getRefStr(const KMime::Message::Ptr &msg);
KMime::Content *createForwardAttachmentMessage(const KMime::Message::Ptr &fwdMsg);
KIdentityManagement::IdentityManager *m_identityManager;
KIdentityManagement::IdentityManager *m_identityManager = nullptr;
// Required parts to create messages
KMime::Message::Ptr m_origMsg;
Akonadi::Item::Id m_folderId;
......@@ -265,7 +265,7 @@ private:
// Optional settings the calling class may set
MessageComposer::ReplyStrategy m_replyStrategy;
QString m_selection, m_template;
bool m_quote;
bool m_quote = false;
KMime::Types::Mailbox::List m_mailingListAddresses;
Akonadi::Item::Id m_id;
......
......@@ -60,8 +60,8 @@ private:
KMime::Message::Ptr mMsg;
KMime::Message::Ptr mOrigMsg;
Akonadi::Collection mCollection;
bool mReplyAll;
KIdentityManagement::IdentityManager *mIdentityManager;
bool mReplyAll = false;
KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
};
}
......
......@@ -46,7 +46,7 @@ private:
};
void initialize();
void addImageFormat(const QString &format, const QString &mimetype);
QListWidget *mListWidget;
QListWidget *mListWidget = nullptr;
};
class ImageScalingSelectFormat : public QWidget
......@@ -66,8 +66,8 @@ private Q_SLOTS:
void slotSelectFormat();
private:
QLineEdit *mFormat;
QPushButton *mSelectFormat;
QLineEdit *mFormat = nullptr;
QPushButton *mSelectFormat = nullptr;
};
}
......
......@@ -33,10 +33,7 @@ class MessageComposer::ImageScalingWidgetPrivate
{
public:
ImageScalingWidgetPrivate()
: ui(new Ui::ImageScalingWidget),
mSourceFilenameFilterGroup(nullptr),
mRecipientFilterGroup(nullptr),
mWasChanged(false)
: ui(new Ui::ImageScalingWidget)
{
}
~ImageScalingWidgetPrivate()
......@@ -44,10 +41,10 @@ public:
delete ui;
}
Ui::ImageScalingWidget *ui;
QButtonGroup *mSourceFilenameFilterGroup;
QButtonGroup *mRecipientFilterGroup;
bool mWasChanged;
Ui::ImageScalingWidget *ui = nullptr;
QButtonGroup *mSourceFilenameFilterGroup = nullptr;
QButtonGroup *mRecipientFilterGroup = nullptr;
bool mWasChanged = false;
};
ImageScalingWidget::ImageScalingWidget(QWidget *parent)
......
......@@ -33,17 +33,15 @@ class ContentJobBasePrivate : public JobBasePrivate
public:
explicit ContentJobBasePrivate(ContentJobBase *qq)
: JobBasePrivate(qq)
, resultContent(nullptr)
, extraContent(nullptr)
{
}
void init(QObject *parent);
void doNextSubjob();
KMime::Content *resultContent;
KMime::Content::List subjobContents;
KMime::Content *extraContent;
KMime::Content *resultContent = nullptr;
KMime::Content *extraContent = nullptr;
Q_DECLARE_PUBLIC(ContentJobBase)
};
......
......@@ -45,11 +45,10 @@ class MessageComposer::EncryptJobPrivate : public ContentJobBasePrivate
public:
EncryptJobPrivate(EncryptJob *qq)
: ContentJobBasePrivate(qq)
, content(nullptr)
{
}
KMime::Content *content;
KMime::Content *content = nullptr;
std::vector<GpgME::Key> keys;
Kleo::CryptoMessageFormat format;
QStringList recipients;
......
......@@ -54,7 +54,7 @@ public:
SinglepartJob *createHtmlJob();
SinglepartJob *createImageJob(const QSharedPointer<KPIMTextEdit::EmbeddedImage> &image);
TextPart *textPart;
TextPart *textPart = nullptr;
QByteArray chosenCharset;
QString sourcePlainText;
QByteArray encodedPlainText;
......
......@@ -49,7 +49,7 @@ public:
{
}
KMime::Content *content;
KMime::Content *content = nullptr;
std::vector<GpgME::Key> signers;
Kleo::CryptoMessageFormat format;
......
......@@ -48,7 +48,7 @@ public:
{
}
KMime::Content *content;
KMime::Content *content = nullptr;
std::vector<GpgME::Key> signers;
Kleo::CryptoMessageFormat format;
......
......@@ -48,11 +48,11 @@ public:
bool chooseCTE();
QByteArray data;
KMime::Headers::ContentDescription *contentDescription;
KMime::Headers::ContentDisposition *contentDisposition;
KMime::Headers::ContentID *contentID;
KMime::Headers::ContentTransferEncoding *contentTransferEncoding;
KMime::Headers::ContentType *contentType;
KMime::Headers::ContentDescription *contentDescription = nullptr;
KMime::Headers::ContentDisposition *contentDisposition = nullptr;
KMime::Headers::ContentID *contentID = nullptr;
KMime::Headers::ContentTransferEncoding *contentTransferEncoding = nullptr;
KMime::Headers::ContentType *contentType = nullptr;
Q_DECLARE_PUBLIC(SinglepartJob)
};
......
......@@ -43,17 +43,14 @@ class MessageComposer::SkeletonMessageJobPrivate : public JobBasePrivate
public:
SkeletonMessageJobPrivate(SkeletonMessageJob *qq)
: JobBasePrivate(qq)
, infoPart(nullptr)
, globalPart(nullptr)
, message(nullptr)
{
}
void doStart(); // slot
InfoPart *infoPart;
GlobalPart *globalPart;
KMime::Message *message;
InfoPart *infoPart = nullptr;
GlobalPart *globalPart = nullptr;
KMime::Message *message = nullptr;
Q_DECLARE_PUBLIC(SkeletonMessageJob)
};
......
......@@ -32,11 +32,10 @@ class MessageComposer::TransparentJobPrivate : public MessageComposer::ContentJo
public:
TransparentJobPrivate(TransparentJob *qq)
: ContentJobBasePrivate(qq)
, content(nullptr)
{
}
KMime::Content *content;
KMime::Content *content = nullptr;
Q_DECLARE_PUBLIC(TransparentJob)
};
......
......@@ -25,20 +25,15 @@ class Q_DECL_HIDDEN GlobalPart::Private
{
public:
Private()
: guiEnabled(true),
parentWidgetForGui(nullptr),
fallbackCharsetEnabled(false),
allow8Bit(false),
MDNRequested(false)
{
}
bool guiEnabled;
QWidget *parentWidgetForGui;
bool fallbackCharsetEnabled;
bool guiEnabled = true;
QWidget *parentWidgetForGui = nullptr;
bool fallbackCharsetEnabled = false;
QList<QByteArray> charsets;
bool allow8Bit;
bool MDNRequested;
bool allow8Bit = false;
bool MDNRequested = false;
};
GlobalPart::GlobalPart(QObject *parent)
......
......@@ -48,16 +48,13 @@ class MessageComposer::PluginEditorInterfacePrivate
{
public:
PluginEditorInterfacePrivate()
: mParentWidget(nullptr),
mRichTextEditor(nullptr),
plugin(nullptr)
{
}
ActionType mActionType;
QWidget *mParentWidget;
KPIMTextEdit::RichTextEditor *mRichTextEditor;
PluginEditor *plugin;
QWidget *mParentWidget = nullptr;
KPIMTextEdit::RichTextEditor *mRichTextEditor = nullptr;
PluginEditor *plugin = nullptr;
};
PluginEditorInterface::PluginEditorInterface(QObject *parent)
......
......@@ -52,7 +52,7 @@ public:
Type type() const;
private:
QAction *mAction;
QAction *mAction = nullptr;
Type mType;
};
......
......@@ -33,18 +33,15 @@ class PluginEditorInfo
{
public:
PluginEditorInfo()
: order(0),
plugin(nullptr),
isEnabled(true)
{
}
QString metaDataFileNameBaseName;
QString metaDataFileName;
PimCommon::PluginUtilData pluginData;
int order;
PluginEditor *plugin;
bool isEnabled;
int order = 0;
PluginEditor *plugin = nullptr;
bool isEnabled = true;
};
namespace
......
......@@ -34,16 +34,14 @@ class PluginEditorInitInfo
{
public:
PluginEditorInitInfo()
: plugin(nullptr)
, isEnabled(true)
{
}
QString metaDataFileNameBaseName;
QString metaDataFileName;
PimCommon::PluginUtilData pluginData;
PluginEditorInit *plugin;
bool isEnabled;
PluginEditorInit *plugin = nullptr;
bool isEnabled = true;
};
namespace {
......
......@@ -36,10 +36,10 @@ public:
void reposition();
private:
QWidget *mMaster;
QWidget *mSlave;
QWidget *mMaster = nullptr;
QWidget *mSlave = nullptr;
Mode mMode;
Mode mMode = Bottom;
};
}
......
......@@ -71,15 +71,12 @@ class MessageComposer::RecipientsEditorPrivate
{
public:
RecipientsEditorPrivate()
: mRecentAddressConfig(nullptr),
mSideWidget(nullptr),
mSkipTotal(false)
{
}
KConfig *mRecentAddressConfig;
RecipientsEditorSideWidget *mSideWidget;
bool mSkipTotal;
KConfig *mRecentAddressConfig = nullptr;
RecipientsEditorSideWidget *mSideWidget = nullptr;
bool mSkipTotal = false;
};
RecipientsEditor::RecipientsEditor(QWidget *parent)
......
......@@ -53,7 +53,7 @@ private:
virtual ~MessageComposerSettings();
static MessageComposerSettings *mSelf;
QTimer *mConfigSyncTimer;
QTimer *mConfigSyncTimer = nullptr;
};
......
......@@ -41,7 +41,7 @@ public Q_SLOTS:
void slotClose();
private:
MessageComposer::RecipientsEditor *mRecipients;
MessageComposer::RecipientsEditor *mRecipients = nullptr;
};
#endif
......@@ -74,9 +74,9 @@ public:
bool mReadOnly;
AttachmentPart::Ptr mPart;
Ui::AttachmentPropertiesDialog *ui;
Ui::AttachmentPropertiesDialogReadOnly *uiReadOnly;
QVBoxLayout *mainLayout;
Ui::AttachmentPropertiesDialog *ui = nullptr;
Ui::AttachmentPropertiesDialogReadOnly *uiReadOnly = nullptr;
QVBoxLayout *mainLayout = nullptr;
};
void AttachmentPropertiesDialog::Private::init(const AttachmentPart::Ptr &part, bool readOnly)
......
......@@ -72,7 +72,7 @@ MessageCore::ImageCollector::~ImageCollector()
void MessageCore::ImageCollector::collectImagesFrom(KMime::Content *node)
{
KMime::Content *parent;
KMime::Content *parent = nullptr;
while (node) {
parent = node->parent();
......
......@@ -238,7 +238,7 @@ public:
Item *const q;
QList< Item * > *mChildItems; ///< List of children, may be 0
Item *mParent; ///< The parent view item
Item *mParent = nullptr; ///< The parent view item
time_t mMaxDate; ///< The maximum date in the subtree
time_t mDate; ///< The date of the message (or group date)
size_t mSize; ///< The size of the message in bytes
......
......@@ -68,7 +68,7 @@ private:
QList< Widget * > mWidgetList;
QHash< QString, Aggregation * > mAggregations;
QHash< QString, Theme * > mThemes;
KMime::DateFormatter *mDateFormatter;
KMime::DateFormatter *mDateFormatter = nullptr;
QString mCachedLocalizedUnknownText;
public:
......
......@@ -113,7 +113,7 @@ private Q_SLOTS:
private:
QHash<KJob *, MessageItemPrivate *> mRequests;
QCache<Akonadi::Tag::Id, Akonadi::Tag> mCache;
Akonadi::Monitor *mMonitor;
Akonadi::Monitor *mMonitor = nullptr;
};
}
......
......@@ -34,7 +34,7 @@ class ModelInvariantIndex::Private
public:
int mModelIndexRow; ///< The row that this index referenced at the time it was emitted
uint mRowMapperSerial; ///< The serial that was current in the RowMapper at the time the invariant index was emitted
ModelInvariantRowMapper *mRowMapper; ///< The mapper that this invariant index is attached to
ModelInvariantRowMapper *mRowMapper = nullptr; ///< The mapper that this invariant index is attached to
int modelIndexRow() const
{
......
......@@ -71,7 +71,7 @@ public:
uint mRemovedShiftCount; ///< The number of shifts that we have completely processed
int mLazyUpdateChunkInterval; ///< Msecs: how much time we spend inside a lazy update chunk
int mLazyUpdateIdleInterval; ///< Msecs: how much time we idle between lazy update chunks
QTimer *mUpdateTimer; ///< Background lazy update timer
QTimer *mUpdateTimer = nullptr; ///< Background lazy update timer
};
} // Core
......
......@@ -615,7 +615,7 @@ public:
QList< Row * > mGroupHeaderRows; ///< The list of rows we display in this column for a GroupHeaderItem
QList< Row * > mMessageRows; ///< The list of rows we display in this column for a MessageItem
SharedRuntimeData *mSharedRuntimeData; ///< A pointer to the shared runtime data: shared between all instances of a theme with the same id
SharedRuntimeData *mSharedRuntimeData = nullptr; ///< A pointer to the shared runtime data: shared between all instances of a theme with the same id
public:
/**
* Returns the label set for this column
......
......@@ -82,8 +82,8 @@ private Q_SLOTS:
void slotClearButtonClicked();
void slotFilterActionChanged(const QList<Akonadi::MessageStatus> &lst);
private:
SearchLineStatus *mSearchEdit;
KComboBox *mTagFilterCombo;
SearchLineStatus *mSearchEdit = nullptr;
KComboBox *mTagFilterCombo = nullptr;
QList<Akonadi::MessageStatus> mLstStatus;
};
}
......
......@@ -62,7 +62,7 @@ private:
Akonadi::Collection mCollection;
Akonadi::Collection::List mCollections;
Akonadi::Search::PIM::IndexedItems *mIndexedItems;
Akonadi::Search::PIM::IndexedItems *mIndexedItems = nullptr;
};
}
}
......
......@@ -92,23 +92,23 @@ public:
Pane *const q;
KXMLGUIClient *mXmlGuiClient;
KActionMenu *mActionMenu;
KXMLGUIClient *mXmlGuiClient = nullptr;
KActionMenu *mActionMenu = nullptr;
QAbstractItemModel *mModel;
QItemSelectionModel *mSelectionModel;
QAbstractItemModel *mModel = nullptr;
QItemSelectionModel *mSelectionModel = nullptr;
Core::PreSelectionMode mPreSelectionMode;
QHash<Widget *, QItemSelectionModel *> mWidgetSelectionHash;
QVector<const QAbstractProxyModel *> mProxyStack;
QToolButton *mNewTabButton;
QToolButton *mCloseTabButton;
QAction *mCloseTabAction;
QAction *mActivateNextTabAction;
QAction *mActivatePreviousTabAction;
QAction *mMoveTabLeftAction;
QAction *mMoveTabRightAction;
QToolButton *mNewTabButton = nullptr;
QToolButton *mCloseTabButton = nullptr;
QAction *mCloseTabAction = nullptr;
QAction *mActivateNextTabAction = nullptr;
QAction *mActivatePreviousTabAction = nullptr;
QAction *mMoveTabLeftAction = nullptr;
QAction *mMoveTabRightAction = nullptr;
bool mPreferEmptyTab;
int mMaxTabCreated;
};
......
......@@ -58,15 +58,12 @@ public:
StorageModel *const q;
QAbstractItemModel *mModel;
QAbstractItemModel *mChildrenFilterModel;
QItemSelectionModel *mSelectionModel;
QAbstractItemModel *mModel = nullptr;
QAbstractItemModel *mChildrenFilterModel = nullptr;
QItemSelectionModel *mSelectionModel = nullptr;
Private(StorageModel *owner)
: q(owner),
mModel(nullptr),
mChildrenFilterModel(nullptr),
mSelectionModel(nullptr)
: q(owner)
{}
};
......