# HG changeset patch # User thomas_-_s # Date 1248707828 0 # Node ID 3363b7bb0d419facab01084b35700fda203bd11f # Parent 56a36f63343145ce3273c486d1276cf676e81b90 Once more let Uncrustify reformat my code. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@985 59b1889a-e5ac-428c-b0c7-476e01d41282 diff -r 56a36f633431 -r 3363b7bb0d41 src/AboutDialogGraphicsView.h --- a/src/AboutDialogGraphicsView.h Mon Jul 27 14:40:13 2009 +0000 +++ b/src/AboutDialogGraphicsView.h Mon Jul 27 15:17:08 2009 +0000 @@ -31,11 +31,11 @@ class AboutDialogGraphicsView : public QGraphicsView { - Q_OBJECT + Q_OBJECT public: AboutDialogGraphicsView(AboutDialog *aboutDialog, QWidget *parent = 0); ~AboutDialogGraphicsView(void); - void setScreenshotPixmap(const QPixmap &screenShot); + void setScreenshotPixmap(const QPixmap &screenShot); public slots: void show(); @@ -50,7 +50,7 @@ QSplashScreen *aboutDialogAsSplashScreen; int windowTitleBarWidth; bool firstRunOfAnimation; - QPixmap originalPixmap; + QPixmap originalPixmap; private slots: void updateStep(int step); diff -r 56a36f633431 -r 3363b7bb0d41 src/IndentHandler.cpp --- a/src/IndentHandler.cpp Mon Jul 27 14:40:13 2009 +0000 +++ b/src/IndentHandler.cpp Mon Jul 27 15:17:08 2009 +0000 @@ -468,7 +468,7 @@ #endif tempDirctoryStr = QDir::fromNativeSeparators(tempDirctoryStrHelper).replace("//", "/"); delete buffer; - + // Check whether the short path still contains some kind of non ascii characters. if ( tempDirctoryStr.length() != tempDirctoryStr.toAscii().length() ) { qWarning() << __LINE__ << " " << __FUNCTION__ << ": Shortened path still contains non ascii characters. Could cause some indenters not to work properly!"; @@ -534,32 +534,32 @@ processReturnString += tr("Returned error message: ") + indentProcess.errorString() + "
"; switch ( indentProcess.error() ) { - case QProcess::FailedToStart: + case QProcess::FailedToStart : processReturnString += tr("Reason could be: ") + "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.
"; break; - case QProcess::Crashed: + case QProcess::Crashed : processReturnString += "The process crashed some time after starting successfully.
"; break; - case QProcess::Timedout: + case QProcess::Timedout : processReturnString += "The called indenter did not response for over 10 seconds, so aborted its execution.
"; break; - case QProcess::WriteError: + case QProcess::WriteError : processReturnString += "An error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.
"; break; - case QProcess::ReadError: + case QProcess::ReadError : processReturnString += "An error occurred when attempting to read from the process. For example, the process may not be running.
"; break; - case QProcess::UnknownError: + case QProcess::UnknownError : processReturnString += "An unknown error occurred. This is the default return value of error().
"; break; - default: + default : break; } processReturnString += tr("
Callstring was: ") + encodeToHTML(indenterCompleteCallString); processReturnString += tr("

