From b9429f66f03f777fbb4c849ac37394106fc1b6af Mon Sep 17 00:00:00 2001 From: skeezix Date: Tue, 22 Dec 2009 11:26:57 -0500 Subject: [PATCH] Added X-Pandora-UID to .desktop Changed _Source to X-Pandora-Source Cleaned up a header collision from old copy/paste Fixed discotest to use correct header --- include/pnd_desktop.h | 3 +-- include/pnd_discovery.h | 10 ---------- lib/pnd_desktop.c | 4 ++++ test/discotest.c | 1 + 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/pnd_desktop.h b/include/pnd_desktop.h index 550b03e..367e38b 100644 --- a/include/pnd_desktop.h +++ b/include/pnd_desktop.h @@ -6,14 +6,13 @@ extern "C" { #endif - #define PND_PNDHUP_KEY "launcher.hupscript" #define PND_PNDHUP_FILENAME "pnd_hup.sh" // emit_dotdesktop() will determine a filename and create a FILENAME.desktop file in the targetpath // TODO: Copy the icon into this directory as well, if its source is a .pnd or info is in the dico struct #define PND_DOTDESKTOP_HEADER "[Desktop Entry]" -#define PND_DOTDESKTOP_SOURCE "_Source=libpnd" +#define PND_DOTDESKTOP_SOURCE "X-Pandora-Source=libpnd" unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t *p ); // emit_icon() will attempt to copy the icon from a PXML directory, or from a pnd file if appended, diff --git a/include/pnd_discovery.h b/include/pnd_discovery.h index f41d10a..707e1e1 100644 --- a/include/pnd_discovery.h +++ b/include/pnd_discovery.h @@ -70,16 +70,6 @@ typedef struct { void pnd_disco_destroy ( pnd_disco_t *p ); // a function name that simply could not be avoided -// emit_dotdesktop() will determine a filename and create a FILENAME.desktop file in the targetpath -// TODO: Copy the icon into this directory as well, if its source is a .pnd or info is in the dico struct -#define PND_DOTDESKTOP_HEADER "[Desktop Entry]" -#define PND_DOTDESKTOP_SOURCE "_Source=libpnd" -unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t *p ); - -// emit_icon() will attempt to copy the icon from a PXML directory, or from a pnd file if appended, -// to the given directory; returns 1 on sucess, otherwise is a fail. -unsigned char pnd_emit_icon ( char *targetpath, pnd_disco_t *p ); - // TODO: A way to release the disco-lists and reclaim RAM :) #ifdef __cplusplus diff --git a/lib/pnd_desktop.c b/lib/pnd_desktop.c index f8ea3d7..eb8ebba 100644 --- a/lib/pnd_desktop.c +++ b/lib/pnd_desktop.c @@ -67,6 +67,10 @@ unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t fprintf ( f, "%s", buffer ); } + if ( p -> unique_id ) { + fprintf ( f, "X-Pandora-UID=%s\n", p -> unique_id ); + } + #if 1 if ( p -> desc_en && p -> desc_en [ 0 ] ) { snprintf ( buffer, 1020, "Comment=%s\n", p -> desc_en ); // no [en] needed I suppose, yet diff --git a/test/discotest.c b/test/discotest.c index 79e71fc..95465bf 100644 --- a/test/discotest.c +++ b/test/discotest.c @@ -8,6 +8,7 @@ #include "pnd_apps.h" #include "pnd_pxml.h" #include "pnd_discovery.h" +#include "pnd_desktop.h" #include "pnd_locate.h" #include "pnd_utility.h" -- 2.39.5