[meld] Allow re-opening stored comparison using single arg invocation
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Allow re-opening stored comparison using single arg invocation
- Date: Sun, 16 Dec 2012 20:03:25 +0000 (UTC)
commit 7d130696f98f7cab45b8a6c2b111c53cf962539f
Author: Kai Willadsen <kai willadsen gmail com>
Date: Mon Dec 17 05:12:31 2012 +1000
Allow re-opening stored comparison using single arg invocation
This form exists only to make recent comparisons work better from the
.desktop file; otherwise, we have to limit the desktop file to only
opening recent comparisons, or provide a second shim executable.
data/meld.desktop.in | 2 +-
meld/meldapp.py | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/data/meld.desktop.in b/data/meld.desktop.in
index 182091a..494c12c 100644
--- a/data/meld.desktop.in
+++ b/data/meld.desktop.in
@@ -3,7 +3,7 @@ _Name=Meld
_GenericName=Diff Viewer
_X-GNOME-FullName=Meld Diff Viewer
_Comment=Compare and merge your files
-Exec=meld --comparison-file=%F
+Exec=meld %F
Terminal=false
Type=Application
Icon=meld
diff --git a/meld/meldapp.py b/meld/meldapp.py
index 1f4d57d..8974d07 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -147,8 +147,10 @@ class MeldApp(gobject.GObject):
for files in options.diff:
open_paths(files)
- if options.comparison_file:
- comparison_file_path = os.path.expanduser(options.comparison_file)
+ if options.comparison_file or (len(args) == 1 and
+ args[0].endswith(".meldcmp")):
+ path = options.comparison_file or args[0]
+ comparison_file_path = os.path.expanduser(path)
gio_file = gio.File(path=comparison_file_path)
try:
tab = self.window.append_recent(gio_file.get_uri())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]