[Goodies-commits] r7412 - in xfce4-places-plugin/trunk: . panel-plugin
Diego Ongaro
ongardie at xfce.org
Sun May 24 07:23:55 CEST 2009
Author: ongardie
Date: 2009-05-24 05:23:55 +0000 (Sun, 24 May 2009)
New Revision: 7412
Modified:
xfce4-places-plugin/trunk/ChangeLog
xfce4-places-plugin/trunk/panel-plugin/model_system.c
Log:
Fixes checking whether trash is empty, updates changelog
Modified: xfce4-places-plugin/trunk/ChangeLog
===================================================================
--- xfce4-places-plugin/trunk/ChangeLog 2009-05-24 05:23:44 UTC (rev 7411)
+++ xfce4-places-plugin/trunk/ChangeLog 2009-05-24 05:23:55 UTC (rev 7412)
@@ -1,3 +1,8 @@
+2009-05-24 Diego Ongaro <ongardie at gmail.com>
+
+ * model_system.c: Use xdg-compatible icons. Thanks to
+ Yves-Alexis Perez. See bug #5034.
+
2008-11-23 Diego Ongaro <ongardie at gmail.com>
* view.c, xfce46-compat.{c,h}: Adds xfce46-compat files for menu
Modified: xfce4-places-plugin/trunk/panel-plugin/model_system.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_system.c 2009-05-24 05:23:44 UTC (rev 7411)
+++ xfce4-places-plugin/trunk/panel-plugin/model_system.c 2009-05-24 05:23:55 UTC (rev 7412)
@@ -2,7 +2,7 @@
*
* Model: system bookmarks (e.g., home folder, desktop)
*
- * Copyright (c) 2007 Diego Ongaro <ongardie at gmail.com>
+ * Copyright (c) 2007-2009 Diego Ongaro <ongardie at gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -78,6 +78,21 @@
}
#endif
+#if TRASH
+static gboolean
+pbsys_trash_is_empty(const ThunarVfsInfo *trash_info)
+{
+ if (trash_info->custom_icon == NULL)
+ return FALSE;
+ if (strcmp("user-trash-full", trash_info->custom_icon) == 0)
+ return FALSE;
+ if (strcmp("gnome-fs-trash-full", trash_info->custom_icon) == 0)
+ return FALSE;
+ return TRUE;
+}
+#endif
+
+
static gchar*
pbsys_desktop_dir()
{
@@ -147,13 +162,11 @@
/* Try for an icon from ThunarVFS to indicate whether trash is empty or not */
trash_info = thunar_vfs_info_new_for_path(pbg_priv(bookmark_group)->trash_path, NULL);
- if(trash_info->custom_icon != NULL){
+ pbg_priv(bookmark_group)->trash_is_empty = pbsys_trash_is_empty(trash_info);
+ if(trash_info->custom_icon != NULL)
bookmark->icon = g_strdup(trash_info->custom_icon);
- pbg_priv(bookmark_group)->trash_is_empty = (strcmp("user-trash-full", bookmark->icon) != 0);
- }else{
+ else
bookmark->icon = g_strdup("user-trash-full");
- pbg_priv(bookmark_group)->trash_is_empty = FALSE;
- }
thunar_vfs_info_unref(trash_info);
open = places_create_open_action(bookmark);
@@ -206,7 +219,7 @@
{
gchar *desktop_dir;
#if TRASH
- gboolean trash_is_empty = FALSE;
+ gboolean trash_is_empty;
ThunarVfsInfo *trash_info;
#endif
@@ -224,8 +237,7 @@
#if TRASH
/* see if trash gets a different icon (e.g., was empty, now full) */
trash_info = thunar_vfs_info_new_for_path(pbg_priv(bookmark_group)->trash_path, NULL);
- if(trash_info->custom_icon != NULL)
- trash_is_empty = (strcmp("user-trash-full", trash_info->custom_icon) != 0);
+ trash_is_empty = pbsys_trash_is_empty(trash_info);
thunar_vfs_info_unref(trash_info);
if(trash_is_empty != pbg_priv(bookmark_group)->trash_is_empty)
More information about the Goodies-commits
mailing list