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
_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to