Indenter output was:
") + "
" + - "(STDOUT):" + encodeToHTML( indentProcess.readAllStandardOutput() ) + "
" + - "(STDERR):" + encodeToHTML( indentProcess.readAllStandardError() ) + "
" + - "
"; + "(STDOUT):" + encodeToHTML( indentProcess.readAllStandardOutput() ) + "
" + + "(STDERR):" + encodeToHTML( indentProcess.readAllStandardError() ) + "
" + + ""; qWarning() << __LINE__ << " " << __FUNCTION__ << processReturnString; QApplication::restoreOverrideCursor(); errorMessageDialog->showMessage(tr("Error calling Indenter"), processReturnString); @@ -570,11 +570,11 @@ QString exitCode; exitCode.setNum(indentProcess.exitCode()); processReturnString = tr("Indenter returned with exit code: ") + exitCode + "
" + - tr("Indent console output was: ") + "
" + - "(STDOUT):" + encodeToHTML( indentProcess.readAllStandardOutput() ) + "
" + - "(STDERR):" + encodeToHTML( indentProcess.readAllStandardError() ) + "
" + - tr("
Callstring was: ") + encodeToHTML(indenterCompleteCallString) + - ""; + tr("Indent console output was: ") + "
" + + "(STDOUT):" + encodeToHTML( indentProcess.readAllStandardOutput() ) + "
" + + "(STDERR):" + encodeToHTML( indentProcess.readAllStandardError() ) + "
" + + tr("
Callstring was: ") + encodeToHTML(indenterCompleteCallString) + + ""; qWarning() << __LINE__ << " " << __FUNCTION__ << processReturnString; QApplication::restoreOverrideCursor(); errorMessageDialog->showMessage( tr("Indenter returned error"), processReturnString ); @@ -1170,7 +1170,6 @@ #ifdef UNIVERSALINDENTGUI_NPP_EXPORTS connect( comboBox, SIGNAL(activated(int)), this, SLOT(updateDrawing()) ); #endif // UNIVERSALINDENTGUI_NPP_EXPORTS - } } } diff -r 56a36f633431 -r 3363b7bb0d41 src/IndentHandler.h --- a/src/IndentHandler.h Mon Jul 27 14:40:13 2009 +0000 +++ b/src/IndentHandler.h Mon Jul 27 15:17:08 2009 +0000 @@ -87,7 +87,7 @@ bool event( QEvent *event ); void closeEvent(QCloseEvent *event); void wheelEvent( QWheelEvent *event ); - + private slots: void setIndenter(int indenterID); void showIndenterManual(); @@ -149,7 +149,7 @@ QCheckBox *valueEnabledChkBox; QComboBox *comboBox; QStringList choicesStrings; - QStringList choicesStringsReadable; + QStringList choicesStringsReadable; }; QVector paramMultiples; @@ -167,7 +167,7 @@ QString tempDirctoryStr; QString settingsDirctoryStr; QStringList indenterIniFileList; - QString parameterOrder; + QString parameterOrder; QString configFilename; QString cfgFileParameterEnding; QString inputFileParameter; diff -r 56a36f633431 -r 3363b7bb0d41 src/MainWindow.cpp --- a/src/MainWindow.cpp Mon Jul 27 14:40:13 2009 +0000 +++ b/src/MainWindow.cpp Mon Jul 27 15:17:08 2009 +0000 @@ -202,7 +202,7 @@ void MainWindow::initTextEditor() { // Create the QScintilla widget and add it to the layout. qDebug() << "Trying to load QScintilla library. If anything fails during loading, it might be possible that" - << " the debug and release version of QScintilla are mixed or the library cannot be found at all."; + << " the debug and release version of QScintilla are mixed or the library cannot be found at all."; // Try and catch doesn't seem to catch the runtime error when starting UiGUI release with QScintilla debug lib and the other way around. try { qSciSourceCodeEditor = new QsciScintilla(this); @@ -396,7 +396,7 @@ } QString openedSourceFileContent = ""; QString fileExtensions = tr("Supported by indenter")+" ("+indentHandler->getPossibleIndenterFileExtensions()+ - ");;"+tr("All files")+" (*.*)"; + ");;"+tr("All files")+" (*.*)"; //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions ); if ( fileName.isEmpty() ) { @@ -436,7 +436,7 @@ bool MainWindow::saveasSourceFileDialog(QAction *chosenEncodingAction) { QString encoding; QString fileExtensions = tr("Supported by indenter")+" ("+indentHandler->getPossibleIndenterFileExtensions()+ - ");;"+tr("All files")+" (*.*)"; + ");;"+tr("All files")+" (*.*)"; //QString openedSourceFileContent = openFileDialog( tr("Choose source code file"), "./", fileExtensions ); QString fileName = QFileDialog::getSaveFileName( this, tr("Save source code file"), currentSourceFile, fileExtensions); @@ -976,11 +976,10 @@ bool MainWindow::maybeSave() { if ( isWindowModified() ) { int ret = QMessageBox::warning(this, tr("Modified code"), - tr("The source code has been modified.\n" - "Do you want to save your changes?"), - QMessageBox::Yes | QMessageBox::Default, - QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + tr("The source code has been modified.\nDo you want to save your changes?"), + QMessageBox::Yes | QMessageBox::Default, + QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { return saveSourceFile(); } @@ -1029,10 +1028,10 @@ QString encodingName; encodingsList = QStringList() << "UTF-8" << "UTF-16" << "UTF-16BE" << "UTF-16LE" - << "Apple Roman" << "Big5" << "Big5-HKSCS" << "EUC-JP" << "EUC-KR" << "GB18030-0" - << "IBM 850" << "IBM 866" << "IBM 874" << "ISO 2022-JP" << "ISO 8859-1" << "ISO 8859-13" - << "Iscii-Bng" << "JIS X 0201" << "JIS X 0208" << "KOI8-R" << "KOI8-U" << "MuleLao-1" - << "ROMAN8" << "Shift-JIS" << "TIS-620" << "TSCII" << "Windows-1250" << "WINSAMI2"; + << "Apple Roman" << "Big5" << "Big5-HKSCS" << "EUC-JP" << "EUC-KR" << "GB18030-0" + << "IBM 850" << "IBM 866" << "IBM 874" << "ISO 2022-JP" << "ISO 8859-1" << "ISO 8859-13" + << "Iscii-Bng" << "JIS X 0201" << "JIS X 0208" << "KOI8-R" << "KOI8-U" << "MuleLao-1" + << "ROMAN8" << "Shift-JIS" << "TIS-620" << "TSCII" << "Windows-1250" << "WINSAMI2"; encodingActionGroup = new QActionGroup(this); saveEncodedActionGroup = new QActionGroup(this); diff -r 56a36f633431 -r 3363b7bb0d41 src/MainWindow.h --- a/src/MainWindow.h Mon Jul 27 14:40:13 2009 +0000 +++ b/src/MainWindow.h Mon Jul 27 15:17:08 2009 +0000 @@ -76,10 +76,10 @@ void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); - QsciScintilla *qSciSourceCodeEditor; - UiGuiSettings *settings; + QsciScintilla *qSciSourceCodeEditor; + UiGuiSettings *settings; - QString currentEncoding; + QString currentEncoding; QString sourceFileContent; QString sourceFormattedContent; QString sourceViewContent; @@ -87,10 +87,10 @@ QScrollBar *textEditVScrollBar; AboutDialog *aboutDialog; AboutDialogGraphicsView *aboutDialogGraphicsView; - UiGuiSettingsDialog *settingsDialog; + UiGuiSettingsDialog *settingsDialog; int textEditLastScrollPos; int currentIndenterID; - bool loadLastSourceCodeFileOnStartup; + bool loadLastSourceCodeFileOnStartup; QString currentSourceFile; QString currentSourceFileExtension; QString savedSourceContent; @@ -105,7 +105,7 @@ bool scrollPositionChanged; bool indentSettingsChanged; bool previewToggled; - QStringList encodingsList; + QStringList encodingsList; Ui::ToolBarWidget *toolBarWidget; IndentHandler *indentHandler; @@ -124,20 +124,20 @@ void callIndenter(); void updateSourceView(); void turnHighlightOnOff(bool turnOn); - void setWhiteSpaceVisibility(bool visible); - void sourceCodeChangedHelperSlot(); + void setWhiteSpaceVisibility(bool visible); + void sourceCodeChangedHelperSlot(); void sourceCodeChangedSlot(); void indentSettingsChangedSlot(); void previewTurnedOnOff(bool turnOn); void exportToPDF(); void exportToHTML(); - void languageChanged(int languageIndex); + void languageChanged(int languageIndex); void encodingChanged(QAction *encodingAction); - void numberOfLinesChanged(); + void numberOfLinesChanged(); void updateRecentlyOpenedList(); void openFileFromRecentlyOpenedList(QAction* recentlyOpenedAction); void clearRecentlyOpenedList(); - void showAboutDialog(); + void showAboutDialog(); void setStatusBarCursorPosInfo(int line, int column); }; diff -r 56a36f633431 -r 3363b7bb0d41 src/SettingsPaths.cpp --- a/src/SettingsPaths.cpp Mon Jul 27 14:40:13 2009 +0000 +++ b/src/SettingsPaths.cpp Mon Jul 27 15:17:08 2009 +0000 @@ -1,273 +1,273 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Thomas Schweitzer * - * thomas-schweitzer(at)arcor.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License version 2.0 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program in the file LICENSE.GPL; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - -#include -#include -#include -#include - -#include "SettingsPaths.h" - - -//! \defgroup grp_Settings All concerning applications settings. - -/*! - \class SettingsPaths - \ingroup grp_Settings - \brief SettingsPaths is a pure static functions class from which info about the - paths needed for settings can be retrieved. -*/ - -bool SettingsPaths::alreadyInitialized = false; -QString SettingsPaths::applicationBinaryPath = ""; -QString SettingsPaths::settingsPath = ""; -QString SettingsPaths::globalFilesPath = ""; -QString SettingsPaths::indenterPath = ""; -QString SettingsPaths::tempPath = ""; -bool SettingsPaths::portableMode = false; - - -/*! - \brief Initializes all available information about the paths. - - Mainly during this init it is detected whether to start in portable mode or not. This is - done by testing whether the directory "config" is in the same directory as this - applications executable file. - In portable mode all data is ONLY written to subdirectories of the applications executable file. - Means also that the directory "indenters" has to be there. - In not portable mode (multiuser mode) only users home directory is used for writing config data. - */ -void SettingsPaths::init() { - alreadyInitialized = true; - - qDebug() << __LINE__ << " " << __FUNCTION__ << ": Initializing application paths."; - - // Get the applications binary path, with respect to MacOSXs use of the .app folder. - applicationBinaryPath = QCoreApplication::applicationDirPath(); - // Remove any trailing slashes - while ( applicationBinaryPath.right(1) == "/" ) { - applicationBinaryPath.chop(1); - } - -#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS - applicationBinaryPath += "/plugins/uigui"; -#endif - -#ifdef Q_OS_MAC - // Because on Mac universal binaries are used, the binary path is not equal - // to the applications (.app) path. So get the .apps path here. - int indexOfDotApp = applicationBinaryPath.indexOf(".app"); - if ( indexOfDotApp != -1 ) { - // Cut off after the dot of ".app". - applicationBinaryPath = applicationBinaryPath.left( indexOfDotApp-1 ); - // Cut off after the first slash that was in front of ".app" (normally this is the word "UniversalIndentGUI") - applicationBinaryPath = applicationBinaryPath.left( applicationBinaryPath.lastIndexOf("/") ); - } -#endif - - // If the "config" directory is a subdir of the applications binary path, use this one (portable mode) - settingsPath = applicationBinaryPath + "/config"; - if ( QFile::exists( settingsPath ) ) { - portableMode = true; - QDir dirCreator; - globalFilesPath = applicationBinaryPath; - indenterPath = applicationBinaryPath + "/indenters"; - dirCreator.mkpath( settingsPath ); - tempPath = applicationBinaryPath + "/temp"; - //TODO: If the portable drive has write protection, use local temp path and clean it up on exit. - dirCreator.mkpath( tempPath ); - } - // ... otherwise use the system specific global application data path. - else { - portableMode = false; - QDir dirCreator; -#ifdef Q_OS_WIN - // Get the local users application settings directory. - // Remove any trailing slashes. - settingsPath = QDir::fromNativeSeparators( qgetenv("APPDATA") ); - while ( settingsPath.right(1) == "/" ) { - settingsPath.chop(1); - } - settingsPath = settingsPath + "/UniversalIndentGUI"; - - // On windows systems the directories "indenters", "translations" are subdirs of the applicationBinaryPath. - globalFilesPath = applicationBinaryPath; -#else - // Remove any trailing slashes. - settingsPath = QDir::homePath(); - while ( settingsPath.right(1) == "/" ) { - settingsPath.chop(1); - } - settingsPath = settingsPath + "/.universalindentgui"; - globalFilesPath = "/usr/share/universalindentgui"; -#endif - dirCreator.mkpath( settingsPath ); - // If a highlighter config file does not exist in the users home config dir - // copy the default config file over there. - if ( !QFile::exists(settingsPath+"/UiGuiSyntaxHighlightConfig.ini") ) { - QFile::copy( globalFilesPath+"/config/UiGuiSyntaxHighlightConfig.ini", settingsPath+"/UiGuiSyntaxHighlightConfig.ini" ); - } - indenterPath = globalFilesPath + "/indenters"; - - // On different systems it may be that "QDir::tempPath()" ends with a "/" or not. So check this. - // Remove any trailing slashes. - tempPath = QDir::tempPath(); - while ( tempPath.right(1) == "/" ) { - tempPath.chop(1); - } - tempPath = tempPath + "/UniversalIndentGUI"; - -#if defined(Q_OS_WIN32) - dirCreator.mkpath( tempPath ); -#else - // On Unix based systems create a random temporary directory for security - // reasons. Otherwise an evil human being could create a symbolic link - // to an important existing file which gets overwritten when UiGUI writes - // into this normally temporary but linked file. - char *pathTemplate = new char[tempPath.length()+8]; - QByteArray pathTemplateQBA = QString(tempPath + "-XXXXXX").toAscii(); - delete pathTemplate; - pathTemplate = pathTemplateQBA.data(); - pathTemplate = mkdtemp( pathTemplate ); - tempPath = pathTemplate; -#endif - } - - qDebug() << __LINE__ << " " << __FUNCTION__ << ": Paths are:" \ - "
  • applicationBinaryPath=" << applicationBinaryPath \ - << "
  • settingsPath=" << settingsPath \ - << "
  • globalFilesPath=" << globalFilesPath \ - << "
  • indenterPath=" << indenterPath \ - << "
  • tempPath=" << tempPath \ - << "
  • Running in portable mode=" << portableMode << "
