Add path parameter to goToSandbox

This commit is contained in:
Ryan Huffman 2016-09-21 09:30:47 -07:00
parent 4c3cb83d47
commit e24a01d1fe
4 changed files with 19 additions and 10 deletions

View file

@ -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);

View file

@ -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();

View file

@ -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);

View file

@ -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();