Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Jonathan Callen <abcd@g.o>
Subject: Changes to make_desktop_entry in eutils.eclass
Date: Tue, 23 Feb 2010 20:26:13 -0500
Attached is a patch to properly comply with the part of the FDO Desktop
Menu Specification pertaining to Categories (namely, always ensuring
that the list ends in a ";") and the part of the FDO Desktop Entry
Specification and Icon Theme Specification pertaining to icons (namely,
that non-absolute paths MUST NOT have an extension).
--- eutils.eclass
+++ eutils.eclass.new
@@ -961,6 +961,7 @@ make_desktop_entry() {
 					news)	type=News;;
 					nntp)	type=News;;
 					p2p)	type=FileTransfer;;
+					voip)	type=Telephony;;
 					*)		type=;;
 				esac
 				type="Network;${type}"
@@ -991,7 +992,7 @@ make_desktop_entry() {
 					client) type=WebBrowser;;
 					*)		type=;;
 				esac
-				type="Network"
+				type="Network;${type}"
 				;;
 
 			*)
@@ -1007,6 +1008,17 @@ make_desktop_entry() {
 	local desktop="${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${desktop_name}.desktop"
 	#local desktop=${T}/${exec%% *:-${desktop_name}}.desktop
 
+	# Don't append another ";" when a valid category value is provided.
+	[[ -n ${type} && ${type} != *';' ]] && type+=";"
+
+	eshopts_push -s extglob
+	if [[ -n ${icon} && ${icon} != /* && ${icon} == *.@(xpm|png|svg) ]]; then
+		ewarn "As described in the Icon Theme Specification, icon file extensions are not"
+		ewarn "allowed in .desktop files if the value is not an absolute path."
+		icon=${icon%.@(xpm|png|svg)}
+	fi
+	eshopts_pop
+
 	cat <<-EOF > "${desktop}"
 	[Desktop Entry]
 	Name=${name}
@@ -1015,7 +1027,7 @@ make_desktop_entry() {
 	Exec=${exec}
 	TryExec=${exec%% *}
 	Icon=${icon}
-	Categories=${type};
+	Categories=${type}
 	EOF
 
 	[[ ${path} ]] && echo "Path=${path}" >> "${desktop}"
Attachment:
signature.asc (OpenPGP digital signature)
Replies:
Re: Changes to make_desktop_entry in eutils.eclass
-- Pacho Ramos
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Package up for grabs: net-misc/ksb26
Next by thread:
Re: Changes to make_desktop_entry in eutils.eclass
Previous by date:
Package up for grabs: net-misc/ksb26
Next by date:
Re: Pending mask of Qt3 and MythTV


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.