Commit 0be148a9 authored by Michael Reeves's avatar Michael Reeves

Use default initalizers

parent a03df411
......@@ -122,19 +122,8 @@ class DirectoryMergeWindow::DirectoryMergeWindowPrivate : public QAbstractItemMo
explicit DirectoryMergeWindowPrivate(DirectoryMergeWindow* pDMW)
{
mWindow = pDMW;
m_pOptions = nullptr;
m_pDirectoryMergeInfo = nullptr;
m_bSimulatedMergeStarted = false;
m_bRealMergeStarted = false;
m_bError = false;
m_bSyncMode = false;
m_pStatusInfo = new StatusInfo(mWindow);
m_pStatusInfo->hide();
m_bScanning = false;
m_bCaseSensitive = true;
m_bUnfoldSubdirs = false;
m_bSkipDirStatus = false;
m_pRoot = new MergeFileInfos;
}
~DirectoryMergeWindowPrivate() override
{
......@@ -194,7 +183,7 @@ class DirectoryMergeWindow::DirectoryMergeWindowPrivate : public QAbstractItemMo
}
MergeFileInfos* rootMFI() const { return m_pRoot; }
Options* m_pOptions;
Options* m_pOptions = nullptr;
void calcDirStatus(bool bThreeDirs, const QModelIndex& mi,
int& nofFiles, int& nofDirs, int& nofEqualFiles, int& nofManualMerges);
......@@ -275,25 +264,25 @@ class DirectoryMergeWindow::DirectoryMergeWindowPrivate : public QAbstractItemMo
typedef QMap<FileKey, MergeFileInfos> t_fileMergeMap;
MergeFileInfos* m_pRoot;
MergeFileInfos* m_pRoot = new MergeFileInfos();
t_fileMergeMap m_fileMergeMap;
public:
bool m_bFollowDirLinks;
bool m_bFollowFileLinks;
bool m_bSimulatedMergeStarted;
bool m_bRealMergeStarted;
bool m_bError;
bool m_bSyncMode;
bool m_bDirectoryMerge; // if true, then merge is the default operation, otherwise it's diff.
bool m_bCaseSensitive;
bool m_bUnfoldSubdirs;
bool m_bSkipDirStatus;
bool m_bScanning; // true while in init()
DirectoryMergeInfo* m_pDirectoryMergeInfo;
StatusInfo* m_pStatusInfo;
bool m_bFollowDirLinks = false;
bool m_bFollowFileLinks = false;
bool m_bSimulatedMergeStarted = false;
bool m_bRealMergeStarted = false;
bool m_bError = false;
bool m_bSyncMode = false;
bool m_bDirectoryMerge = false; // if true, then merge is the default operation, otherwise it's diff.
bool m_bCaseSensitive = true;
bool m_bUnfoldSubdirs = false;
bool m_bSkipDirStatus = false;
bool m_bScanning = false; // true while in init()
DirectoryMergeInfo* m_pDirectoryMergeInfo = nullptr;
StatusInfo* m_pStatusInfo = nullptr;
typedef std::list<QModelIndex> MergeItemList; // linked list
MergeItemList m_mergeItemList;
......
......@@ -848,7 +848,6 @@ void FileAccess::filterList(t_DirectoryList* pDirList, const QString& filePatter
FileAccessJobHandler::FileAccessJobHandler(FileAccess* pFileAccess)
{
m_pFileAccess = pFileAccess;
m_bSuccess = false;
}
bool FileAccessJobHandler::stat(short detail, bool bWantToWrite)
......
......@@ -115,7 +115,7 @@ class FileAccess
bool interruptableReadFile(void* pDestBuffer, qint64 maxLength);
QUrl m_url;
bool m_bValidData;
bool m_bValidData = false;
//long m_fileType; // for testing only
FileAccess* m_pParent = nullptr;
......@@ -128,16 +128,16 @@ class FileAccess
QSharedPointer<QTemporaryFile> tmpFile = nullptr;
QSharedPointer<QFile> realFile = nullptr;
qint64 m_size;
qint64 m_size = 0;
QDateTime m_modificationTime = QDateTime::fromMSecsSinceEpoch(0);
bool m_bSymLink;
bool m_bFile;
bool m_bDir;
bool m_bExists;
bool m_bWritable;
bool m_bReadable;
bool m_bExecutable;
bool m_bHidden;
bool m_bSymLink = false;
bool m_bFile = false;
bool m_bDir = false;
bool m_bExists = false;
bool m_bWritable = false;
bool m_bReadable = false;
bool m_bExecutable = false;
bool m_bHidden = false;
QString m_statusText; // Might contain an error string, when the last operation didn't succeed.
};
......@@ -166,13 +166,13 @@ class FileAccessJobHandler : public QObject
bool symLink(const QUrl& linkTarget, const QUrl& linkLocation);
private:
FileAccess* m_pFileAccess;
bool m_bSuccess;
FileAccess* m_pFileAccess = nullptr;
bool m_bSuccess = false;
// Data needed during Job
qint64 m_transferredBytes;
qint64 m_transferredBytes = 0;
char* m_pTransferBuffer = nullptr; // Needed during get or put
qint64 m_maxLength;
qint64 m_maxLength = 0;
QString m_filePattern;
QString m_fileAntiPattern;
......
......@@ -125,34 +125,6 @@ KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P
pal.setColor(QPalette::Text, pal.color(QPalette::Active, QPalette::Text));
setPalette(pal);
m_pMainSplitter = nullptr;
m_pDirectoryMergeSplitter = nullptr;
m_pDirectoryMergeWindow = nullptr;
m_pCornerWidget = nullptr;
m_pMainWidget = nullptr;
m_pDiffTextWindow1 = nullptr;
m_pDiffTextWindow2 = nullptr;
m_pDiffTextWindow3 = nullptr;
m_pDiffTextWindowFrame1 = nullptr;
m_pDiffTextWindowFrame2 = nullptr;
m_pDiffTextWindowFrame3 = nullptr;
m_pDiffWindowSplitter = nullptr;
m_pOverview = nullptr;
m_bTripleDiff = false;
m_pMergeResultWindow = nullptr;
m_pMergeWindowFrame = nullptr;
m_bOutputModified = false;
m_bFileSaved = false;
m_bTimerBlock = false;
m_pHScrollBar = nullptr;
m_pDiffVScrollBar = nullptr;
m_pMergeVScrollBar = nullptr;
viewToolBar = nullptr;
m_bRecalcWordWrapPosted = false;
m_bFinishMainInit = false;
m_pEventLoopForPrinting = nullptr;
m_bLoadFiles = false;
// Needed before any file operations via FileAccess happen.
if(g_pProgressDialog == nullptr)
{
......
......@@ -267,7 +267,7 @@ class KDiff3App : public QSplitter
QAction* editCopy;
QAction* editPaste;
QAction* editSelectAll;
KToggleAction* viewToolBar;
KToggleAction* viewToolBar = nullptr;
KToggleAction* viewStatusBar;
////////////////////////////////////////////////////////////////////////
......@@ -315,33 +315,33 @@ class KDiff3App : public QSplitter
QMenu* m_pMergeEditorPopupMenu;
QSplitter* m_pMainSplitter;
QWidget* m_pMainWidget;
QWidget* m_pMergeWindowFrame;
QSplitter* m_pMainSplitter = nullptr;
QWidget* m_pMainWidget = nullptr;
QWidget* m_pMergeWindowFrame = nullptr;
ReversibleScrollBar* m_pHScrollBar = nullptr;
QScrollBar* m_pDiffVScrollBar = nullptr;
QScrollBar* m_pMergeVScrollBar;
QScrollBar* m_pMergeVScrollBar = nullptr;
DiffTextWindow* m_pDiffTextWindow1;
DiffTextWindow* m_pDiffTextWindow2;
DiffTextWindow* m_pDiffTextWindow3;
DiffTextWindowFrame* m_pDiffTextWindowFrame1;
DiffTextWindowFrame* m_pDiffTextWindowFrame2;
DiffTextWindowFrame* m_pDiffTextWindowFrame3;
QSplitter* m_pDiffWindowSplitter;
DiffTextWindow* m_pDiffTextWindow1 = nullptr;
DiffTextWindow* m_pDiffTextWindow2 = nullptr;
DiffTextWindow* m_pDiffTextWindow3 = nullptr;
DiffTextWindowFrame* m_pDiffTextWindowFrame1 = nullptr;
DiffTextWindowFrame* m_pDiffTextWindowFrame2 = nullptr;
DiffTextWindowFrame* m_pDiffTextWindowFrame3 = nullptr;
QSplitter* m_pDiffWindowSplitter = nullptr;
MergeResultWindow* m_pMergeResultWindow;
MergeResultWindow* m_pMergeResultWindow = nullptr;
WindowTitleWidget* m_pMergeResultWindowTitle;
bool m_bTripleDiff;
bool m_bTripleDiff = false;
QSplitter* m_pDirectoryMergeSplitter;
DirectoryMergeWindow* m_pDirectoryMergeWindow;
QSplitter* m_pDirectoryMergeSplitter = nullptr;
DirectoryMergeWindow* m_pDirectoryMergeWindow = nullptr;
DirectoryMergeInfo* m_pDirectoryMergeInfo;
bool m_bDirCompare = false;
Overview* m_pOverview;
Overview* m_pOverview = nullptr;
QWidget* m_pCornerWidget;
QWidget* m_pCornerWidget = nullptr;
TotalDiffStatus m_totalDiffStatus;
......@@ -366,17 +366,17 @@ class KDiff3App : public QSplitter
int m_neededLines;
int m_DTWHeight;
bool m_bOutputModified;
bool m_bFileSaved;
bool m_bTimerBlock; // Synchronization
bool m_bOutputModified = false;
bool m_bFileSaved = false;
bool m_bTimerBlock = false; // Synchronization
OptionDialog* m_pOptionDialog;
Options* m_pOptions;
FindDialog* m_pFindDialog;
void mainInit(TotalDiffStatus* pTotalDiffStatus = nullptr, bool bLoadFiles = true, bool bUseCurrentEncoding = false);
bool m_bFinishMainInit;
bool m_bLoadFiles;
bool m_bFinishMainInit = false;
bool m_bLoadFiles = false;
void mainWindowEnable(bool bEnable);
virtual void wheelEvent(QWheelEvent* pWheelEvent) override;
......@@ -398,7 +398,7 @@ class KDiff3App : public QSplitter
bool m_bAutoFlag = false;
bool m_bAutoMode = false;
void recalcWordWrap(int visibleTextWidthForPrinting = -1);
bool m_bRecalcWordWrapPosted;
bool m_bRecalcWordWrapPosted = false;
void setHScrollBarRange();
int m_iCumulativeWheelDelta;
......
......@@ -128,9 +128,9 @@ public:
// Directory Merge options
bool m_bDmSyncMode;
bool m_bDmRecursiveDirs;
bool m_bDmFollowFileLinks;
bool m_bDmFollowDirLinks;
bool m_bDmFindHidden;
bool m_bDmFollowFileLinks = false;
bool m_bDmFollowDirLinks = false;
bool m_bDmFindHidden = true;
bool m_bDmCreateBakFiles;
bool m_bDmBinaryComparison;
bool m_bDmFullAnalysis;
......
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