Updated logic for loading Gtk/AppIndicator based on OS info

This commit is contained in:
nathan 2016-12-28 22:14:01 +01:00
parent 88707b5786
commit 3ee25b3935
2 changed files with 6 additions and 4 deletions

View File

@ -48,7 +48,8 @@ class AppIndicator {
boolean _isVersion3 = false; boolean _isVersion3 = false;
boolean _isLoaded = false; boolean _isLoaded = false;
if (!OS.isLinux()) { boolean shouldLoadAppIndicator = !(OS.isWindows() || OS.isMacOsX());
if (!shouldLoadAppIndicator) {
_isLoaded = true; _isLoaded = true;
} }
@ -230,7 +231,7 @@ class AppIndicator {
} }
} }
if (OS.isLinux()) { if (shouldLoadAppIndicator) {
isLoaded = _isLoaded; isLoaded = _isLoaded;
isVersion3 = _isVersion3; isVersion3 = _isVersion3;
} else { } else {

View File

@ -84,7 +84,8 @@ class Gtk {
boolean _isLoaded = false; boolean _isLoaded = false;
boolean _alreadyRunningGTK = false; boolean _alreadyRunningGTK = false;
if (!OS.isLinux()) { boolean shouldLoadGtk = !(OS.isWindows() || OS.isMacOsX());
if (!shouldLoadGtk) {
_isLoaded = true; _isLoaded = true;
} }
@ -186,7 +187,7 @@ class Gtk {
isGtk3 = false; isGtk3 = false;
} }
if (OS.isLinux() && !_isLoaded) { if (shouldLoadGtk && !_isLoaded) {
throw new RuntimeException("We apologize for this, but we are unable to determine the GTK library is in use, " + throw new RuntimeException("We apologize for this, but we are unable to determine the GTK library is in use, " +
"or even if it is in use... Please create an issue for this and include your OS type and configuration."); "or even if it is in use... Please create an issue for this and include your OS type and configuration.");
} }