Hi,

I've been working on updating desktop-file-utils for the latest
changes in the desktop entry spec. While doing this, I found that there
are still some issues with the spec.

Here are some patches:

 + trailing-semicolon.patch: clarify that lists should always end with a
   semicolon, even if there's only one value. This is currently
   ambiguous in the spec.

 + unmounticon.patch: UnmountIcon is a localestring key

 + version-string.patch: this changes the type of the version from
   numeric to string. It's needed if we consider the possibility that
   there are some desktop entry files out there using 0.9.x as a value
   for this key. The change doesn't break anything.

 + typo.patch: small typo

 + context.patch: clarify a bit the text about keys that only makes
   sense in a specific context. Also, state that the keys should not be
   used outside of this context. For example, the URL key should not be
   present if the type is not Link.

 + directory.patch: desktop files of type Directory have a .directory
   extension right now (at least in GNOME), but according to the spec,
   this is wrong. The patch fixes this. Also, it removes a small part of
   text explaining the name of a desktop file describing a directory.
   (see also below)

 + required-in-context.patch: IMHO, a desktop file of type Application
   should always have an Exec key. Same for Link Type and URL key. This
   patch changes this.

And now, some issues that we should fix :-)

 + with trailing-semicolon.patch, a string list key with an empty value
   should have ";" for the value. I guess this is broken, right? :-)

 + we never explain what the various types mean. The spec should do
   that. It's also where we can put back what I removed about the
   .directory name in directory.patch.

 + there are some issues with backslash escaping. How should \j be
   handled? Should this only be considered as 'j'? It probably should
   since the backslash has to be escaped with a backslash.
   Or maybe I'm reading it wrong and \\ means a backslash, but a single
   \ also means a backslash?

 + "The %F and %U field codes may only be used as an argument on their
    own."
   I'm not sure about the "on their own". Does it mean that
   Exec=ooffice -math %U
   is invalid? (that's how I understand the current text). I have many
   desktop files here with similar exec lines.

 + "The executable program can either be specified with its full path or
    with the name of the executable only."
  If I install a file in /usr/bin/subdir/mybinary, then I can't put only
  "subdir/mybinary" in Exec.  I believe the intent is to no have ".."
  and ".", but this is a bit more restrictive.
  (I didn't check if calling execlp with "subdir/mybinary" works, if it
  doesn't then we can safely ignore this comment)

Thanks,

Vincent

-- 
Les gens heureux ne sont pas pressés.
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2007-03-11 16:19:52.000000000 +0100
+++ desktop-entry-spec/desktop-entry-spec.xml	2007-03-11 16:22:49.000000000 +0100
@@ -200,10 +200,9 @@
     <para>
       Some keys can have multiple values. In such a case, the value of the key
       is specified as a plural: for example, <literal>string(s)</literal>. The
-      multiple values should be separated by a semicolon.  Those keys which
-      have several values should have a semicolon as the trailing character.
-      Semicolons in these values need to be escaped using
-      <literal>\;</literal>.
+      multiple values should be separated by a semicolon, and the value of the
+      key should have a semicolon as trailing character. Semicolons in these
+      values need to be escaped using <literal>\;</literal>.
     </para>
   </sect1>
   <sect1 id="localized-keys">
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2007-03-11 16:23:54.000000000 +0100
+++ desktop-entry-spec/desktop-entry-spec.xml	2007-03-11 16:24:19.000000000 +0100
@@ -937,9 +937,8 @@
 	    <entry id="key-unmounticon"><varname>UnmountIcon</varname></entry>
 	    <entry>
            Icon to display when device is not mounted.  Mounted devices display icon from the <varname>Icon</varname> key.
-		   <varname>UnmountIcon</varname>s may be localized with the <literal>UnmountIcon[xx]=</literal> syntax.
 	    </entry>
-	    <entry>string</entry>
+	    <entry>localestring</entry>
 	  </row>
 	</tbody>
       </tgroup>
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2007-03-11 16:25:35.000000000 +0100
+++ desktop-entry-spec/desktop-entry-spec.xml	2007-03-11 16:25:39.000000000 +0100
@@ -366,7 +366,7 @@
 	      version of the specification should use <literal>1.0</literal>.
 	      Note that the version field is not required to be present.
 	    </entry>
-	    <entry>numeric</entry>
+	    <entry>string</entry>
 	    <entry>NO</entry>
             <entry>1-3</entry>
 	  </row>
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2007-03-11 16:27:05.000000000 +0100
+++ desktop-entry-spec/desktop-entry-spec.xml	2007-03-11 16:27:21.000000000 +0100
@@ -230,7 +230,7 @@
       stripped.
     </para>
     <para>
-	  The matching of is done as follows.  If
+	  The matching is done as follows.  If
 	  <varname>LC_MESSAGES</varname> is of the form
 	  <literal><replaceable>lang</replaceable>_<replaceable>COUNTRY</replaceable>.<replaceable>ENCODING</replaceable>@<replaceable>MODIFIER</replaceable></literal>, 
 	  then it will match a key of the form
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2007-03-11 16:29:39.000000000 +0100
+++ desktop-entry-spec/desktop-entry-spec.xml	2007-03-11 16:42:07.000000000 +0100
@@ -326,7 +326,11 @@
     </para>
     <para>
       Some keys only make sense in the context when another particular key
-      is also present.
+      is also present and set to a specific value. Those keys should not be
+      used if the particular key is not present or not set to the specific
+      value. For example, the <varname>Terminal</varname> key can only be used
+      when the value of the <varname>Type</varname> key is
+      <constant>Application</constant>.
     </para>
     <para>
       Some example keys: <varname>Name[C]</varname>, <varname>Comment[it]</varname>.
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2007-03-11 16:32:44.000000000 +0100
+++ desktop-entry-spec/desktop-entry-spec.xml	2007-03-11 16:34:44.000000000 +0100
@@ -70,13 +70,13 @@
   <sect1 id="basic-format">
     <title>Basic format of the file</title>
     <para>
-      These desktop entry files should have the extension
-      <filename>.desktop</filename>. Determining file type on basis of
-      extension makes determining the file type very easy and quick.
+      Desktop entry files should have the <filename>.desktop</filename>
+      extension, except for files of <varname>Type</varname>
+      <constant>Directory</constant> which should have the
+      <filename>.directory</filename> extension. Determining file type on basis
+      of extension makes determining the file type very easy and quick.
       When no file extension is present, the desktop system should
-      fall back to recognition via "magic detection".  Desktop entries
-      which describe how a directory is to be formatted/displayed
-      should be simply called <filename>.directory</filename>.
+      fall back to recognition via "magic detection".
     </para>
     <para>
       Desktop entry files are encoded as lines of 8-bit characters separated
Index: desktop-entry-spec/desktop-entry-spec.xml
===================================================================
--- desktop-entry-spec.orig/desktop-entry-spec.xml	2007-03-11 16:43:04.000000000 +0100
+++ desktop-entry-spec/desktop-entry-spec.xml	2007-03-11 16:46:03.000000000 +0100
@@ -333,6 +333,13 @@
       <constant>Application</constant>.
     </para>
     <para>
+      If a REQUIRED key is only valid in the context of another key set to a
+      specific value, then it has to be present only if the other key is set to
+      the specific value. For example, the <varname>URL</varname> key has to be
+      present when and only when when the value of the <varname>Type</varname>
+      key is <constant>Link</constant>.
+    </para>
+    <para>
       Some example keys: <varname>Name[C]</varname>, <varname>Comment[it]</varname>.
     </para>
     <table>
@@ -476,7 +483,7 @@
            Program to execute, possibly with arguments.
 	    </entry>
 	    <entry>string</entry>
-	    <entry>NO</entry>
+	    <entry>YES</entry>
             <entry>1</entry>
 	  </row>
 	  <row>
@@ -549,7 +556,7 @@
            If entry is Link type, the URL to access.
 	    </entry>
 	    <entry>string</entry>
-	    <entry>NO</entry>
+	    <entry>YES</entry>
             <entry>2</entry>
 	  </row>
 	</tbody>
_______________________________________________
xdg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xdg

Reply via email to