various UI reimplementations from 0.1.x
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "filefunctions.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QCryptographicHash>
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
@@ -73,3 +74,22 @@ QString GetMediaCacheLocation()
|
||||
|
||||
return media_cache_dir.absolutePath();
|
||||
}
|
||||
|
||||
QString GetConfigurationLocation()
|
||||
{
|
||||
if (IsPortable()) {
|
||||
return GetApplicationPath();
|
||||
} else {
|
||||
return QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||
}
|
||||
}
|
||||
|
||||
bool IsPortable()
|
||||
{
|
||||
return QFileInfo::exists(QDir(GetApplicationPath()).filePath("portable"));
|
||||
}
|
||||
|
||||
QString GetApplicationPath()
|
||||
{
|
||||
return QCoreApplication::applicationDirPath();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user