[Gtk-sharp-list] Need help (again) with desktop files!

Alex Launi alex.launi at gmail.com
Wed Jul 2 11:47:47 EDT 2008


Hello Gtk# list, I'm trying to parse desktop files in a localizable way,
this works, however it gives me all kind of hell in terms of console output.
If I change DesktopItemLoadFlags.OnlyIfExists to
DesktopItemLoadFlags.NoTranslations, all of my errors go away, but then my
calls to GetLocalestring are worthless. It's very frustrating to have all of
these Gtk errors being printed non-stop. Does anyone have an idea of how to
deal with them? Here is my code, and the output it gives me.

[CODE]
        public ApplicationItem (string desktopFile)
        {
            item = DesktopItem.NewFromFile (desktopFile,
                DesktopItemLoadFlags.OnlyIfExists);
            if (null == item)
                throw new Exception (desktopFile + " not found.");
        }

        public string Name {
            get {
                return item.GetLocalestring ("Name");
            }
        }

        public string Description {
            get {
                return item.GetLocalestring ("Comment");
            }
        }

        public string Icon {
            get {
                return item.GetIcon (IconTheme.Default);
            }
        }

        public string Exec {
            get {
                return item.GetString ("Exec");
            }
        }

        public bool Hidden {
            get {
                return item.GetBoolean ("NoDisplay");
            }
        }
[/CODE]

[OUTPUT]

** (Do:31659): CRITICAL **: gnome_desktop_item_get_boolean: assertion `item
!= NULL' failed

** (Do:31659): CRITICAL **: gnome_desktop_item_get_localestring: assertion
`item != NULL' failed

[/OUTPUT]

It gives me those two CRITICAL messages about many times each. First around
10 of the  ** (Do:29487): CRITICAL **: gnome_desktop_item_get_boolean:
assertion `item != NULL' failed and then 50 or more of the other.

Thank you for your help.

-- 
--Alex Launi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080702/bbefa10a/attachment-0001.html 


More information about the Gtk-sharp-list mailing list