[meld/deprecation-cleanup: 35/48] bin/meld: Try to load gresources even in development
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/deprecation-cleanup: 35/48] bin/meld: Try to load gresources even in development
- Date: Sun, 2 Dec 2018 02:45:04 +0000 (UTC)
commit 243f1f6c226b71d44d11d8922d8c46e400339ceb
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 2 07:56:02 2018 +1000
bin/meld: Try to load gresources even in development
Not everything respects the gresources overlay support, so we really
want to use any resources we find, even in uninstalled mode. One
prominent example of something that won't work without the compiled
resource is the automatic loading of the shortcut window.
bin/meld | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/bin/meld b/bin/meld
index 1c4aea00..32694755 100755
--- a/bin/meld
+++ b/bin/meld
@@ -228,10 +228,14 @@ def setup_resources():
from gi.repository import Gdk
from gi.repository import GtkSource
- if not uninstalled:
- resource_file = os.path.join(meld.conf.DATADIR, "meld.gresource")
+ resource_file = os.path.join(meld.conf.DATADIR, "meld.gresource")
+ try:
resources = Gio.resource_load(resource_file)
Gio.resources_register(resources)
+ except Exception:
+ # Allow resources to be missing when running uninstalled
+ if not uninstalled:
+ raise
icon_dir = os.path.join(meld.conf.DATADIR, "icons")
Gtk.IconTheme.get_default().append_search_path(icon_dir)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]