[PATCH libreoffice-4-0] fdo#64311 - .desktop files: use %U for URLs only if we have ...
Fridrich Strba (via Code Review)
gerrit at gerrit.libreoffice.org
Mon May 13 01:03:34 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3880
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/80/3880/1
fdo#64311 - .desktop files: use %U for URLs only if we have gvfs or gio.
(cherry picked from commit 363b82fdb4016bc42877fea2ebde9227b27579fe)
Signed-off-by: Fridrich Štrba <fridrich.strba at bluewin.ch>
Conflicts:
sysui/CustomTarget_share.mk
Change-Id: I52c75432eb30a46b2c6a597211df09fdbb08056c
---
M sysui/desktop/menus/base.desktop
M sysui/desktop/menus/calc.desktop
M sysui/desktop/menus/draw.desktop
M sysui/desktop/menus/impress.desktop
M sysui/desktop/menus/math.desktop
M sysui/desktop/menus/startcenter.desktop
M sysui/desktop/menus/writer.desktop
M sysui/desktop/menus/xsltfilter.desktop
M sysui/desktop/share/brand.pl
M sysui/desktop/share/makefile.mk
10 files changed, 38 insertions(+), 18 deletions(-)
diff --git a/sysui/desktop/menus/base.desktop b/sysui/desktop/menus/base.desktop
index dcc43b9..9d47dbe 100755
--- a/sysui/desktop/menus/base.desktop
+++ b/sysui/desktop/menus/base.desktop
@@ -21,7 +21,7 @@
Icon=base
Type=Application
Categories=Office;Database;X-Red-Hat-Base;X-MandrivaLinux-MoreApplications-Databases;
-Exec=${UNIXBASISROOTNAME} --base %U
+Exec=${UNIXBASISROOTNAME} --base %%FILE%%
MimeType=application/vnd.oasis.opendocument.database;application/vnd.sun.xml.base;
Name=%PRODUCTNAME Base
GenericName=Database Development
@@ -31,5 +31,5 @@
X-Ayatana-Desktop-Shortcuts=X-New
[X-New Shortcut Group]
UnityQuicklist=New Database
-Exec=libreoffice --base %U
+Exec=libreoffice --base %%FILE%%
TargetEnvironment=Unity
diff --git a/sysui/desktop/menus/calc.desktop b/sysui/desktop/menus/calc.desktop
index 4c331c3..5a4ae2f 100755
--- a/sysui/desktop/menus/calc.desktop
+++ b/sysui/desktop/menus/calc.desktop
@@ -21,7 +21,7 @@
Icon=calc
Type=Application
Categories=Office;Spreadsheet;X-Red-Hat-Base;X-MandrivaLinux-Office-Spreadsheets;
-Exec=${UNIXBASISROOTNAME} --calc %U
+Exec=${UNIXBASISROOTNAME} --calc %%FILE%%
MimeType=application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.spreadsheet-template;application/vnd.sun.xml.calc;application/vnd.sun.xml.calc.template;application/msexcel;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroenabled.12;application/vnd.ms-excel.sheet.binary.macroenabled.12;text/csv;application/x-dbf;text/spreadsheet;application/csv;application/excel;application/tab-separated-values;application/vnd.lotus-1-2-3;application/vnd.oasis.opendocument.chart;application/vnd.oasis.opendocument.chart-template;application/x-dbase;application/x-dos_ms_excel;application/x-excel;application/x-msexcel;application/x-ms-excel;application/x-quattropro;application/x-123;text/comma-separated-values;text/tab-separated-values;text/x-comma-separated-values;text/x-csv
;
Name=%PRODUCTNAME Calc
GenericName=Spreadsheet
@@ -31,5 +31,5 @@
X-Ayatana-Desktop-Shortcuts=X-New
[X-New Shortcut Group]
UnityQuicklist=New Spreadsheet
-Exec=libreoffice --calc %U
+Exec=libreoffice --calc %%FILE%%
TargetEnvironment=Unity
diff --git a/sysui/desktop/menus/draw.desktop b/sysui/desktop/menus/draw.desktop
index 2ffee61..4d32a2f 100755
--- a/sysui/desktop/menus/draw.desktop
+++ b/sysui/desktop/menus/draw.desktop
@@ -21,7 +21,7 @@
Icon=draw
Type=Application
Categories=Office;FlowChart;Graphics;2DGraphics;VectorGraphics;X-Red-Hat-Base;X-MandrivaLinux-Office-Drawing;
-Exec=${UNIXBASISROOTNAME} --draw %U
+Exec=${UNIXBASISROOTNAME} --draw %%FILE%%
MimeType=application/vnd.oasis.opendocument.graphics;application/vnd.oasis.opendocument.graphics-template;application/vnd.sun.xml.draw;application/vnd.sun.xml.draw.template;application/vnd.visio;application/x-wpg;
Name=%PRODUCTNAME Draw
GenericName=Drawing Program
@@ -31,5 +31,5 @@
X-Ayatana-Desktop-Shortcuts=X-New
[X-New Shortcut Group]
UnityQuicklist=New Drawing
-Exec=libreoffice --draw %U
+Exec=libreoffice --draw %%FILE%%
TargetEnvironment=Unity
diff --git a/sysui/desktop/menus/impress.desktop b/sysui/desktop/menus/impress.desktop
index 3c0b151..e2a33aa 100755
--- a/sysui/desktop/menus/impress.desktop
+++ b/sysui/desktop/menus/impress.desktop
@@ -21,7 +21,7 @@
Icon=impress
Type=Application
Categories=Office;Presentation;X-Red-Hat-Base;X-MandrivaLinux-Office-Presentations;
-Exec=${UNIXBASISROOTNAME} --impress %U
+Exec=${UNIXBASISROOTNAME} --impress %%FILE%%
MimeType=application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/vnd.sun.xml.impress;application/vnd.sun.xml.impress.template;application/mspowerpoint;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.slide;application/vnd.openxmlformats-officedocument.presentationml.slideshow;application/vnd.ms-powerpoint.slideshow.macroEnabled.12;
Name=%PRODUCTNAME Impress
GenericName=Presentation
@@ -31,5 +31,5 @@
X-Ayatana-Desktop-Shortcuts=X-New
[X-New Shortcut Group]
UnityQuicklist=New Presentation
-Exec=libreoffice --impress %U
+Exec=libreoffice --impress %%FILE%%
TargetEnvironment=Unity
diff --git a/sysui/desktop/menus/math.desktop b/sysui/desktop/menus/math.desktop
index 5a11c62..c6b0ea4 100755
--- a/sysui/desktop/menus/math.desktop
+++ b/sysui/desktop/menus/math.desktop
@@ -22,7 +22,7 @@
Icon=math
Type=Application
Categories=Office;Education;Science;Math;X-Red-Hat-Base;X-MandrivaLinux-Office-Other;
-Exec=${UNIXBASISROOTNAME} --math %U
+Exec=${UNIXBASISROOTNAME} --math %%FILE%%
MimeType=application/vnd.oasis.opendocument.formula;application/vnd.sun.xml.math;application/vnd.oasis.opendocument.formula-template;text/mathml;
Name=%PRODUCTNAME Math
GenericName=Formula Editor
@@ -32,5 +32,5 @@
X-Ayatana-Desktop-Shortcuts=X-New
[X-New Shortcut Group]
UnityQuicklist=New Formula
-Exec=libreoffice --math %U
+Exec=libreoffice --math %%FILE%%
TargetEnvironment=Unity
diff --git a/sysui/desktop/menus/startcenter.desktop b/sysui/desktop/menus/startcenter.desktop
index 61664306..6e9ef9c 100755
--- a/sysui/desktop/menus/startcenter.desktop
+++ b/sysui/desktop/menus/startcenter.desktop
@@ -21,7 +21,7 @@
Icon=startcenter
Type=Application
Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Other;
-Exec=${UNIXBASISROOTNAME} %U
+Exec=${UNIXBASISROOTNAME} %%FILE%%
MimeType=application/vnd.openofficeorg.extension;
Name=%PRODUCTNAME
GenericName=Office
diff --git a/sysui/desktop/menus/writer.desktop b/sysui/desktop/menus/writer.desktop
index 7c4aaed..0cca788 100755
--- a/sysui/desktop/menus/writer.desktop
+++ b/sysui/desktop/menus/writer.desktop
@@ -21,7 +21,7 @@
Icon=writer
Type=Application
Categories=Office;WordProcessor;X-Red-Hat-Base;X-MandrivaLinux-Office-Wordprocessors;
-Exec=${UNIXBASISROOTNAME} --writer %U
+Exec=${UNIXBASISROOTNAME} --writer %%FILE%%
MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/msword;application/vnd.ms-word;application/x-doc;application/x-hwp;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.lotus-wordpro;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.ms-works;application/vnd.stardivision.writer-global;application/x-extension-txt;application/x-t602;text/plain;
Name=%PRODUCTNAME Writer
GenericName=Word Processor
@@ -31,5 +31,5 @@
X-Ayatana-Desktop-Shortcuts=X-New
[X-New Shortcut Group]
UnityQuicklist=New Document
-Exec=libreoffice --writer %U
+Exec=libreoffice --writer %%FILE%%
TargetEnvironment=Unity
diff --git a/sysui/desktop/menus/xsltfilter.desktop b/sysui/desktop/menus/xsltfilter.desktop
index a6c3b1b..fd66aa2 100644
--- a/sysui/desktop/menus/xsltfilter.desktop
+++ b/sysui/desktop/menus/xsltfilter.desktop
@@ -2,7 +2,7 @@
Version=1.0
Terminal=false
Type=Application
-Exec=${UNIXBASISROOTNAME} %U
+Exec=${UNIXBASISROOTNAME} %%FILE%%
MimeType=application/vnd.oasis.opendocument.text-flat-xml;application/vnd.oasis.opendocument.spreadsheet-flat-xml;application/vnd.oasis.opendocument.graphics-flat-xml;application/vnd.oasis.opendocument.presentation-flat-xml;
Name=%PRODUCTNAME XSLT based filters
GenericName=XSLT based filters
diff --git a/sysui/desktop/share/brand.pl b/sysui/desktop/share/brand.pl
index f10e99d..ae2911b 100644
--- a/sysui/desktop/share/brand.pl
+++ b/sysui/desktop/share/brand.pl
@@ -20,10 +20,9 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
-
-#*********************************************************************
#
-# main
+# This tool is used to re-write and substitute variables
+# into Unix .desktop, mimelnk, .keys files etc.
#
$destdir = pop @ARGV;
@@ -31,6 +30,7 @@
$productname = "LibreOffice";
$productfilename = "libreoffice";
+$urls = 0;
$prefix = "";
$iconprefix = "";
@@ -56,6 +56,10 @@
if (/^--category/) {
$category = $ARGV[0];
shift;
+ }
+ # Whether we can handle URLs on the command-line
+ if (/^--urls/) {
+ $urls = 1;
}
}
@@ -110,6 +114,12 @@
# replace %PRODUCTNAME placeholders
s/%PRODUCTNAME/$productname/g;
+ if ( $urls ) {
+ s/%%FILE%%/%U/g;
+ } else {
+ s/%%FILE%%/%F/g;
+ }
+
print OUTFILE "$_\n";
}
diff --git a/sysui/desktop/share/makefile.mk b/sysui/desktop/share/makefile.mk
index 4614e8b..57dd6d5 100644
--- a/sysui/desktop/share/makefile.mk
+++ b/sysui/desktop/share/makefile.mk
@@ -31,6 +31,16 @@
# --- Files --------------------------------------------------------
+.IF "$(ENABLE_GIO)"=="TRUE"
+BRAND_URIPARAM:=--urls
+.ELSE # "$(ENABLE_GIO)"!="TRUE"
+.IF "$(ENABLE_GNOMEVFS)"=="TRUE"
+BRAND_URIPARAM:=--urls
+.ELSE # "$(ENABLE_GNOMEVFS)"!="TRUE"
+BRAND_URIPARAM:=
+.ENDIF # "$(ENABLE_GNOMEVFS)"=="TRUE"
+.ENDIF # "$(ENABLE_GIO)"=="TRUE"
+
.IF "$(WITH_LANG)"!=""
ULFDIR:=$(COMMONMISC)$/$(TARGET)
.ELSE # "$(WITH_LANG)"!=""
@@ -147,7 +157,7 @@
@@-$(MKDIRHIER) $(@:db).$(INPATH).$(@:f)
@echo Creating desktop entries for $(@:f) ..
@echo ---------------------------------
- @$(PERL) brand.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -u $(UNIXWRAPPERNAME) --iconprefix '$${{UNIXBASISROOTNAME}}-' $< $(@:db).$(INPATH).$(@:f)
+ @$(PERL) brand.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -u $(UNIXWRAPPERNAME) $(BRAND_URIPARAM) --iconprefix '$${{UNIXBASISROOTNAME}}-' $< $(@:db).$(INPATH).$(@:f)
@$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Name" $(ULFDIR)$/launcher_name.ulf
@$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "Comment" $(ULFDIR)$/launcher_comment.ulf
@$(PERL) translate.pl -p '$${{PRODUCTNAME}} $${{PRODUCTVERSION}}' -d $(@:db).$(INPATH).$(@:f) --ext "desktop" --key "GenericName" $(ULFDIR)$/launcher_genericname.ulf
--
To view, visit https://gerrit.libreoffice.org/3880
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I52c75432eb30a46b2c6a597211df09fdbb08056c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Fridrich Strba <fridrich at documentfoundation.org>
Gerrit-Reviewer: Michael Meeks <michael.meeks at suse.com>
More information about the LibreOffice
mailing list