mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-27 19:19:53 +02:00
Add path parameter to goToSandbox
This commit is contained in:
parent
4c3cb83d47
commit
e24a01d1fe
4 changed files with 19 additions and 10 deletions
|
@ -92,7 +92,7 @@ public slots:
|
|||
|
||||
void goBack();
|
||||
void goForward();
|
||||
void goToLocalSandbox(LookupTrigger trigger = LookupTrigger::StartupFromSettings) { handleUrl(SANDBOX_HIFI_ADDRESS, trigger); }
|
||||
void goToLocalSandbox(QString path = "", LookupTrigger trigger = LookupTrigger::StartupFromSettings) { handleUrl(SANDBOX_HIFI_ADDRESS + path, trigger); }
|
||||
void goToEntry(LookupTrigger trigger = LookupTrigger::StartupFromSettings) { handleUrl(DEFAULT_HIFI_ADDRESS, trigger); }
|
||||
|
||||
void goToUser(const QString& username);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <QDir>
|
||||
#include <QUrl>
|
||||
#include "PathUtils.h"
|
||||
#include <QtCore/QStandardPaths>
|
||||
|
||||
|
||||
const QString& PathUtils::resourcesPath() {
|
||||
|
@ -29,6 +30,19 @@ const QString& PathUtils::resourcesPath() {
|
|||
return staticResourcePath;
|
||||
}
|
||||
|
||||
QString PathUtils::getRootDataDirectory() {
|
||||
auto dataPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
dataPath += "/AppData/Roaming/";
|
||||
#elif defined(Q_OS_OSX)
|
||||
dataPath += "/Library/Application Support/";
|
||||
#else
|
||||
dataPath += "/.local/share/";
|
||||
#endif
|
||||
|
||||
return dataPath;
|
||||
}
|
||||
|
||||
QString fileNameWithoutExtension(const QString& fileName, const QVector<QString> possibleExtensions) {
|
||||
QString fileNameLowered = fileName.toLower();
|
||||
|
|
|
@ -22,6 +22,7 @@ class PathUtils : public QObject, public Dependency {
|
|||
Q_PROPERTY(QString resources READ resourcesPath)
|
||||
public:
|
||||
static const QString& resourcesPath();
|
||||
static QString getRootDataDirectory();
|
||||
};
|
||||
|
||||
QString fileNameWithoutExtension(const QString& fileName, const QVector<QString> possibleExtensions);
|
||||
|
|
|
@ -15,16 +15,10 @@
|
|||
#include <QtWidgets/qapplication.h>
|
||||
#include <QDebug>
|
||||
|
||||
QString ServerPathUtils::getDataDirectory() {
|
||||
auto dataPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
#include "PathUtils.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
dataPath += "/AppData/Roaming/";
|
||||
#elif defined(Q_OS_OSX)
|
||||
dataPath += "/Library/Application Support/";
|
||||
#else
|
||||
dataPath += "/.local/share/";
|
||||
#endif
|
||||
QString ServerPathUtils::getDataDirectory() {
|
||||
auto dataPath = PathUtils::getRootDataDirectory();
|
||||
|
||||
dataPath += qApp->organizationName() + "/" + qApp->applicationName();
|
||||
|
||||
|
|
Loading…
Reference in a new issue