Skip to content
Snippets Groups Projects
Commit 321878a3 authored by akiraohgaki's avatar akiraohgaki
Browse files

Add method to get KDE data home path

parent ae6c852c
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,22 @@ QString File::xdgCacheHomePath() ...@@ -58,6 +58,22 @@ QString File::xdgCacheHomePath()
return path; return path;
} }
/**
* KDE System Administration/Environment Variables
* https://userbase.kde.org/KDE_System_Administration/Environment_Variables
*/
QString File::kdeDataHomePath()
{
// KDE 4
QString path = QString::fromLocal8Bit(qgetenv("KDEHOME").constData());
if (path.isEmpty()) {
path = homePath() + "/.kde";
}
path += "/share";
return path;
}
QFileInfoList File::readDir(const QString &path) QFileInfoList File::readDir(const QString &path)
{ {
QDir dir(path); QDir dir(path);
......
...@@ -21,6 +21,7 @@ public: ...@@ -21,6 +21,7 @@ public:
static QString xdgDataHomePath(); static QString xdgDataHomePath();
static QString xdgConfigHomePath(); static QString xdgConfigHomePath();
static QString xdgCacheHomePath(); static QString xdgCacheHomePath();
static QString kdeDataHomePath();
static QFileInfoList readDir(const QString &path); static QFileInfoList readDir(const QString &path);
static bool makeDir(const QString &path); static bool makeDir(const QString &path);
static QString readText(const QString &path); static QString readText(const QString &path);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment