[gedit-latex] Fix new document template



commit 19f293b9c1b40d36231f45c2567536b234e0ac25
Author: John Stowers <john stowers gmail com>
Date:   Fri Jun 24 17:41:45 2011 +1200

    Fix new document template

 latex/base/decorators.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/latex/base/decorators.py b/latex/base/decorators.py
index 89c3c07..910ae8d 100644
--- a/latex/base/decorators.py
+++ b/latex/base/decorators.py
@@ -26,8 +26,7 @@ extension point.
 """
 
 from logging import getLogger
-from gi.repository import Gedit
-from gi.repository import Gtk
+from gi.repository import Gedit, Gtk, Gio
 import string
 
 from config import UI, WINDOW_SCOPE_VIEWS, EDITOR_SCOPE_VIEWS, EDITORS, ACTIONS
@@ -292,11 +291,15 @@ class GeditWindowDecorator(IPreferencesMonitor):
 				return
 		
 		# not found, open file in a new tab...
-		
+
 		uri = file.uri
-		self._log.debug("GeditWindow.create_tab_from_uri(%s)" % uri)
-		if Gedit.utils.uri_is_valid(uri):
-			self._window.create_tab_from_uri(file.uri, Gedit.encoding_get_current(), 1, False, True)
+		gfile = Gio.file_new_for_uri(uri)
+
+		if Gedit.utils_is_valid_location(gfile):
+			self._log.debug("GeditWindow.create_tab_from_uri(%s)" % uri)
+			self._window.create_tab_from_location(
+							gfile, Gedit.encoding_get_current(),
+							1, 1, False, True)
 		else:
 			self._log.error("Gedit.utils.uri_is_valid(%s) = False" % uri)
 	



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]