[meld] Replace GnomeVFS use with gio for drag-n-drop in MeldApp
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Replace GnomeVFS use with gio for drag-n-drop in MeldApp
- Date: Fri, 22 Oct 2010 20:39:50 +0000 (UTC)
commit f0f945a658db478a0d8758bceb6e39187e2f0293
Author: Kai Willadsen <kai willadsen gmail com>
Date: Wed Oct 20 08:02:47 2010 +1000
Replace GnomeVFS use with gio for drag-n-drop in MeldApp
meld/meldapp.py | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/meld/meldapp.py b/meld/meldapp.py
index 96bcdde..0f6d771 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -20,17 +20,10 @@ import os
import optparse
from gettext import gettext as _
-# gtk
+import gio
import gtk
import gobject
-# Drag'N'Drop support needs gnomevfs
-try:
- import gnomevfs
- gnomevfs_available = True
-except ImportError:
- gnomevfs_available = False
-
# project
import paths
from ui import gnomeglade
@@ -209,8 +202,8 @@ class MeldApp(gnomeglade.Component):
gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP,
[ ('text/uri-list', 0, 0) ],
gtk.gdk.ACTION_COPY)
- if gnomevfs_available:
- self.widget.connect('drag_data_received', self.on_widget_drag_data_received)
+ self.widget.connect("drag_data_received",
+ self.on_widget_drag_data_received)
self.toolbar.set_style( self.prefs.get_toolbar_style() )
self.toolbar.props.visible = self.prefs.toolbar_visible
self.status_box.props.visible = self.prefs.statusbar_visible
@@ -235,7 +228,9 @@ class MeldApp(gnomeglade.Component):
def on_widget_drag_data_received(self, wid, context, x, y, selection_data, info, time):
if len(selection_data.get_uris()) != 0:
- paths = [gnomevfs.get_local_path_from_uri(u) for u in selection_data.get_uris()]
+ paths = []
+ for uri in selection_data.get_uris():
+ paths.append(gio.File(uri=uri).get_path())
self.open_paths(paths)
return True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]