Const declarations to enforce singleton capability

This commit is contained in:
Simon Walton 2019-01-22 18:05:47 -08:00
parent 3a5d550fa5
commit 77293150b7
2 changed files with 6 additions and 8 deletions

View file

@ -22,7 +22,9 @@
#include <ui/TabletScriptingInterface.h>
#include "scripting/HMDScriptingInterface.h"
QmlCommerce::QmlCommerce() {
QmlCommerce::QmlCommerce() :
_appsPath(PathUtils::getAppDataPath() + "Apps/")
{
auto ledger = DependencyManager::get<Ledger>();
auto wallet = DependencyManager::get<Wallet>();
connect(ledger.data(), &Ledger::buyResult, this, &QmlCommerce::buyResult);
@ -44,22 +46,18 @@ QmlCommerce::QmlCommerce() {
auto accountManager = DependencyManager::get<AccountManager>();
connect(accountManager.data(), &AccountManager::usernameChanged, this, [&]() { setPassphrase(""); });
_appsPath = PathUtils::getAppDataPath() + "Apps/";
}
void QmlCommerce::openSystemApp(const QString& appName) {
static QMap<QString, QString> systemApps {
static const QMap<QString, QString> systemApps {
{"GOTO", "hifi/tablet/TabletAddressDialog.qml"},
{"PEOPLE", "hifi/Pal.qml"},
{"WALLET", "hifi/commerce/wallet/Wallet.qml"},
{"MARKET", "/marketplace.html"}
};
static QMap<QString, QString> systemInject{
static const QMap<QString, QString> systemInject{
{"MARKET", "/scripts/system/html/js/marketplacesInject.js"}
};

View file

@ -100,7 +100,7 @@ protected:
Q_INVOKABLE void updateItem(const QString& certificateId);
private:
QString _appsPath;
const QString _appsPath;
};
#endif // hifi_QmlCommerce_h