diff options
Diffstat (limited to 'launcher/ui/themes/IconTheme.cpp')
-rw-r--r-- | launcher/ui/themes/IconTheme.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/launcher/ui/themes/IconTheme.cpp b/launcher/ui/themes/IconTheme.cpp new file mode 100644 index 00000000..ef245505 --- /dev/null +++ b/launcher/ui/themes/IconTheme.cpp @@ -0,0 +1,35 @@ +#include "IconTheme.h" + +#include <QFile> +#include <QSettings> + +IconTheme::IconTheme(const QString& id, const QString& path) : m_id(id), m_path(path) {} + +bool IconTheme::load() +{ + QString path = m_path + "/index.theme"; + + if (!QFile::exists(path)) + return false; + + QSettings settings(path, QSettings::IniFormat); + settings.beginGroup("Icon Theme"); + m_name = settings.value("Name").toString(); + settings.endGroup(); + return !m_name.isNull(); +} + +QString IconTheme::id() +{ + return m_id; +} + +QString IconTheme::path() +{ + return m_path; +} + +QString IconTheme::name() +{ + return m_name; +}
\ No newline at end of file |