Mercurial > hg > forks > UniversalIndentGUI
changeset 716:b9123ff53106
Run cppcheck over the code and removed some possible problems.
git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@987 59b1889a-e5ac-428c-b0c7-476e01d41282
author | thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282> |
---|---|
date | Fri, 21 Aug 2009 09:38:00 +0000 |
parents | dad460d044d9 |
children | 408b4e761f98 |
files | src/AboutDialogGraphicsView.cpp src/IndentHandler.cpp src/SettingsPaths.cpp src/UiGuiLogger.cpp src/UiGuiLogger.h src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.cpp |
diffstat | 7 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/AboutDialogGraphicsView.cpp Mon Jul 27 15:35:09 2009 +0000 +++ b/src/AboutDialogGraphicsView.cpp Fri Aug 21 09:38:00 2009 +0000 @@ -45,6 +45,7 @@ this->aboutDialog = aboutDialog; firstRunOfAnimation = true; + windowTitleBarWidth = 0; scene = new QGraphicsScene(this); setSceneRect( newGeometry );
--- a/src/IndentHandler.cpp Mon Jul 27 15:35:09 2009 +0000 +++ b/src/IndentHandler.cpp Fri Aug 21 09:38:00 2009 +0000 @@ -467,7 +467,7 @@ tempDirctoryStrHelper = buffer; #endif tempDirctoryStr = QDir::fromNativeSeparators(tempDirctoryStrHelper).replace("//", "/"); - delete buffer; + delete [] buffer; // Check whether the short path still contains some kind of non ascii characters. if ( tempDirctoryStr.length() != tempDirctoryStr.toAscii().length() ) { @@ -480,7 +480,7 @@ qDebug() << __LINE__ << " " << __FUNCTION__ << ": Temp dir after trying to convert it to short Windows path is " << tempDirctoryStr; - delete tempDirctoryWindowsStr; + delete [] tempDirctoryWindowsStr; #endif // If the config file name is empty it is assumed that all parameters are sent via command line call @@ -683,7 +683,7 @@ int index; int crPos; int paramValue = 0; - QString paramValueStr; + QString paramValueStr = ""; QString cfgFileData = ""; // If the to be loaded config file does not exist leave all values as they are and return false.
--- a/src/SettingsPaths.cpp Mon Jul 27 15:35:09 2009 +0000 +++ b/src/SettingsPaths.cpp Fri Aug 21 09:38:00 2009 +0000 @@ -143,7 +143,7 @@ // into this normally temporary but linked file. char *pathTemplate = new char[tempPath.length()+8]; QByteArray pathTemplateQBA = QString(tempPath + "-XXXXXX").toAscii(); - delete pathTemplate; + delete [] pathTemplate; pathTemplate = pathTemplateQBA.data(); pathTemplate = mkdtemp( pathTemplate ); tempPath = pathTemplate;
--- a/src/UiGuiLogger.cpp Mon Jul 27 15:35:09 2009 +0000 +++ b/src/UiGuiLogger.cpp Fri Aug 21 09:38:00 2009 +0000 @@ -160,7 +160,7 @@ /*! \brief Writes the \a message to the used log file. */ -void UiGuiLogger::writeToLogFile(const QString message) { +void UiGuiLogger::writeToLogFile(const QString &message) { // If the file where all logging messages should go to isn't initilized yet, do that now. if ( logFileInitState == NOTINITIALZED ) { logFileInitState = INITIALIZING;
--- a/src/UiGuiLogger.h Mon Jul 27 15:35:09 2009 +0000 +++ b/src/UiGuiLogger.h Fri Aug 21 09:38:00 2009 +0000 @@ -54,7 +54,7 @@ private: enum LogFileInitState { NOTINITIALZED, INITIALIZING, INITIALZED } logFileInitState; UiGuiLogger(int verboseLevel); - void writeToLogFile(const QString message); + void writeToLogFile(const QString &message); static UiGuiLogger* instance; QtMsgType verboseLevel;
--- a/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp Mon Jul 27 15:35:09 2009 +0000 +++ b/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp Fri Aug 21 09:38:00 2009 +0000 @@ -336,6 +336,6 @@ ::SendMessage(getCurrentHScintilla(currentEdit), SCI_SETSEL, selectionStartPos, selectionStartPos + indentedTextByteArray.length() ); } - delete fullEditorText; + delete [] fullEditorText; fullEditorText = NULL; }
--- a/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.cpp Mon Jul 27 15:35:09 2009 +0000 +++ b/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.cpp Fri Aug 21 09:38:00 2009 +0000 @@ -50,7 +50,7 @@ /* Note: Within constructor send dialog IDD to DockingDlgInterface class */ -UniversalIndentGUI_NPPDialog::UniversalIndentGUI_NPPDialog(void) : DockingDlgInterface(IDD_DOCK_DLG), _hEdit(NULL) { +UniversalIndentGUI_NPPDialog::UniversalIndentGUI_NPPDialog(void) : DockingDlgInterface(IDD_DOCK_DLG), _hEdit(NULL), _pPluginProp(NULL), indentHandler(NULL) { } UniversalIndentGUI_NPPDialog::~UniversalIndentGUI_NPPDialog(void) {