Skip to content

Commit 7c28227

Browse files
authored
Merge pull request #189 from HughMacdonald/fix-windows-plugin-path
#188: Fix environment variable path separator on Windows
2 parents 8654cc1 + e04f89f commit 7c28227

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/global_store/src/global_store.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ bool xstudio::global_store::load_preferences(
8888
// folders
8989
char *plugin_path = std::getenv("XSTUDIO_PLUGIN_PATH");
9090
if (plugin_path) {
91-
for (const auto &p : xstudio::utility::split(plugin_path, ':')) {
91+
#ifdef _WIN32
92+
char path_env_var_sep = ';';
93+
#else
94+
char path_env_var_sep = ':';
95+
#endif
96+
for (const auto &p : xstudio::utility::split(plugin_path, path_env_var_sep)) {
9297
if (fs::is_directory(p + "/preferences"))
9398
preference_load_defaults(prefs, p + "/preferences");
9499
}

src/plugin_manager/src/plugin_manager_actor.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ PluginManagerActor::PluginManagerActor(caf::actor_config &cfg) : caf::event_base
3030
// xstudio plugins
3131
char *plugin_path = std::getenv("XSTUDIO_PLUGIN_PATH");
3232
if (plugin_path) {
33-
for (const auto &p : xstudio::utility::split(plugin_path, ':')) {
33+
#ifdef _WIN32
34+
char path_env_var_sep = ';';
35+
#else
36+
char path_env_var_sep = ':';
37+
#endif
38+
for (const auto &p : xstudio::utility::split(plugin_path, path_env_var_sep)) {
3439
manager_.emplace_front_path(p);
3540
}
3641
}

src/ui/qml/studio/src/qml_setup.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ void xstudio::ui::qml::setup_xstudio_qml_emgine(QQmlEngine *engine, caf::actor_s
131131
// with plugins
132132
char *plugin_path = std::getenv("XSTUDIO_PLUGIN_PATH");
133133
if (plugin_path) {
134-
for (const auto &p : xstudio::utility::split(plugin_path, ':')) {
134+
#ifdef _WIN32
135+
char path_env_var_sep = ';';
136+
#else
137+
char path_env_var_sep = ':';
138+
#endif
139+
for (const auto &p : xstudio::utility::split(plugin_path, path_env_var_sep)) {
135140

136141
// note - some xSTUDIO plugins have the backend plugin component
137142
// and a Qt/QML plugin component built into the same binary.

0 commit comments

Comments
 (0)