"; -} - - -/*! - \brief Returns the path of the applications executable. - */ -const QString SettingsPaths::getApplicationBinaryPath() { - if ( !alreadyInitialized ) { - SettingsPaths::init(); - } - return applicationBinaryPath; -} - - -/*! - \brief Returns the path where all settings are being/should be written to. - */ -const QString SettingsPaths::getSettingsPath() { - if ( !alreadyInitialized ) { - SettingsPaths::init(); - } - return settingsPath; -} - - -/*! - \brief Returns the path where the files concerning all users reside. For example translations. - */ -const QString SettingsPaths::getGlobalFilesPath() { - if ( !alreadyInitialized ) { - SettingsPaths::init(); - } - return globalFilesPath; -} - - -/*! - \brief Returns the path where the indenter executables reside. - */ -const QString SettingsPaths::getIndenterPath() { - if ( !alreadyInitialized ) { - SettingsPaths::init(); - } - return indenterPath; -} - - -/*! - \brief Returns the path where the where all temporary data should be written to. - */ -const QString SettingsPaths::getTempPath() { - if ( !alreadyInitialized ) { - SettingsPaths::init(); - } - return tempPath; -} - - -/*! - \brief Returns true if portable mode shall be used. - */ -bool SettingsPaths::getPortableMode() { - if ( !alreadyInitialized ) { - SettingsPaths::init(); - } - return portableMode; -} - - -/*! - \brief Completely deletes the created temporary directory with all of its content. - */ -void SettingsPaths::cleanAndRemoveTempDir() { - QDirIterator dirIterator(tempPath, QDirIterator::Subdirectories); - QStack directoryStack; - bool noErrorsOccurred = true; - - while ( dirIterator.hasNext() ) { - QString currentDirOrFile = dirIterator.next(); - // If this dummy call isn't done here, calling "dirIterator.fileInfo().isDir()" later somehow fails. - dirIterator.fileInfo(); - - if ( !currentDirOrFile.isEmpty() && dirIterator.fileName() != "." && dirIterator.fileName() != ".." ) { - // There is a path on the stack but the current path doesn't start with that path. - // So we changed into another parent directory and the one on the stack can be deleted - // since it must be empty. - if ( !directoryStack.isEmpty() && !currentDirOrFile.startsWith(directoryStack.top()) ) { - QString dirToBeRemoved = directoryStack.pop(); - bool couldRemoveDir = QDir(dirToBeRemoved).rmdir(dirToBeRemoved); - noErrorsOccurred &= couldRemoveDir; - if ( couldRemoveDir == false ) - qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the directory: " << dirToBeRemoved; - //qDebug() << "Removing Dir " << directoryStack.pop(); - } - - // If the iterator currently points to a directory push it onto the stack. - if ( dirIterator.fileInfo().isDir() ) { - directoryStack.push( currentDirOrFile ); - //qDebug() << "Pushing onto Stack " << currentDirOrFile; - } - // otherwise it must be a file, so delete it. - else { - bool couldRemoveFile = QFile::remove( currentDirOrFile ); - noErrorsOccurred &= couldRemoveFile; - if ( couldRemoveFile == false ) - qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the file: " << currentDirOrFile; - //qDebug() << "Removing File " << currentDirOrFile; - } - } - } - noErrorsOccurred &= QDir(tempPath).rmdir(tempPath); - if ( noErrorsOccurred == false ) - qWarning() << __LINE__ << " " << __FUNCTION__ << "While cleaning up the temp dir an error occurred."; -} +/*************************************************************************** + * Copyright (C) 2006-2009 by Thomas Schweitzer * + * thomas-schweitzer(at)arcor.de * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License version 2.0 as * + * published by the Free Software Foundation. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program in the file LICENSE.GPL; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#include +#include +#include +#include + +#include "SettingsPaths.h" + + +//! \defgroup grp_Settings All concerning applications settings. + +/*! + \class SettingsPaths + \ingroup grp_Settings + \brief SettingsPaths is a pure static functions class from which info about the + paths needed for settings can be retrieved. +*/ + +bool SettingsPaths::alreadyInitialized = false; +QString SettingsPaths::applicationBinaryPath = ""; +QString SettingsPaths::settingsPath = ""; +QString SettingsPaths::globalFilesPath = ""; +QString SettingsPaths::indenterPath = ""; +QString SettingsPaths::tempPath = ""; +bool SettingsPaths::portableMode = false; + + +/*! + \brief Initializes all available information about the paths. + + Mainly during this init it is detected whether to start in portable mode or not. This is + done by testing whether the directory "config" is in the same directory as this + applications executable file. + In portable mode all data is ONLY written to subdirectories of the applications executable file. + Means also that the directory "indenters" has to be there. + In not portable mode (multiuser mode) only users home directory is used for writing config data. + */ +void SettingsPaths::init() { + alreadyInitialized = true; + + qDebug() << __LINE__ << " " << __FUNCTION__ << ": Initializing application paths."; + + // Get the applications binary path, with respect to MacOSXs use of the .app folder. + applicationBinaryPath = QCoreApplication::applicationDirPath(); + // Remove any trailing slashes + while ( applicationBinaryPath.right(1) == "/" ) { + applicationBinaryPath.chop(1); + } + +#ifdef UNIVERSALINDENTGUI_NPP_EXPORTS + applicationBinaryPath += "/plugins/uigui"; +#endif + +#ifdef Q_OS_MAC + // Because on Mac universal binaries are used, the binary path is not equal + // to the applications (.app) path. So get the .apps path here. + int indexOfDotApp = applicationBinaryPath.indexOf(".app"); + if ( indexOfDotApp != -1 ) { + // Cut off after the dot of ".app". + applicationBinaryPath = applicationBinaryPath.left( indexOfDotApp-1 ); + // Cut off after the first slash that was in front of ".app" (normally this is the word "UniversalIndentGUI") + applicationBinaryPath = applicationBinaryPath.left( applicationBinaryPath.lastIndexOf("/") ); + } +#endif + + // If the "config" directory is a subdir of the applications binary path, use this one (portable mode) + settingsPath = applicationBinaryPath + "/config"; + if ( QFile::exists( settingsPath ) ) { + portableMode = true; + QDir dirCreator; + globalFilesPath = applicationBinaryPath; + indenterPath = applicationBinaryPath + "/indenters"; + dirCreator.mkpath( settingsPath ); + tempPath = applicationBinaryPath + "/temp"; + //TODO: If the portable drive has write protection, use local temp path and clean it up on exit. + dirCreator.mkpath( tempPath ); + } + // ... otherwise use the system specific global application data path. + else { + portableMode = false; + QDir dirCreator; +#ifdef Q_OS_WIN + // Get the local users application settings directory. + // Remove any trailing slashes. + settingsPath = QDir::fromNativeSeparators( qgetenv("APPDATA") ); + while ( settingsPath.right(1) == "/" ) { + settingsPath.chop(1); + } + settingsPath = settingsPath + "/UniversalIndentGUI"; + + // On windows systems the directories "indenters", "translations" are subdirs of the applicationBinaryPath. + globalFilesPath = applicationBinaryPath; +#else + // Remove any trailing slashes. + settingsPath = QDir::homePath(); + while ( settingsPath.right(1) == "/" ) { + settingsPath.chop(1); + } + settingsPath = settingsPath + "/.universalindentgui"; + globalFilesPath = "/usr/share/universalindentgui"; +#endif + dirCreator.mkpath( settingsPath ); + // If a highlighter config file does not exist in the users home config dir + // copy the default config file over there. + if ( !QFile::exists(settingsPath+"/UiGuiSyntaxHighlightConfig.ini") ) { + QFile::copy( globalFilesPath+"/config/UiGuiSyntaxHighlightConfig.ini", settingsPath+"/UiGuiSyntaxHighlightConfig.ini" ); + } + indenterPath = globalFilesPath + "/indenters"; + + // On different systems it may be that "QDir::tempPath()" ends with a "/" or not. So check this. + // Remove any trailing slashes. + tempPath = QDir::tempPath(); + while ( tempPath.right(1) == "/" ) { + tempPath.chop(1); + } + tempPath = tempPath + "/UniversalIndentGUI"; + +#if defined(Q_OS_WIN32) + dirCreator.mkpath( tempPath ); +#else + // On Unix based systems create a random temporary directory for security + // reasons. Otherwise an evil human being could create a symbolic link + // to an important existing file which gets overwritten when UiGUI writes + // into this normally temporary but linked file. + char *pathTemplate = new char[tempPath.length()+8]; + QByteArray pathTemplateQBA = QString(tempPath + "-XXXXXX").toAscii(); + delete pathTemplate; + pathTemplate = pathTemplateQBA.data(); + pathTemplate = mkdtemp( pathTemplate ); + tempPath = pathTemplate; +#endif + } + + qDebug() << __LINE__ << " " << __FUNCTION__ << ": Paths are:" \ + "
  • applicationBinaryPath=" << applicationBinaryPath \ + << "
  • settingsPath=" << settingsPath \ + << "
  • globalFilesPath=" << globalFilesPath \ + << "
  • indenterPath=" << indenterPath \ + << "
  • tempPath=" << tempPath \ + << "
  • Running in portable mode=" << portableMode << "
