~ubuntu-branches/ubuntu/quantal/xfce4-linelight-plugin/quantal

« back to all changes in this revision

Viewing changes to debian/patches/01_port-to-xfcerc.patch

  • Committer: Package Import Robot
  • Author(s): Lionel Le Folgoc
  • Date: 2012-05-19 13:23:38 UTC
  • Revision ID: package-import@ubuntu.com-20120519132338-m1v7icu0izxejnw1
Tags: 0.1.7-2ubuntu1
* debian/patches:
  - 01_port-to-xfcerc.patch: added, port to libxfce4util6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Port to XfceRc
 
2
 XfceDesktopEntry was deprecated in libxfce4util 4.8.x and has been removed in
 
3
 libxfce4util 4.9.x.
 
4
Author: Lionel Le Folgoc <mrpouit@ubuntu.com>
 
5
Forwarded: no
 
6
Last-Update: 2012-04-19
 
7
 
 
8
--- xfce4-linelight-plugin-0.1.7.orig/panel-plugin/linelight.c
 
9
+++ xfce4-linelight-plugin-0.1.7/panel-plugin/linelight.c
 
10
@@ -207,7 +207,7 @@ void linelight_add_list_entry(LineLightD
 
11
     remove_newline(entry);
 
12
 
 
13
     GtkTreeIter iter;
 
14
-    char *icon;
 
15
+    const gchar *icon = NULL;
 
16
     GdkPixbuf *pixbuf;
 
17
 
 
18
     gtk_list_store_insert(data->list, &iter, data->listPointer[sec]);
 
19
@@ -218,13 +218,15 @@ void linelight_add_list_entry(LineLightD
 
20
     //icon
 
21
     if (g_file_query_exists (file, NULL) && sec == BIN_SECTION )
 
22
     {
 
23
-        XfceDesktopEntry* app = xfce_desktop_entry_new(entry,categories,3);
 
24
+        XfceRc* app = xfce_rc_simple_open(entry, TRUE);
 
25
 
 
26
-        if (app != NULL && xfce_desktop_entry_get_string(app, "Icon", TRUE, &icon)  && NULL != (pixbuf= load_icon(icon)))
 
27
+        if (app != NULL)
 
28
         {
 
29
-            gtk_list_store_set(data->list, &iter, ICON_COL, pixbuf, -1);
 
30
-            g_object_unref(app);
 
31
-            free(icon);
 
32
+            xfce_rc_set_group(app, G_KEY_FILE_DESKTOP_GROUP);
 
33
+            icon = xfce_rc_read_entry(app, G_KEY_FILE_DESKTOP_KEY_ICON, NULL);
 
34
+            if (icon != NULL && NULL != (pixbuf= load_icon(icon)))
 
35
+                gtk_list_store_set(data->list, &iter, ICON_COL, pixbuf, -1);
 
36
+            xfce_rc_close(app);
 
37
         }
 
38
     }
 
39
     else if (file != NULL)
 
40
--- xfce4-linelight-plugin-0.1.7.orig/panel-plugin/main.c
 
41
+++ xfce4-linelight-plugin-0.1.7/panel-plugin/main.c
 
42
@@ -155,14 +155,15 @@ static void cell_renderer(GtkTreeViewCol
 
43
     }
 
44
     else if (strstr(name,".desktop") != NULL) //Application names based on .desktop files
 
45
     {
 
46
-        XfceDesktopEntry *application = xfce_desktop_entry_new(path,categories,3);
 
47
-        if (XFCE_IS_DESKTOP_ENTRY(application))
 
48
+        XfceRc *application = xfce_rc_simple_open(path, TRUE);
 
49
+        if (application != NULL)
 
50
         {
 
51
-            char* app_name;
 
52
-            xfce_desktop_entry_get_string(application, "Name", TRUE, &app_name);
 
53
-            g_object_unref(application);
 
54
-            g_object_set(cell,"text", app_name,NULL);
 
55
-            free(app_name);
 
56
+            const gchar* app_name = NULL;
 
57
+            xfce_rc_set_group(application, G_KEY_FILE_DESKTOP_GROUP);
 
58
+            app_name = xfce_rc_read_entry(application, G_KEY_FILE_DESKTOP_KEY_NAME, NULL);
 
59
+            if (app_name != NULL)
 
60
+                g_object_set(cell,"text", app_name, NULL);
 
61
+            xfce_rc_close(application);
 
62
         }
 
63
     }
 
64
     else