diff options
Diffstat (limited to 'text_file_functions.cpp')
| -rw-r--r-- | text_file_functions.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/text_file_functions.cpp b/text_file_functions.cpp new file mode 100644 index 0000000..336b76c --- /dev/null +++ b/text_file_functions.cpp @@ -0,0 +1,29 @@ +#include <QTextStream> +#include <QStringList> + +#include "path_functions.h" + +#include "text_file_functions.h" + +QString get_user_theme(){ + QFile config_file(get_base_path() + "config.ini"); + if (!config_file.open(QIODevice::ReadOnly)) + return "default"; + + QTextStream in(&config_file); + + while(!in.atEnd()) + { + QString line = in.readLine(); + + if (line.startsWith("theme")) + { + QStringList line_elements = line.split("="); + + if (line_elements.size() > 1) + return line_elements.at(1).trimmed(); + } + } + + return "default"; +} |
