various UI reimplementations from 0.1.x

This commit is contained in:
itsmattkc
2019-09-26 03:49:49 +10:00
parent c19718a4a5
commit 56e3fd41e5
70 changed files with 2056 additions and 1483 deletions
+20
View File
@@ -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();
}