@@ -25,8 +25,10 @@
2525#include "registry-tracker.h"
2626
2727
28−RegistryTracker::RegistryTracker(QString const& scope_dir):
29− m_scopeDir(scope_dir),
28+RegistryTracker::RegistryTracker(QStringList const& scopes, bool systemScopes, bool serverScopes):
29+ m_scopes(scopes),
30+ m_systemScopes(systemScopes),
31+ m_serverScopes(serverScopes),
3032 m_registry(nullptr),
3133 m_endpoints_dir(QDir::temp().filePath("scope-dev-endpoints.XXXXXX"))
3234{
@@ -56,7 +58,8 @@ RegistryTracker::~RegistryTracker()
5658"Zmq.EndpointDir = %2\n" \
5759"Zmq.ConfigFile = %3\n" \
5860"Scope.InstallDir = %4\n" \
59−"Scoperunner.Path = %5\n"
61+"Scoperunner.Path = %5\n" \
62+"%6"
6063
6164#define MW_CONFIG \
6265"[Zmq]\n" \
@@ -95,7 +98,17 @@ void RegistryTracker::runRegistry()
9598 QString scopeRunnerPath = QDir(scopesLibdir).filePath("scoperunner/scoperunner");
9699
97100 QString runtime_ini = QString(RUNTIME_CONFIG).arg(m_registry_config.fileName()).arg(m_mw_config.fileName());
98− QString registry_ini = QString(REGISTRY_CONFIG).arg(m_endpoints_dir.path()).arg(m_endpoints_dir.path()).arg(m_mw_config.fileName()).arg(m_scopeDir).arg(scopeRunnerPath);
101+ // FIXME: keep in sync with the SSRegistry config
102+ QString serverRegistryConfig(m_serverScopes ? "SS.Registry.Identity = SSRegistry\nSS.Registry.Endpoint = ipc:///tmp/SSRegistry" : "");
103+ QString scopeInstallDir(scopesLibdir + "/unity-scopes");
104+ if (!m_systemScopes) {
105+ m_scopeInstallDir.reset(new QTemporaryDir(tmp.filePath("scopes.XXXXXX")));
106+ if (!m_scopeInstallDir->isValid()) {
107+ qWarning("Unable to create temporary scopes directory!");
108+ }
109+ scopeInstallDir = m_scopeInstallDir->path();
110+ }
111+ QString registry_ini = QString(REGISTRY_CONFIG).arg(m_endpoints_dir.path()).arg(m_endpoints_dir.path()).arg(m_mw_config.fileName()).arg(scopeInstallDir).arg(scopeRunnerPath).arg(serverRegistryConfig);
99112 QString mw_ini = QString(MW_CONFIG).arg(m_endpoints_dir.path()).arg(m_endpoints_dir.path());
100113
101114 m_runtime_config.write(runtime_ini.toUtf8());
@@ -111,6 +124,7 @@ void RegistryTracker::runRegistry()
111124 QString registryBin(QDir(scopesLibdir).filePath("scoperegistry/scoperegistry"));
112125 QStringList arguments;
113126 arguments << m_runtime_config.fileName();
127+ arguments << m_scopes;
114128
115129 m_registry.start(registryBin, arguments);
116130}