#define PND_DOTDESKTOP_HEADER "[Desktop Entry]"
#define PND_DOTDESKTOP_SOURCE "X-Pandora-Source=libpnd"
unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t *p );
-pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath );
+
+#define PND_DOTDESKTOP_LIBPND_ONLY 1 /* convenience flag; caller can do this himself as well */
+pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ); // sets object_flag CUSTOM1 for non-libpnd-origin
// emit_dotinfo() will spit out a .desktop 'info entry', similar to the way emit_dotdesktop does its thing
// - rather than slide this into emit_dotdesktop(), we wish to allow apps to do this or not by calling this
// parse_dotdesktop() can be used to read a libpnd generated .desktop and return a limited
// but useful disco-t structure back; possibly useful for scanning .desktops rather than
// scanning pnd-files?
-pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath ) {
+pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ) {
// will verify the .desktop has the libpnd-marking on it (X-Pandora-Source): PND_DOTDESKTOP_SOURCE
// filter
if ( ! libpnd_origin ) {
- pnd_disco_destroy ( p );
- free ( p );
- return ( NULL );
+ p -> object_flags |= PND_DISCO_CUSTOM1; // so caller can do something if it wishes
+
+ // convenience flag
+ if ( flags & PND_DOTDESKTOP_LIBPND_ONLY ) {
+ pnd_disco_destroy ( p );
+ free ( p );
+ return ( NULL );
+ }
+
}
// additional
pnd_box_handle applist;
if ( dotdesktoppath [ 0 ] ) {
- pnd_disco_t *p = pnd_parse_dotdesktop ( dotdesktoppath );
+ pnd_disco_t *p = pnd_parse_dotdesktop ( dotdesktoppath, PND_DOTDESKTOP_LIBPND_ONLY );
pnd_box_handle disco_box = pnd_box_new ( "discovery" );
if ( p ) {
pnd_disco_t *ai = pnd_box_allocinsert ( disco_box, dotdesktoppath, sizeof(pnd_disco_t) );