"; +} + + +/*! + \brief Returns the path of the applications executable. + */ +const QString SettingsPaths::getApplicationBinaryPath() { + if ( !alreadyInitialized ) { + SettingsPaths::init(); + } + return applicationBinaryPath; +} + + +/*! + \brief Returns the path where all settings are being/should be written to. + */ +const QString SettingsPaths::getSettingsPath() { + if ( !alreadyInitialized ) { + SettingsPaths::init(); + } + return settingsPath; +} + + +/*! + \brief Returns the path where the files concerning all users reside. For example translations. + */ +const QString SettingsPaths::getGlobalFilesPath() { + if ( !alreadyInitialized ) { + SettingsPaths::init(); + } + return globalFilesPath; +} + + +/*! + \brief Returns the path where the indenter executables reside. + */ +const QString SettingsPaths::getIndenterPath() { + if ( !alreadyInitialized ) { + SettingsPaths::init(); + } + return indenterPath; +} + + +/*! + \brief Returns the path where the where all temporary data should be written to. + */ +const QString SettingsPaths::getTempPath() { + if ( !alreadyInitialized ) { + SettingsPaths::init(); + } + return tempPath; +} + + +/*! + \brief Returns true if portable mode shall be used. + */ +bool SettingsPaths::getPortableMode() { + if ( !alreadyInitialized ) { + SettingsPaths::init(); + } + return portableMode; +} + + +/*! + \brief Completely deletes the created temporary directory with all of its content. + */ +void SettingsPaths::cleanAndRemoveTempDir() { + QDirIterator dirIterator(tempPath, QDirIterator::Subdirectories); + QStack directoryStack; + bool noErrorsOccurred = true; + + while ( dirIterator.hasNext() ) { + QString currentDirOrFile = dirIterator.next(); + // If this dummy call isn't done here, calling "dirIterator.fileInfo().isDir()" later somehow fails. + dirIterator.fileInfo(); + + if ( !currentDirOrFile.isEmpty() && dirIterator.fileName() != "." && dirIterator.fileName() != ".." ) { + // There is a path on the stack but the current path doesn't start with that path. + // So we changed into another parent directory and the one on the stack can be deleted + // since it must be empty. + if ( !directoryStack.isEmpty() && !currentDirOrFile.startsWith(directoryStack.top()) ) { + QString dirToBeRemoved = directoryStack.pop(); + bool couldRemoveDir = QDir(dirToBeRemoved).rmdir(dirToBeRemoved); + noErrorsOccurred &= couldRemoveDir; + if ( couldRemoveDir == false ) + qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the directory: " << dirToBeRemoved; + //qDebug() << "Removing Dir " << directoryStack.pop(); + } + + // If the iterator currently points to a directory push it onto the stack. + if ( dirIterator.fileInfo().isDir() ) { + directoryStack.push( currentDirOrFile ); + //qDebug() << "Pushing onto Stack " << currentDirOrFile; + } + // otherwise it must be a file, so delete it. + else { + bool couldRemoveFile = QFile::remove( currentDirOrFile ); + noErrorsOccurred &= couldRemoveFile; + if ( couldRemoveFile == false ) + qWarning() << __LINE__ << " " << __FUNCTION__ << "Could not remove the file: " << currentDirOrFile; + //qDebug() << "Removing File " << currentDirOrFile; + } + } + } + noErrorsOccurred &= QDir(tempPath).rmdir(tempPath); + if ( noErrorsOccurred == false ) + qWarning() << __LINE__ << " " << __FUNCTION__ << "While cleaning up the temp dir an error occurred."; +} diff -r 56a36f633431 -r 3363b7bb0d41 src/SettingsPaths.h --- a/src/SettingsPaths.h Mon Jul 27 14:40:13 2009 +0000 +++ b/src/SettingsPaths.h Mon Jul 27 15:17:08 2009 +0000 @@ -39,7 +39,7 @@ private: SettingsPaths(); - + static bool alreadyInitialized; static QString applicationBinaryPath; static QString settingsPath; diff -r 56a36f633431 -r 3363b7bb0d41 src/UiGuiHighlighter.h --- a/src/UiGuiHighlighter.h Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UiGuiHighlighter.h Mon Jul 27 15:17:08 2009 +0000 @@ -75,9 +75,9 @@ UiGuiHighlighter(QsciScintilla *parent); void turnHighlightOff(); void turnHighlightOn(); - - bool readCurrentSettings(const char *prefix); - void writeCurrentSettings(const char *prefix); + + bool readCurrentSettings(const char *prefix); + void writeCurrentSettings(const char *prefix); QStringList getAvailableHighlighters(); private: @@ -98,12 +98,12 @@ //! -1 then the font is set for all styles. void setFont(const QFont &font, int style = -1); - //! Sets the lexer that is responsible for the given \a extension. - int setLexerForExtension( QString extension ); + //! Sets the lexer that is responsible for the given \a extension. + int setLexerForExtension( QString extension ); void setLexerByName( QString lexerName ); - void setHighlighterByAction(QAction* highlighterAction); + void setHighlighterByAction(QAction* highlighterAction); }; #endif // UIGUIHIGHLIGHTER_H diff -r 56a36f633431 -r 3363b7bb0d41 src/UiGuiLogger.cpp --- a/src/UiGuiLogger.cpp Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UiGuiLogger.cpp Mon Jul 27 15:17:08 2009 +0000 @@ -70,7 +70,6 @@ // Make the main application not to wait for the logging window to close. setAttribute(Qt::WA_QuitOnClose, false); - } @@ -92,20 +91,20 @@ // Depending on the QtMsgType prepend a different colored Debug, Warning, Critical or Fatal. switch (type) { - case QtDebugMsg: + case QtDebugMsg : message += " Debug: "; break; - case QtWarningMsg: + case QtWarningMsg : message += " Warning: "; break; - case QtCriticalMsg: + case QtCriticalMsg : message += "Critical: "; break; - case QtFatalMsg: + case QtFatalMsg : message += " Fatal: "; // This one is no Qt message type, but can be used to send info messages to the log // by calling UiGuiLogger::messageHandler() directly. - case UiGuiInfoMsg: + case UiGuiInfoMsg : message += " Info: "; break; } @@ -162,7 +161,6 @@ \brief Writes the \a message to the used log file. */ 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; @@ -183,17 +181,17 @@ unsigned char randomChar; switch ( qrand() % 3 ) { // Append a number from 0 to 9. - case 0: - randomChar = qrand() % 10 + '0'; - break; + case 0 : + randomChar = qrand() % 10 + '0'; + break; // Append a upper case characer between A and Z. - case 1: - randomChar = qrand() % 26 + 'A'; - break; + case 1 : + randomChar = qrand() % 26 + 'A'; + break; // Append a lower case characer between a and z. - default: - randomChar = qrand() % 26 + 'a'; - break; + default : + randomChar = qrand() % 26 + 'a'; + break; } logFileName += "_" + QString(randomChar) + ".html"; diff -r 56a36f633431 -r 3363b7bb0d41 src/UiGuiSettings.h --- a/src/UiGuiSettings.h Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UiGuiSettings.h Mon Jul 27 15:17:08 2009 +0000 @@ -32,31 +32,31 @@ class UiGuiSettings : public QObject { - Q_OBJECT + Q_OBJECT private: UiGuiSettings(); static UiGuiSettings* instance; public: - static UiGuiSettings* getInstance(); + static UiGuiSettings* getInstance(); static void deleteInstance(); ~UiGuiSettings(); bool loadSettings(); bool saveSettings(); bool setValueByName(QString settingName, QVariant value); - QVariant getValueByName(QString settingName); + QVariant getValueByName(QString settingName); void updateAllDependend(); - QStringList getAvailableTranslations(); + QStringList getAvailableTranslations(); -// Only one slot per possible value type needed, because wanted setting -// is recognized by the sender objects name. + // Only one slot per possible value type needed, because wanted setting + // is recognized by the sender objects name. public slots: - void handleValueChangeFromExtern(int value); + void handleValueChangeFromExtern(int value); void handleValueChangeFromExtern(bool value); void handleValueChangeFromExtern(QDate value); void handleValueChangeFromExtern(QByteArray value); -// Each possible setting needs an own signal. + // Each possible setting needs an own signal. signals: void versionInSettingsFile(QString value); void windowIsMaximized(bool value); @@ -78,16 +78,16 @@ private: void emitSignalForSetting(QString settingName); - void readAvailableTranslations(); + void readAvailableTranslations(); - //! Stores the mnemonics of the available translations. - QStringList availableTranslations; + //! Stores the mnemonics of the available translations. + QStringList availableTranslations; //! The settings file. QSettings *qsettings; - //! This map holds all possible settings defined by their name as QString. The value is of the type QVariant. - QMap settings; + //! This map holds all possible settings defined by their name as QString. The value is of the type QVariant. + QMap settings; QString indenterDirctoryStr; }; diff -r 56a36f633431 -r 3363b7bb0d41 src/UiGuiSettingsDialog.h --- a/src/UiGuiSettingsDialog.h Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UiGuiSettingsDialog.h Mon Jul 27 15:17:08 2009 +0000 @@ -26,10 +26,10 @@ class UiGuiSettingsDialog : public QDialog, private Ui::SettingsDialog { - Q_OBJECT + Q_OBJECT public: - UiGuiSettingsDialog(QWidget* parent, UiGuiSettings* settings); + UiGuiSettingsDialog(QWidget* parent, UiGuiSettings* settings); public slots: int showDialog(); @@ -39,7 +39,7 @@ private: void changeEvent(QEvent *event); - void initTranslationSelection(); + void initTranslationSelection(); UiGuiSettings* settings; QList checkBoxes; diff -r 56a36f633431 -r 3363b7bb0d41 src/UiGuiSystemInfo.cpp --- a/src/UiGuiSystemInfo.cpp Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UiGuiSystemInfo.cpp Mon Jul 27 15:17:08 2009 +0000 @@ -113,7 +113,7 @@ case QSysInfo::MV_Unknown : operatingSystemString = "An unknown and currently unsupported platform"; break; - default: + default : operatingSystemString = "Unknown Mac operating system."; break; } diff -r 56a36f633431 -r 3363b7bb0d41 src/UiGuiVersion.cpp --- a/src/UiGuiVersion.cpp Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UiGuiVersion.cpp Mon Jul 27 15:17:08 2009 +0000 @@ -24,7 +24,6 @@ #include namespace UiGuiVersion { - /*! \brief Returns the build date as a localized string, e.g. "9. Februar 2009". If there was some kind of error, the returned string is empty. @@ -35,7 +34,7 @@ monthNames << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dez"; QStringList buildDateStringList = QString(__DATE__).simplified().split(' '); // __DATE__ returns eg "Feb 4 2009" - + if ( buildDateStringList.count() == 3 ) { QDate buildDate(buildDateStringList.last().toInt(), monthNames.indexOf( buildDateStringList.first() )+1, buildDateStringList.at(1).toInt()); buildDateString = buildDate.toString("d. MMMM yyyy"); @@ -59,5 +58,4 @@ return buildRevision; } - } // namespace UiGuiVersion diff -r 56a36f633431 -r 3363b7bb0d41 src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp --- a/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.cpp Mon Jul 27 15:17:08 2009 +0000 @@ -48,7 +48,7 @@ switch (reasonForCall) { - case DLL_PROCESS_ATTACH: + case DLL_PROCESS_ATTACH : { if (!qApp) { int argc = 1; @@ -105,7 +105,7 @@ funcItem[TOGGLE_AUTO_UPDATE_INDEX]._pShKey = NULL; break; } - case DLL_PROCESS_DETACH: + case DLL_PROCESS_DETACH : { delete funcItem[TOGGLE_SHOW_UIGUI_INDEX]._pShKey; delete indentHandler; @@ -114,11 +114,11 @@ saveSettings(); break; } - case DLL_THREAD_ATTACH: - break; + case DLL_THREAD_ATTACH : + break; - case DLL_THREAD_DETACH: - break; + case DLL_THREAD_DETACH : + break; } return TRUE; diff -r 56a36f633431 -r 3363b7bb0d41 src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.h --- a/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.h Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPP.h Mon Jul 27 15:17:08 2009 +0000 @@ -31,26 +31,26 @@ #include "SettingsPaths.h" /* menu position in funcItem */ -#define TOGGLE_SHOW_UIGUI_INDEX 0 -#define EXECUTE_TEXT_INDENT_INDEX 1 -#define TOGGLE_AUTO_UPDATE_INDEX 2 +#define TOGGLE_SHOW_UIGUI_INDEX 0 +#define EXECUTE_TEXT_INDENT_INDEX 1 +#define TOGGLE_AUTO_UPDATE_INDEX 2 /* ini file name */ -CONST TCHAR PLUGINTEMP_INI[] = _T("\\UniversalIndentGUI.ini"); +CONST TCHAR PLUGINTEMP_INI[] = _T("\\UniversalIndentGUI.ini"); /* param names of ini file */ /* section */ -CONST TCHAR dlgTemp[] = _T("UniversalIndentGUI"); +CONST TCHAR dlgTemp[] = _T("UniversalIndentGUI"); /* keys of section */ -CONST TCHAR Value1[] = _T("Value1"); -CONST TCHAR Value2[] = _T("Value2"); +CONST TCHAR Value1[] = _T("Value1"); +CONST TCHAR Value2[] = _T("Value2"); /* define here your plugin properties (stored in an ini file) */ typedef struct tPluginProp { - INT iValue1; - INT iValue2; + INT iValue1; + INT iValue2; } tPluginProp; @@ -65,5 +65,5 @@ -#endif // UNIVERSALINDENTGUI_NPP_H +#endif // UNIVERSALINDENTGUI_NPP_H diff -r 56a36f633431 -r 3363b7bb0d41 src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.cpp --- a/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.cpp Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.cpp Mon Jul 27 15:17:08 2009 +0000 @@ -82,13 +82,13 @@ BOOL CALLBACK UniversalIndentGUI_NPPDialog::run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch (Message) { - case WM_INITDIALOG: + case WM_INITDIALOG : { InitialDialog(); break; } - case WM_SIZE: - case WM_MOVE: + case WM_SIZE : + case WM_MOVE : { RECT rc = {0}; @@ -121,7 +121,7 @@ } break; } - case WM_COMMAND: + case WM_COMMAND : { if ((HWND)lParam == _ToolBar.getHSelf()) { tb_cmd(LOWORD(wParam)); @@ -129,7 +129,7 @@ } break; } - case WM_NOTIFY: + case WM_NOTIFY : { LPNMHDR nmhdr = (LPNMHDR)lParam; @@ -160,13 +160,13 @@ } break; } - case WM_DESTROY: + case WM_DESTROY : { /* destroy icon of tab */ ::DestroyIcon(_data.hIconTab); break; } - default: + default : return DockingDlgInterface::run_dlgProc(hWnd, Message, wParam, lParam); } @@ -187,19 +187,19 @@ void UniversalIndentGUI_NPPDialog::tb_cmd(UINT message) { switch (message) { - case IDM_EX_UNDO: + case IDM_EX_UNDO : { ::SendMessage(_hEdit, WM_UNDO, 0, 0); break; } - case IDM_EX_REDO: + case IDM_EX_REDO : { TCHAR pszText[256]; _stprintf(pszText, "Value1 = %d\r\nValue2 = %d\r\n\r\n", _pPluginProp->iValue1, _pPluginProp->iValue2); ::SendMessage(_hEdit, WM_SETTEXT, 0, (LPARAM)pszText); break; } - default: + default : break; } } diff -r 56a36f633431 -r 3363b7bb0d41 src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.h --- a/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.h Mon Jul 27 14:40:13 2009 +0000 +++ b/src/UniversalIndentGUI_NPP/UniversalIndentGUI_NPPDialog.h Mon Jul 27 15:17:08 2009 +0000 @@ -31,40 +31,41 @@ class UniversalIndentGUI_NPPDialog : public DockingDlgInterface { public: - UniversalIndentGUI_NPPDialog(void); - ~UniversalIndentGUI_NPPDialog(void); + UniversalIndentGUI_NPPDialog(void); + ~UniversalIndentGUI_NPPDialog(void); void init(HINSTANCE hInst, NppData nppData, tPluginProp *pMgrProp); - void destroy(void) {}; + void destroy(void) { + }; - void doDialog(bool willBeShown = true); + void doDialog(bool willBeShown = true); protected: - /* get toolbar tooltips */ - void GetNameStrFromCmd(UINT resID, LPTSTR tip); + /* get toolbar tooltips */ + void GetNameStrFromCmd(UINT resID, LPTSTR tip); - virtual BOOL CALLBACK run_dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + virtual BOOL CALLBACK run_dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - /* initial dialog here */ - void InitialDialog(void); - - /* toolbar commands */ - void tb_cmd(UINT message); + /* initial dialog here */ + void InitialDialog(void); + + /* toolbar commands */ + void tb_cmd(UINT message); private: - /* Handles */ - NppData _nppData; - HWND _hEdit; + /* Handles */ + NppData _nppData; + HWND _hEdit; - /* classes */ - ToolBar _ToolBar; - ReBar _Rebar; + /* classes */ + ToolBar _ToolBar; + ReBar _Rebar; - /* settings */ - tTbData _data; - tPluginProp* _pPluginProp; + /* settings */ + tTbData _data; + tPluginProp* _pPluginProp; IndentHandler *indentHandler; }; diff -r 56a36f633431 -r 3363b7bb0d41 src/main.cpp --- a/src/main.cpp Mon Jul 27 14:40:13 2009 +0000 +++ b/src/main.cpp Mon Jul 27 15:17:08 2009 +0000 @@ -87,14 +87,14 @@ } else { QString message = "Invalid parameter found. Allowed parameters are:\n" \ - "-f filename --file filename : Opens the by filename defined file on start.\n" \ - "-p --plugin : Run as plugin. Server will be startet with a simplified gui.\n" \ - "-s --server : Run as server only without gui.\n" \ - "-v level --verbose level : Sets the verbose level for logging application info.\n" \ - " Level is a number from 0 to 3, where 0 means even\n" \ - " log debug info (most log info).\n\n" \ - "If -p and -s are set, -p will be used.\n" \ - "No parameters starts without server and full gui."; + "-f filename --file filename : Opens the by filename defined file on start.\n" \ + "-p --plugin : Run as plugin. Server will be startet with a simplified gui.\n" \ + "-s --server : Run as server only without gui.\n" \ + "-v level --verbose level : Sets the verbose level for logging application info.\n" \ + " Level is a number from 0 to 3, where 0 means even\n" \ + " log debug info (most log info).\n\n" \ + "If -p and -s are set, -p will be used.\n" \ + "No parameters starts without server and full gui."; QMessageBox::information( NULL, "Invalid parameter", message ); fprintf(stderr, "Invalid parameter found. Allowed parameters are..."); exit(1); diff -r 56a36f633431 -r 3363b7bb0d41 tools/uncrustify.cfg --- a/tools/uncrustify.cfg Mon Jul 27 14:40:13 2009 +0000 +++ b/tools/uncrustify.cfg Mon Jul 27 15:17:08 2009 +0000 @@ -4,7 +4,7 @@ indent_brace_parent=false indent_namespace=false indent_extern=false -indent_class=false +indent_class=true indent_class_colon=false indent_else_if=false indent_func_call_param=true @@ -15,13 +15,14 @@ indent_template_param=false indent_func_param_double=false indent_relative_single_line_comments=false -indent_col1_comment=false +indent_col1_comment=true indent_access_spec_body=false indent_paren_nl=false indent_comma_paren=false indent_bool_paren=false indent_square_nl=false indent_preserve_sql=false +indent_align_assign=true sp_balance_nested_parens=false align_keep_tabs=false align_with_tabs=false @@ -30,8 +31,10 @@ align_func_params=false align_same_func_call_params=false align_var_def_colon=false +align_var_def_attribute=false align_var_def_inline=false align_right_cmt_mix=false +align_on_operator=false align_mix_var_proto=false align_single_line_func=false align_single_line_brace=false @@ -53,6 +56,7 @@ nl_after_brace_open=false nl_after_brace_open_cmt=false nl_after_vbrace_open=false +nl_after_brace_close=false nl_define_macro=false nl_squeeze_ifdef=false nl_ds_struct_enum_cmt=false @@ -72,6 +76,7 @@ mod_sort_using=false mod_sort_include=false mod_move_case_break=false +mod_remove_empty_return=false cmt_indent_multi=false cmt_c_group=false cmt_c_nl_start=false @@ -82,6 +87,7 @@ cmt_cpp_to_c=false cmt_star_cont=false cmt_multi_check_last=true +cmt_insert_before_preproc=false pp_indent_at_level=false pp_region_indent_code=false pp_if_indent_code=false @@ -92,6 +98,7 @@ indent_with_tabs=0 sp_after_type=ignore sp_after_sparen=add +sp_before_case_colon=add sp_func_proto_paren=remove sp_func_def_paren=remove sp_fparen_brace=add