xfce4-linelight-plugin-0.1.7-port-to-xfcerc.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. http://bugs.gentoo.org/411949
  2. http://bugs.ganymede.ch/
  3. http://lionel.lefolgoc.net/misc/01_port-to-xfcerc.patch
  4. --- panel-plugin/linelight.c
  5. +++ panel-plugin/linelight.c
  6. @@ -207,7 +207,7 @@ void linelight_add_list_entry(LineLightD
  7. remove_newline(entry);
  8. GtkTreeIter iter;
  9. - char *icon;
  10. + const gchar *icon = NULL;
  11. GdkPixbuf *pixbuf;
  12. gtk_list_store_insert(data->list, &iter, data->listPointer[sec]);
  13. @@ -218,13 +218,15 @@ void linelight_add_list_entry(LineLightD
  14. //icon
  15. if (g_file_query_exists (file, NULL) && sec == BIN_SECTION )
  16. {
  17. - XfceDesktopEntry* app = xfce_desktop_entry_new(entry,categories,3);
  18. + XfceRc* app = xfce_rc_simple_open(entry, TRUE);
  19. - if (app != NULL && xfce_desktop_entry_get_string(app, "Icon", TRUE, &icon) && NULL != (pixbuf= load_icon(icon)))
  20. + if (app != NULL)
  21. {
  22. - gtk_list_store_set(data->list, &iter, ICON_COL, pixbuf, -1);
  23. - g_object_unref(app);
  24. - free(icon);
  25. + xfce_rc_set_group(app, G_KEY_FILE_DESKTOP_GROUP);
  26. + icon = xfce_rc_read_entry(app, G_KEY_FILE_DESKTOP_KEY_ICON, NULL);
  27. + if (icon != NULL && NULL != (pixbuf= load_icon(icon)))
  28. + gtk_list_store_set(data->list, &iter, ICON_COL, pixbuf, -1);
  29. + xfce_rc_close(app);
  30. }
  31. }
  32. else if (file != NULL)
  33. --- panel-plugin/main.c
  34. +++ panel-plugin/main.c
  35. @@ -155,14 +155,15 @@ static void cell_renderer(GtkTreeViewCol
  36. }
  37. else if (strstr(name,".desktop") != NULL) //Application names based on .desktop files
  38. {
  39. - XfceDesktopEntry *application = xfce_desktop_entry_new(path,categories,3);
  40. - if (XFCE_IS_DESKTOP_ENTRY(application))
  41. + XfceRc *application = xfce_rc_simple_open(path, TRUE);
  42. + if (application != NULL)
  43. {
  44. - char* app_name;
  45. - xfce_desktop_entry_get_string(application, "Name", TRUE, &app_name);
  46. - g_object_unref(application);
  47. - g_object_set(cell,"text", app_name,NULL);
  48. - free(app_name);
  49. + const gchar* app_name = NULL;
  50. + xfce_rc_set_group(application, G_KEY_FILE_DESKTOP_GROUP);
  51. + app_name = xfce_rc_read_entry(application, G_KEY_FILE_DESKTOP_KEY_NAME, NULL);
  52. + if (app_name != NULL)
  53. + g_object_set(cell,"text", app_name, NULL);
  54. + xfce_rc_close(application);
  55. }
  56. }
  57. else