[Xfce4-commits] <midori:master> Add .desktop file validation unit test and fix errors
Christian Dywan
noreply at xfce.org
Wed Mar 13 20:04:03 CET 2013
Updating branch refs/heads/master
to 576cdf1680c19843350621786f76642f04be2c03 (commit)
from 169ac19c84ced184adcac96eef0a802e8577f802 (commit)
commit 576cdf1680c19843350621786f76642f04be2c03
Author: Christian Dywan <christian at twotoasts.de>
Date: Wed Mar 13 20:01:10 2013 +0100
Add .desktop file validation unit test and fix errors
Pantheon not being recognized is a known false positive.
data/midori-private.desktop.in | 2 +-
data/midori.desktop.in | 5 +----
tests/desktop.sh | 21 +++++++++++++++++++++
3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/data/midori-private.desktop.in b/data/midori-private.desktop.in
index 66ba297..f34f914 100644
--- a/data/midori-private.desktop.in
+++ b/data/midori-private.desktop.in
@@ -9,7 +9,7 @@ Exec=midori --private %U
Icon=midori
Terminal=false
StartupNotify=true
-NotShowIn=Pantheon
+NotShowIn=Pantheon;
X-Osso-Type=application/x-executable
X-Osso-Service=midori
diff --git a/data/midori.desktop.in b/data/midori.desktop.in
index b81af79..ea50e18 100644
--- a/data/midori.desktop.in
+++ b/data/midori.desktop.in
@@ -15,20 +15,17 @@ Terminal=false
StartupNotify=true
X-Osso-Type=application/x-executable
X-Osso-Service=midori
-Actions=TabNew;WindowNew;Private
+Actions=TabNew;WindowNew;Private;
[Desktop Action TabNew]
_Name=New Tab
Exec=midori -e TabNew
-TargetEnvironment=Unity
[Desktop Action WindowNew]
_Name=New Window
Exec=midori -e WindowNew
-TargetEnvironment=Unity
[Desktop Action Private]
_Name=New Private Browsing Window
Exec=midori --private
-TargetEnvironment=Unity
diff --git a/tests/desktop.sh b/tests/desktop.sh
new file mode 100755
index 0000000..c670ab8
--- /dev/null
+++ b/tests/desktop.sh
@@ -0,0 +1,21 @@
+#! /usr/bin/env sh
+# Copyright 2013 Christian Dywan <christian at twotoasts.de>
+#
+# This script is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+echo Validating .desktop files
+test -z $(which desktop-file-validate) && echo ...SKIPPED: not installed && return 0
+test -z "$SRCDIR" && SRCDIR=$PWD
+test -z "$BLDDIR" && BLDDIR=_build
+cd "$SRCDIR/$BLDDIR/default/data"
+ERRORS=0
+for i in $(ls | GREP_OPTIONS= grep .desktop); do
+ for j in $(desktop-file-validate $i | grep -v 'unregistered value "Pantheon"' | tr ' ' '_'); do
+ ERRORS=1
+ echo $j | tr '_' ' '
+ done
+done
+test "$ERRORS" = 1 && echo ...FAILED && exit 1
+echo ...OK
More information about the Xfce4-commits
mailing list