Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 2381a96f authored by Laurent Montel's avatar Laurent Montel 😁

Make sure to initialize value

parent 57b309b7
......@@ -47,10 +47,7 @@ AbstractImportExportJob::AbstractImportExportJob(QObject *parent, ArchiveStorage
, mTypeSelected(typeSelected)
, mArchiveStorage(archiveStorage)
, mIdentityManager(KIdentityManagement::IdentityManager::self())
, mTempDir(nullptr)
, mArchiveDirectory(nullptr)
, mNumberOfStep(numberOfStep)
, mCreateResource(nullptr)
, mIndex(-1)
, mImportExportProgressIndicator(new ImportExportProgressIndicatorBase(this))
{
......
......@@ -121,15 +121,15 @@ protected:
QString mTempDirName;
Utils::StoredTypes mTypeSelected;
ArchiveStorage *mArchiveStorage;
KIdentityManagement::IdentityManager *mIdentityManager;
QTemporaryDir *mTempDir;
const KArchiveDirectory *mArchiveDirectory;
int mNumberOfStep;
PimCommon::CreateResource *mCreateResource;
ArchiveStorage *mArchiveStorage = nullptr;
KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
QTemporaryDir *mTempDir = nullptr;
const KArchiveDirectory *mArchiveDirectory = nullptr;
int mNumberOfStep = -1;
PimCommon::CreateResource *mCreateResource = nullptr;
QStringList mAgentPaths;
QList<Utils::StoredType> mListStep;
int mIndex;
int mIndex = -1;
static int sArchiveVersion;
private:
......
......@@ -33,7 +33,6 @@
ExportAddressbookJob::ExportAddressbookJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
, mIndexIdentifier(0)
{
}
......
......@@ -40,7 +40,7 @@ private Q_SLOTS:
void slotAddressbookJobTerminated();
private:
void backupConfig();
int mIndexIdentifier;
int mIndexIdentifier = 0;
};
#endif // EXPORTADDRESSBOOKJOB_H
......@@ -34,7 +34,6 @@
ExportAlarmJob::ExportAlarmJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
, mIndexIdentifier(0)
{
}
......
......@@ -40,7 +40,7 @@ private Q_SLOTS:
void slotWriteNextArchiveResource();
private:
void backupConfig();
int mIndexIdentifier;
int mIndexIdentifier = 0;
};
#endif // EXPORTALARMJOB_H
......@@ -39,7 +39,7 @@ Q_SIGNALS:
void error(const QString &);
private:
KZip *mArchive;
KZip *mArchive = nullptr;
};
#endif // ARCHIVESTORAGE_H
......@@ -35,7 +35,6 @@
ExportCalendarJob::ExportCalendarJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
, mIndexIdentifier(0)
{
}
......
......@@ -40,7 +40,7 @@ private Q_SLOTS:
void slotWriteNextArchiveResource();
private:
void backupConfig();
int mIndexIdentifier;
int mIndexIdentifier = 0;
};
#endif // EXPORTCALENDARJOB_H
......@@ -29,8 +29,6 @@
ExportResourceArchiveJob::ExportResourceArchiveJob(QObject *parent)
: QObject(parent)
, mZip(nullptr)
, mThread(nullptr)
{
}
......
......@@ -57,8 +57,8 @@ private:
QString mUrl;
QString mArchivePath;
QString mIdentifier;
KZip *mZip;
PimSettingBackupThread *mThread;
KZip *mZip = nullptr;
PimSettingBackupThread *mThread = nullptr;
};
#endif // EXPORTRESOURCEARCHIVEJOB_H
......@@ -22,7 +22,6 @@
ImportExportProgressIndicatorBase::ImportExportProgressIndicatorBase(QObject *parent)
: QObject(parent)
, mNumberOfStep(0)
{
}
......
......@@ -46,7 +46,7 @@ Q_SIGNALS:
void canceled();
protected:
int mNumberOfStep;
int mNumberOfStep = 0;
};
#endif // IMPORTEXPORTPROGRESSINDICATORBASE_H
......@@ -47,8 +47,6 @@
ExportMailJob::ExportMailJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
, mArchiveTime(QDateTime::currentDateTime())
, mIndexIdentifier(0)
{
}
......
......@@ -52,8 +52,8 @@ private:
void backupResources();
void backupConfig();
void backupIdentity();
QDateTime mArchiveTime;
int mIndexIdentifier;
QDateTime mArchiveTime = QDateTime::currentDateTime();
int mIndexIdentifier = 0;
};
#endif // ExportMailJob_H
......@@ -33,7 +33,6 @@
ExportNotesJob::ExportNotesJob(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: AbstractImportExportJob(parent, archiveStorage, typeSelected, numberOfStep)
, mIndexIdentifier(0)
{
}
......
......@@ -40,7 +40,7 @@ private Q_SLOTS:
private:
void backupConfig();
void backupTheme();
int mIndexIdentifier;
int mIndexIdentifier = 0;
};
#endif // EXPORTNOTESJOB_H
......@@ -41,7 +41,7 @@ private:
QString mUrl;
QString mArchivePath;
QString mArchiveName;
KZip *mZip;
KZip *mZip = nullptr;
};
#endif // PIMSETTINGBACKUPTHREAD_H
......@@ -55,10 +55,10 @@ public:
void expunge(Akonadi::Collection::Id col, bool sync) override;
private:
KIdentityManagement::IdentityManager *mIdentityManager;
MailCommon::FolderCollectionMonitor *mFolderCollectionMonitor;
Akonadi::EntityTreeModel *mEntityTreeModel;
Akonadi::EntityMimeTypeFilterModel *mCollectionModel;
KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
MailCommon::FolderCollectionMonitor *mFolderCollectionMonitor = nullptr;
Akonadi::EntityTreeModel *mEntityTreeModel = nullptr;
Akonadi::EntityMimeTypeFilterModel *mCollectionModel = nullptr;
};
#endif
......@@ -35,7 +35,7 @@ public:
QString importDataInfoPath();
private:
QTemporaryDir *mTempDir;
QTemporaryDir *mTempDir = nullptr;
QString mFilename;
};
......
......@@ -52,9 +52,6 @@
PimSettingsBackupRestore::PimSettingsBackupRestore(QObject *parent)
: QObject(parent)
, mImportExportData(nullptr)
, mAction(Backup)
, mArchiveStorage(nullptr)
{
}
......
......@@ -60,7 +60,7 @@ protected:
virtual bool continueToRestore();
virtual void addExportProgressIndicator();
AbstractImportExportJob *mImportExportData;
AbstractImportExportJob *mImportExportData = nullptr;
private:
enum Action {
Backup,
......@@ -77,8 +77,8 @@ private:
QString mExportedInfoFileName;
QHash<Utils::AppsType, Utils::importExportParameters> mStored;
QHash<Utils::AppsType, Utils::importExportParameters>::const_iterator mStoreIterator;
Action mAction;
ArchiveStorage *mArchiveStorage;
Action mAction = Backup;
ArchiveStorage *mArchiveStorage = nullptr;
};
#endif // PIMSETTINGSBACKUPRESTORE_H
......@@ -29,8 +29,6 @@
SynchronizeResourceJob::SynchronizeResourceJob(QObject *parent)
: QObject(parent)
, mIndex(0)
, mOnlyCollection(true)
{
}
......
......@@ -46,8 +46,8 @@ private Q_SLOTS:
private:
QStringList mListResources;
int mIndex;
bool mOnlyCollection;
int mIndex = 0;
bool mOnlyCollection = true;
};
#endif // SYNCHRONIZERESOURCEJOB_H
......@@ -23,8 +23,6 @@
#include <QXmlStreamWriter>
TemplateSelection::TemplateSelection()
: mStreamWriter(nullptr)
, mStreamReader(nullptr)
{
}
......
......@@ -40,8 +40,8 @@ public:
private:
Utils::StoredTypes loadStoredTypes(int &numberOfStep);
void saveParameters(Utils::StoredTypes type);
QXmlStreamWriter *mStreamWriter;
QXmlStreamReader *mStreamReader;
QXmlStreamWriter *mStreamWriter = nullptr;
QXmlStreamReader *mStreamReader = nullptr;
QString mSaveTemplate;
};
......
......@@ -35,7 +35,7 @@ private:
void readConfig();
void writeConfig();
void loadStructure();
KPIMTextEdit::PlainTextEditorWidget *mEditor;
KPIMTextEdit::PlainTextEditorWidget *mEditor = nullptr;
};
#endif // BACKUPFILESTRUCTUREINFODIALOG_H
......@@ -33,7 +33,7 @@ private Q_SLOTS:
void slotAccepted();
private:
PimSettingExporterConfigureWidget *mConfigureWidget;
PimSettingExporterConfigureWidget *mConfigureWidget = nullptr;
};
#endif // PIMSETTINGEXPORTERCONFIGUREDIALOG_H
......@@ -48,10 +48,10 @@ private:
void writeConfig();
void loadDefaultTemplate();
void saveDefaultTemplate();
SelectionTypeTreeWidget *mSelectionTreeWidget;
QCheckBox *mUseTemplateByDefault;
QPushButton *mSaveTemplate;
QPushButton *mLoadTemplate;
SelectionTypeTreeWidget *mSelectionTreeWidget = nullptr;
QCheckBox *mUseTemplateByDefault = nullptr;
QPushButton *mSaveTemplate = nullptr;
QPushButton *mLoadTemplate = nullptr;
};
#endif // SELECTIONTYPEDIALOG_H
......@@ -48,7 +48,7 @@ private:
QTreeWidgetItem *addItem(QTreeWidgetItem *parent, const QString &name);
QString mFileName;
QString mLogFile;
QTreeWidget *mTreeWidget;
QTreeWidget *mTreeWidget = nullptr;
};
#endif // SHOWARCHIVESTRUCTUREDIALOG_H
......@@ -45,7 +45,7 @@ private:
void readConfig();
void writeConfig();
void selectItem(bool state);
QListWidget *mListResourceWidget;
QListWidget *mListResourceWidget = nullptr;
};
#endif // SYNCHRONIZERESOURCEDIALOG_H
......@@ -26,7 +26,6 @@
ImportExportProgressIndicatorGui::ImportExportProgressIndicatorGui(QWidget *parentWidget, QObject *parent)
: ImportExportProgressIndicatorBase(parent)
, mProgressDialog(nullptr)
, mParentWidget(parentWidget)
{
}
......
......@@ -40,8 +40,8 @@ public:
void showErrorMessage(const QString &message, const QString &title) override;
private:
QProgressDialog *mProgressDialog;
QWidget *mParentWidget;
QProgressDialog *mProgressDialog = nullptr;
QWidget *mParentWidget = nullptr;
};
#endif // IMPORTEXPORTPROGRESSINDICATORGUI_H
......@@ -26,8 +26,6 @@
FullSynchronizeResourcesJob::FullSynchronizeResourcesJob(QObject *parent)
: QObject(parent)
, mWindowParent(nullptr)
, mProgressDialog(nullptr)
{
}
......
......@@ -48,8 +48,8 @@ private Q_SLOTS:
void slotSynchronizeFinished();
private:
QStringList mResources;
QWidget *mWindowParent;
QProgressDialog *mProgressDialog;
QWidget *mWindowParent = nullptr;
QProgressDialog *mProgressDialog = nullptr;
};
#endif // FULLSYNCHRONIZERESOURCESJOB_H
......@@ -28,7 +28,6 @@
PimSettingCommandLineOption::PimSettingCommandLineOption(QObject *parent)
: QObject(parent)
, mExporterWindow(nullptr)
{
}
......
......@@ -41,7 +41,7 @@ public Q_SLOTS:
private:
QCommandLineParser mParser;
PimSettingExporterWindow *mExporterWindow;
PimSettingExporterWindow *mExporterWindow = nullptr;
};
#endif // PIMSETTINGCOMMANDLINEOPTION_H
......@@ -61,13 +61,6 @@
PimSettingExporterWindow::PimSettingExporterWindow(QWidget *parent)
: KXmlGuiWindow(parent)
, mBackupAction(nullptr)
, mRestoreAction(nullptr)
, mSaveLogAction(nullptr)
, mArchiveStructureInfo(nullptr)
, mShowArchiveInformationsAction(nullptr)
, mPimSettingsBackupRestoreUI(nullptr)
, mTrayIcon(nullptr)
{
//Initialize filtermanager
(void)MailCommon::FilterManager::instance();
......
......@@ -63,19 +63,19 @@ private:
void loadData(const QString &filename = QString(), const QString &templateFile = QString());
void setupActions(bool canZipFile);
void showFinishInformation();
LogWidget *mLogWidget;
KRecentFilesAction *mRecentFilesAction;
QAction *mBackupAction;
QAction *mRestoreAction;
QAction *mSaveLogAction;
QAction *mArchiveStructureInfo;
QAction *mShowArchiveInformationsAction;
QAction *mShowArchiveInformationsAboutCurrentArchiveAction;
PimSettingsBackupRestoreUI *mPimSettingsBackupRestoreUI;
LogWidget *mLogWidget= nullptr;
KRecentFilesAction *mRecentFilesAction= nullptr;
QAction *mBackupAction= nullptr;
QAction *mRestoreAction= nullptr;
QAction *mSaveLogAction= nullptr;
QAction *mArchiveStructureInfo= nullptr;
QAction *mShowArchiveInformationsAction= nullptr;
QAction *mShowArchiveInformationsAboutCurrentArchiveAction= nullptr;
PimSettingsBackupRestoreUI *mPimSettingsBackupRestoreUI= nullptr;
QString mLastArchiveFileName;
// Name, identifier
QHash<QString, QString> mNeedToSyncResources;
PimSettingsTrayIcon *mTrayIcon;
PimSettingsTrayIcon *mTrayIcon = nullptr;
};
#endif /* PIMSETTINGEXPORTERWINDOW_H */
......@@ -33,7 +33,7 @@ protected:
bool continueToRestore() override;
void addExportProgressIndicator() override;
private:
QWidget *mParentWidget;
QWidget *mParentWidget = nullptr;
};
#endif // PIMSETTINGSBACKUPRESTOREUI_H
......@@ -42,7 +42,7 @@ public:
bool isEmpty() const;
private:
KPIM::CustomLogWidget *mCustomLogWidget;
KPIM::CustomLogWidget *mCustomLogWidget = nullptr;
};
#endif // LOGWIDGET_H
......@@ -36,9 +36,9 @@ public Q_SLOTS:
private:
void initialize();
QCheckBox *mAlwaysOverrideFile;
QCheckBox *mAlwaysOverrideDirectory;
QCheckBox *mAlwaysMergeConfigFile;
QCheckBox *mAlwaysOverrideFile = nullptr;
QCheckBox *mAlwaysOverrideDirectory = nullptr;
QCheckBox *mAlwaysMergeConfigFile = nullptr;
};
#endif // PIMSETTINGEXPORTERCONFIGUREWIDGET_H
......@@ -66,13 +66,13 @@ private:
QString templateSelectionToString();
bool removeNotSelectedItem(QTreeWidgetItem *parent);
QTreeWidgetItem *mKmailItem;
QTreeWidgetItem *mKalarmItem;
QTreeWidgetItem *mKaddressbookItem;
QTreeWidgetItem *mKorganizerItem;
QTreeWidgetItem *mKNotesItem;
QTreeWidgetItem *mAkregatorItem;
QTreeWidgetItem *mBlogiloItem;
QTreeWidgetItem *mKmailItem = nullptr;
QTreeWidgetItem *mKalarmItem = nullptr;
QTreeWidgetItem *mKaddressbookItem = nullptr;
QTreeWidgetItem *mKorganizerItem = nullptr;
QTreeWidgetItem *mKNotesItem = nullptr;
QTreeWidgetItem *mAkregatorItem = nullptr;
QTreeWidgetItem *mBlogiloItem = nullptr;
};
#endif // SELECTIONTYPETREEWIDGET_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