UniversalIndentGUI 1.2.0
|
SettingsPaths is a pure static functions class from which info about the paths needed for settings can be retrieved. More...
#include <SettingsPaths.h>
Static Public Member Functions | |
static void | cleanAndRemoveTempDir () |
Completely deletes the created temporary directory with all of its content. | |
static const QString | getApplicationBinaryPath () |
Returns the path of the applications executable. | |
static const QString | getGlobalFilesPath () |
Returns the path where the files concerning all users reside. For example translations. | |
static const QString | getIndenterPath () |
Returns the path where the indenter executables reside. | |
static bool | getPortableMode () |
Returns true if portable mode shall be used. | |
static const QString | getSettingsPath () |
Returns the path where all settings are being/should be written to. | |
static const QString | getTempPath () |
Returns the path where the where all temporary data should be written to. | |
static void | init () |
Initializes all available information about the paths. | |
Private Member Functions | |
SettingsPaths () | |
Static Private Attributes | |
static bool | _alreadyInitialized = false |
static QString | _applicationBinaryPath = "" |
static QString | _globalFilesPath = "" |
static QString | _indenterPath = "" |
static bool | _portableMode = false |
static QString | _settingsPath = "" |
static QString | _tempPath = "" |
SettingsPaths is a pure static functions class from which info about the paths needed for settings can be retrieved.
Definition at line 26 of file SettingsPaths.h.
SettingsPaths::SettingsPaths | ( | ) | [private] |
void SettingsPaths::cleanAndRemoveTempDir | ( | ) | [static] |
Completely deletes the created temporary directory with all of its content.
Definition at line 234 of file SettingsPaths.cpp.
References _tempPath.
Referenced by main().
const QString SettingsPaths::getApplicationBinaryPath | ( | ) | [static] |
Returns the path of the applications executable.
Definition at line 168 of file SettingsPaths.cpp.
References _alreadyInitialized, _applicationBinaryPath, and init().
const QString SettingsPaths::getGlobalFilesPath | ( | ) | [static] |
Returns the path where the files concerning all users reside. For example translations.
Definition at line 190 of file SettingsPaths.cpp.
References _alreadyInitialized, _globalFilesPath, and init().
Referenced by MainWindow::initApplicationLanguage(), MainWindow::languageChanged(), UiGuiSettings::readAvailableTranslations(), and UiGuiSettings::UiGuiSettings().
const QString SettingsPaths::getIndenterPath | ( | ) | [static] |
Returns the path where the indenter executables reside.
Definition at line 201 of file SettingsPaths.cpp.
References _alreadyInitialized, _indenterPath, and init().
Referenced by IndentHandler::IndentHandler(), and MainWindow::loadLastOpenedFile().
bool SettingsPaths::getPortableMode | ( | ) | [static] |
Returns true if portable mode shall be used.
Definition at line 223 of file SettingsPaths.cpp.
References _alreadyInitialized, _portableMode, and init().
const QString SettingsPaths::getSettingsPath | ( | ) | [static] |
Returns the path where all settings are being/should be written to.
Definition at line 179 of file SettingsPaths.cpp.
References _alreadyInitialized, _settingsPath, and init().
Referenced by IndentHandler::IndentHandler(), UiGuiHighlighter::UiGuiHighlighter(), and UiGuiSettings::UiGuiSettings().
const QString SettingsPaths::getTempPath | ( | ) | [static] |
Returns the path where the where all temporary data should be written to.
Definition at line 212 of file SettingsPaths.cpp.
References _alreadyInitialized, _tempPath, and init().
Referenced by IndentHandler::IndentHandler(), and tschweitzer::debugging::TSLogger::writeToLogFile().
void SettingsPaths::init | ( | ) | [static] |
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.
Definition at line 59 of file SettingsPaths.cpp.
References _alreadyInitialized, _applicationBinaryPath, _globalFilesPath, _indenterPath, _portableMode, _settingsPath, and _tempPath.
Referenced by getApplicationBinaryPath(), getGlobalFilesPath(), getIndenterPath(), getPortableMode(), getSettingsPath(), and getTempPath().
bool SettingsPaths::_alreadyInitialized = false [static, private] |
Definition at line 41 of file SettingsPaths.h.
Referenced by getApplicationBinaryPath(), getGlobalFilesPath(), getIndenterPath(), getPortableMode(), getSettingsPath(), getTempPath(), and init().
QString SettingsPaths::_applicationBinaryPath = "" [static, private] |
Definition at line 42 of file SettingsPaths.h.
Referenced by getApplicationBinaryPath(), and init().
QString SettingsPaths::_globalFilesPath = "" [static, private] |
Definition at line 44 of file SettingsPaths.h.
Referenced by getGlobalFilesPath(), and init().
QString SettingsPaths::_indenterPath = "" [static, private] |
Definition at line 45 of file SettingsPaths.h.
Referenced by getIndenterPath(), and init().
bool SettingsPaths::_portableMode = false [static, private] |
Definition at line 47 of file SettingsPaths.h.
Referenced by getPortableMode(), and init().
QString SettingsPaths::_settingsPath = "" [static, private] |
Definition at line 43 of file SettingsPaths.h.
Referenced by getSettingsPath(), and init().
QString SettingsPaths::_tempPath = "" [static, private] |
Definition at line 46 of file SettingsPaths.h.
Referenced by cleanAndRemoveTempDir(), getTempPath(), and init().