summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-05-11 17:25:11 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-05-11 17:36:52 +0100
commit363b82fdb4016bc42877fea2ebde9227b27579fe (patch)
tree1f102c2dd0d6da446cd802825436b98380f1d574
parentb4a74af711b9645533f1c98476667fcec9d84bdc (diff)
fdo#64311 - .desktop files: use %U for URLs only if we have gvfs or gio.
Change-Id: I52c75432eb30a46b2c6a597211df09fdbb08056c
-rw-r--r--sysui/CustomTarget_share.mk11
-rwxr-xr-xsysui/desktop/menus/base.desktop4
-rwxr-xr-xsysui/desktop/menus/calc.desktop4
-rwxr-xr-xsysui/desktop/menus/draw.desktop4
-rwxr-xr-xsysui/desktop/menus/impress.desktop4
-rwxr-xr-xsysui/desktop/menus/math.desktop4
-rwxr-xr-xsysui/desktop/menus/startcenter.desktop2
-rwxr-xr-xsysui/desktop/menus/writer.desktop4
-rw-r--r--sysui/desktop/menus/xsltfilter.desktop2
-rw-r--r--sysui/desktop/share/brand.pl16
10 files changed, 38 insertions, 17 deletions
diff --git a/sysui/CustomTarget_share.mk b/sysui/CustomTarget_share.mk
index 7c2eb892edcd..4115de3f769d 100644
--- a/sysui/CustomTarget_share.mk
+++ b/sysui/CustomTarget_share.mk
@@ -7,6 +7,16 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
+ifeq ($(ENABLE_GIO),TRUE)
+ brand_URIPARAM := --urls
+else
+ifeq ($(ENABLE_GNOMEVFS),TRUE)
+ brand_URIPARAM := --urls
+else
+ brand_URIPARAM :=
+endif
+endif
+
share_WORKDIR := $(call gb_CustomTarget_get_workdir,sysui/share)
share_SRCDIR := $(SRCDIR)/sysui/desktop
@@ -201,6 +211,7 @@ $(share_WORKDIR)/%/build.flag: $(share_SRCDIR)/share/brand.pl $(LAUNCHERS) \
mkdir -p $(dir $@)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
$(PERL) $(share_SRCDIR)/share/brand.pl -p $(PRODUCTNAME.$*)$(PRODUCTVERSION) -u '$$(UNIXPRODUCTNAME)$$(BRANDPACKAGEVERSION)' \
+ $(brand_URIPARAM) \
--iconprefix '$$(UNIXBASISROOTNAME)' $^ $(share_WORKDIR)/$*
$(PERL) $(share_SRCDIR)/share/translate.pl -p $(PRODUCTNAME.$*)$(PRODUCTVERSION) -d $(share_WORKDIR)/$* \
--ext "desktop" --key "Comment" $(share_WORKDIR)/launcher_comment.ulf
diff --git a/sysui/desktop/menus/base.desktop b/sysui/desktop/menus/base.desktop
index db3a04ef5ea1..57562602dc01 100755
--- a/sysui/desktop/menus/base.desktop
+++ b/sysui/desktop/menus/base.desktop
@@ -21,7 +21,7 @@ Terminal=false
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
@@ -33,5 +33,5 @@ InitialPreference=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 d693593a1edb..81be9a8d29a0 100755
--- a/sysui/desktop/menus/calc.desktop
+++ b/sysui/desktop/menus/calc.desktop
@@ -21,7 +21,7 @@ Terminal=false
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
@@ -33,5 +33,5 @@ InitialPreference=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 297925c91b11..7de198b140eb 100755
--- a/sysui/desktop/menus/draw.desktop
+++ b/sysui/desktop/menus/draw.desktop
@@ -21,7 +21,7 @@ Terminal=false
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
@@ -33,5 +33,5 @@ InitialPreference=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 c6e3a40b700c..10c9ceccb973 100755
--- a/sysui/desktop/menus/impress.desktop
+++ b/sysui/desktop/menus/impress.desktop
@@ -21,7 +21,7 @@ Terminal=false
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
@@ -33,5 +33,5 @@ InitialPreference=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 a12a7a78a6fd..2e0d34453bd7 100755
--- a/sysui/desktop/menus/math.desktop
+++ b/sysui/desktop/menus/math.desktop
@@ -22,7 +22,7 @@ NoDisplay=true
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
@@ -34,5 +34,5 @@ InitialPreference=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 889205c72225..d8b0f1a6fe7d 100755
--- a/sysui/desktop/menus/startcenter.desktop
+++ b/sysui/desktop/menus/startcenter.desktop
@@ -22,7 +22,7 @@ NoDisplay=true
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 72fcaff46ae1..1eef64e0a722 100755
--- a/sysui/desktop/menus/writer.desktop
+++ b/sysui/desktop/menus/writer.desktop
@@ -21,7 +21,7 @@ Terminal=false
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
@@ -33,5 +33,5 @@ InitialPreference=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 8439fec9b73f..ad623dc19b92 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 f10e99dab639..ae2911be9ed0 100644
--- a/sysui/desktop/share/brand.pl
+++ b/sysui/desktop/share/brand.pl
@@ -20,10 +20,9 @@ eval 'exec perl -wS $0 ${1+"$@"}'
# 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 @@ mkdir $destdir,0777;
$productname = "LibreOffice";
$productfilename = "libreoffice";
+$urls = 0;
$prefix = "";
$iconprefix = "";
@@ -57,6 +57,10 @@ while ($_ = $ARGV[0], /^-/) {
$category = $ARGV[0];
shift;
}
+ # Whether we can handle URLs on the command-line
+ if (/^--urls/) {
+ $urls = 1;
+ }
}
@@ -110,6 +114,12 @@ while (<>) {
# replace %PRODUCTNAME placeholders
s/%PRODUCTNAME/$productname/g;
+ if ( $urls ) {
+ s/%%FILE%%/%U/g;
+ } else {
+ s/%%FILE%%/%F/g;
+ }
+
print OUTFILE "$_\n";
}