[gedit] Use the right config directory and avoid exception if icon doesn't exists.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Use the right config directory and avoid exception if icon doesn't exists.
- Date: Wed, 19 Jan 2011 16:51:21 +0000 (UTC)
commit a0398093e409fbf074a6b82e8712e3c169a3ca43
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Jan 19 17:51:47 2011 +0100
Use the right config directory and avoid exception if icon doesn't exists.
plugins/snippets/snippets/__init__.py | 4 ++--
plugins/snippets/snippets/completion.py | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/plugins/snippets/snippets/__init__.py b/plugins/snippets/snippets/__init__.py
index 6e817e8..caf9cff 100644
--- a/plugins/snippets/snippets/__init__.py
+++ b/plugins/snippets/snippets/__init__.py
@@ -21,7 +21,7 @@ import shutil
import cairo
-from gi.repository import Gtk, Gdk, Gedit, PeasGtk, GObject
+from gi.repository import GLib, Gtk, Gdk, Gedit, PeasGtk, GObject
import platform
from library import Library
@@ -52,7 +52,7 @@ class AppActivatable(GObject.Object, Gedit.AppActivatable, PeasGtk.Configurable)
if userdir:
snippetsdir = os.path.join(userdir, 'gedit/snippets')
else:
- snippetsdir = os.path.expanduser('~/.gnome2/gedit/snippets')
+ snippetsdir = os.path.join(GLib.get_user_config_dir(), 'gedit/snippets')
library.set_dirs(snippetsdir, self.system_dirs())
diff --git a/plugins/snippets/snippets/completion.py b/plugins/snippets/snippets/completion.py
index 03c4235..6f2ef18 100644
--- a/plugins/snippets/snippets/completion.py
+++ b/plugins/snippets/snippets/completion.py
@@ -55,7 +55,10 @@ class Provider(GObject.Object, GtkSource.CompletionProvider):
theme = Gtk.IconTheme.get_default()
f, w, h = Gtk.icon_size_lookup(Gtk.IconSize.MENU)
- self.icon = theme.load_icon(Gtk.STOCK_JUSTIFY_LEFT, w, 0)
+ try:
+ self.icon = theme.load_icon(Gtk.STOCK_JUSTIFY_LEFT, w, 0)
+ except:
+ self.icon = None
def __del__(self):
if self.mark:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]