#!/usr/sbin/install-menu
# xdg desktop entry spec - directory generation
# http://www.freedesktop.org/Standards/desktop-entry-spec
# Copyright 2004 - Chris Cheney
# Licensed under the GNU General Public License, version 2.

!include menu.h

compat="menu-2"

outputencoding="UTF-8";

function DirEntry() =
	"[Desktop Entry]\n" 
	"Type=Directory\n" 
	"Encoding=UTF-8\n" 
	"Name=" title() "\n" 
        ifeq($title,".hidden","NoDisplay=true\n")
	ifnempty($longtitle, "Comment=" $longtitle "\n")
	forall(languages(),"lang",
		"Name[" $lang "]=" encode_translate($lang,title(),"utf-8") "\n"
		ifnempty($longtitle, "Comment[" $lang "]=" encode_translate($lang,$longtitle,"utf-8") "\n")
		) 
        ifnempty($kde_opt, $kde_opt "\n")
	ifnempty($icon,"Icon=" $icon "\n");


supported;
 kde = ;
 gnome = ;
 x11 = ;
 text = ;
endsupported;

startmenu = "";
endmenu = "";
submenutitle = DirEntry();

treewalk = "M";

genmenu = ifempty($command,"mandrakelinux" tolower(cppesc(replacewith(replace($section," ",""),"/ ","--"))) ".directory"));

rootsection = "";

prerun = "rm -rf " prefix() "/mandrakelinux*";

preoutput = "";

rootprefix = "/var/lib/menu-xdg/desktop-directories";

userprefix = ".local/share/desktop-directories";
