fixed sorting api
authorvlad <vlad@vlanout.(none)>
Sun, 15 Aug 2010 10:49:57 +0000 (13:49 +0300)
committervlad <vlad@vlanout.(none)>
Sun, 15 Aug 2010 10:49:57 +0000 (13:49 +0300)
applet/src/livewp-exthemes.c

index be27781..84b9256 100644 (file)
@@ -44,7 +44,10 @@ parse_theme(gchar *file){
         }
     }
     if (!(g_hash_table_lookup(hash, "category")))
-        g_hash_table_insert(hash, g_strdup("category"), g_strdup("Unknown"));
+        g_hash_table_insert(hash, g_strdup("category"), g_strdup("Unknown"));  
+    if (!(g_hash_table_lookup(hash, "name")))
+        g_hash_table_insert(hash, g_strdup("name"), g_strdup("Unknown"));
+
     xmlFreeDoc(doc);
     xmlCleanupParser();
     return hash;
@@ -52,7 +55,7 @@ parse_theme(gchar *file){
 
 /*******************************************************************************/
 gint compar (gpointer a, gpointer b){
-    return strcmp( (char*)a, (char*)b );
+    return strcmp( (g_hash_table_lookup(a, "name")), (g_hash_table_lookup(b, "name")) );
 }