blob: 1ce0e4ccf2e75ac0f450fb85c9a8b7cd701a6d31 (
plain)
From a4792a6b9c6f97fd2bb653169a2c8274c9a782fd Mon Sep 17 00:00:00 2001
From: Hermann Meyer <brummer-@web.de>
Date: Mon, 4 Jun 2018 10:03:08 +0200
Subject: [PATCH 1/2] * fix bug #59 Guitarix crashes when click online for
presets
---
trunk/src/gx_head/gui/gx_preset_window.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/trunk/src/gx_head/gui/gx_preset_window.cpp b/trunk/src/gx_head/gui/gx_preset_window.cpp
index 0d34390f..e09bf77f 100644
--- a/trunk/src/gx_head/gui/gx_preset_window.cpp
+++ b/trunk/src/gx_head/gui/gx_preset_window.cpp
@@ -919,6 +919,17 @@ void PresetWindow::replace_inline(std::string& subject, const std::string& searc
void PresetWindow::show_online_preset() {
+ char *dbus = getenv("DBUS_SESSION_BUS_ADDRESS");
+ if (!dbus) {
+ system("eval 'dbus-launch --sh-syntax --exit-with-session'");
+ }
+
+ dbus = getenv("DBUS_SESSION_BUS_ADDRESS");
+ if (!dbus) {
+ gx_print_error("downloadPreset", _("DBUS_SESSION_BUS_ADDRESS not detected, online prest download isn't supported!!"));
+ return;
+ }
+
Glib::RefPtr<Gio::File> dest = Gio::File::create_for_uri(Glib::filename_to_uri(options.get_online_config_filename(), resolve_hostname()));
static bool load_new = true;
static bool load = false;
--
2.14.1
|