[Goodies-commits] r2671 - in xfce4-places-plugin: branches/volumes trunk trunk/panel-plugin

Diego Ongaro ongardie at xfce.org
Thu Apr 5 21:12:05 CEST 2007


Author: ongardie
Date: 2007-04-05 19:12:04 +0000 (Thu, 05 Apr 2007)
New Revision: 2671

Added:
   xfce4-places-plugin/branches/volumes/BRANCH_LIFETIME_ENDED
   xfce4-places-plugin/trunk/HACKING
   xfce4-places-plugin/trunk/panel-plugin/model.c
   xfce4-places-plugin/trunk/panel-plugin/model.h
   xfce4-places-plugin/trunk/panel-plugin/model_system.c
   xfce4-places-plugin/trunk/panel-plugin/model_user.c
   xfce4-places-plugin/trunk/panel-plugin/model_volumes.c
Modified:
   xfce4-places-plugin/branches/volumes/autogen.sh
   xfce4-places-plugin/trunk/ChangeLog
   xfce4-places-plugin/trunk/INSTALL
   xfce4-places-plugin/trunk/configure.ac
   xfce4-places-plugin/trunk/panel-plugin/Makefile.am
   xfce4-places-plugin/trunk/panel-plugin/places.c
   xfce4-places-plugin/trunk/panel-plugin/places.h
   xfce4-places-plugin/trunk/panel-plugin/unescape_uri.c
Log:
2007-04-05      Diego Ongaro <ongardie at gmail.com>

* Merged in volumes branch (to trunk)



Added: xfce4-places-plugin/branches/volumes/BRANCH_LIFETIME_ENDED
===================================================================
--- xfce4-places-plugin/branches/volumes/BRANCH_LIFETIME_ENDED	                        (rev 0)
+++ xfce4-places-plugin/branches/volumes/BRANCH_LIFETIME_ENDED	2007-04-05 19:12:04 UTC (rev 2671)
@@ -0,0 +1,2 @@
+This branch has been merged with trunk. Please use trunk instead.
+-Diego Ongaro, 2007-04-05

Modified: xfce4-places-plugin/branches/volumes/autogen.sh
===================================================================
--- xfce4-places-plugin/branches/volumes/autogen.sh	2007-04-05 18:50:30 UTC (rev 2670)
+++ xfce4-places-plugin/branches/volumes/autogen.sh	2007-04-05 19:12:04 UTC (rev 2671)
@@ -6,6 +6,9 @@
 # Written for Xfce by Benedikt Meurer <benny at xfce.org>.
 #
 
+cat BRANCH_LIFETIME_ENDED
+exit 1
+
 (type xdt-autogen) >/dev/null 2>&1 || {
   cat >&2 <<EOF
 autogen.sh: You don't seem to have the Xfce development tools installed on

Modified: xfce4-places-plugin/trunk/ChangeLog
===================================================================
--- xfce4-places-plugin/trunk/ChangeLog	2007-04-05 18:50:30 UTC (rev 2670)
+++ xfce4-places-plugin/trunk/ChangeLog	2007-04-05 19:12:04 UTC (rev 2671)
@@ -1,5 +1,11 @@
 2007-04-05	Diego Ongaro <ongardie at gmail.com>
+	
+	* Merged in volumes branch
+	* Adds Thunar VFS dependency.
+	* Uncouples model from view/controller as explained in HACKING.
 
+2007-04-05	Diego Ongaro <ongardie at gmail.com>
+
 	* Releasing version 0.1
 	* With psyBSD's help, i18n is now up and running.
 
@@ -11,3 +17,6 @@
 2007-03-14	Diego Ongaro <ongardie at gmail.com>
 
 	* initial beta release, packaged outside svn
+
+
+# vi:set ts=8 sw=8 tw=72 noet ai nocindent:

Copied: xfce4-places-plugin/trunk/HACKING (from rev 2670, xfce4-places-plugin/branches/volumes/HACKING)
===================================================================
--- xfce4-places-plugin/trunk/HACKING	                        (rev 0)
+++ xfce4-places-plugin/trunk/HACKING	2007-04-05 19:12:04 UTC (rev 2671)
@@ -0,0 +1,48 @@
+The Model Infrastructure
+================================================================================
+
+model.h provides a convenient BookmarkInfo struct
+model.c provides the 4 "composite" functions:
+
+  1) static Bookmarks* 
+     places_bookmarks_init();
+
+     * This function is in charge of creating the Bookmarks struct.
+     * It delegates to the children (e.g. system, volumes, user), which are
+       each in charge of creating their own struct.
+
+  2) static void
+     places_bookmarks_visit(Bookmarks *b, gpointer pass_thru, 
+                            item callback, separator callback);
+
+     * This function allows the view to (re-)build it's menu, while keeping it
+       uncoupled from the model.
+     * The model agrees to call the item callback with some pass-thru data and
+       a label, uri, and icon for each item. It fulfills this through 
+       delegation to its children. Each child should then iterate over its
+       bookmarks and call the item callback. Additionally, the model calls the
+       separator callback where it finds appropriate.
+
+  3) static gboolean
+     places_bookmarks_changed(Bookmarks *b);
+
+     * The return value of this function indicates whether the model has been
+       altered since the last call to this function.
+     * The expected side effect of this function, then, is that updates may
+       occur as a result of this trigger, and some state memory should be reset.
+     * The model delegates to its children and OR's the results. It ensures
+       that each child's changed function gets called.
+             
+  4) static void
+     places_bookmarks_finalize(Bookmarks *b);
+
+     * This function is in charge of cleaning up any resources that have been
+       created, either in the init function or later.
+     * It delegates to the children so they can clean up their own resources.
+
+Changes To This File
+================================================================================
+
+2007-04-05  Diego Ongaro  <ongardie at gmail.com>
+
+	* Created file

Modified: xfce4-places-plugin/trunk/INSTALL
===================================================================
--- xfce4-places-plugin/trunk/INSTALL	2007-04-05 18:50:30 UTC (rev 2670)
+++ xfce4-places-plugin/trunk/INSTALL	2007-04-05 19:12:04 UTC (rev 2671)
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
 
 This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
@@ -10,10 +10,7 @@
 Basic Installation
 ==================
 
-Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package.  The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+These are generic installation instructions.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -26,9 +23,9 @@
 
    It can also use an optional file (typically called `config.cache'
 and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  Caching is
+the results of its tests to speed up reconfiguring.  (Caching is
 disabled by default to prevent problems with accidental use of stale
-cache files.
+cache files.)
 
    If you need to do unusual things to compile the package, please try
 to figure out how `configure' could check whether to do them, and mail
@@ -38,17 +35,20 @@
 may remove or edit it.
 
    The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
 
 The simplest way to compile this package is:
 
   1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
 
-     Running `configure' might take a while.  While running, it prints
-     some messages telling which features it is checking for.
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
 
   2. Type `make' to compile the package.
 
@@ -78,7 +78,7 @@
 by setting variables in the command line or in the environment.  Here
 is an example:
 
-     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
 
    *Note Defining Variables::, for more details.
 
@@ -87,15 +87,17 @@
 
 You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
-own directory.  To do this, you can use GNU `make'.  `cd' to the
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
 source code in the directory that `configure' is in and in `..'.
 
-   With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory.  After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
 
 Installation Names
 ==================
@@ -188,12 +190,12 @@
      ./configure CC=/usr/local2/bin/gcc
 
 causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).
+overridden in the site shell script).  Here is a another example:
 
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug.  Until the bug is fixed you can use this workaround:
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
 
-     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
 
 `configure' Invocation
 ======================

Modified: xfce4-places-plugin/trunk/configure.ac
===================================================================
--- xfce4-places-plugin/trunk/configure.ac	2007-04-05 18:50:30 UTC (rev 2670)
+++ xfce4-places-plugin/trunk/configure.ac	2007-04-05 19:12:04 UTC (rev 2671)
@@ -27,6 +27,7 @@
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.3.99.1])
 XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.3.99.1])
 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.3.99.1])
+XDT_CHECK_PACKAGE([THUNAR_VFS], [thunar-vfs-1], [0.4.0])
 
 XDT_FEATURE_DEBUG()
 

Modified: xfce4-places-plugin/trunk/panel-plugin/Makefile.am
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/Makefile.am	2007-04-05 18:50:30 UTC (rev 2670)
+++ xfce4-places-plugin/trunk/panel-plugin/Makefile.am	2007-04-05 19:12:04 UTC (rev 2671)
@@ -4,10 +4,16 @@
 	xfce4-places-plugin
 
 xfce4_places_plugin_SOURCES =						\
-	unescape_uri.c							\
+	places.c							\
 	places.h							\
-	places.c							
+	model.c								\
+	model.h								\
+	model_system.c							\
+	model_volumes.c							\
+	model_user.c							\
+	unescape_uri.c
 
+
 xfce4_places_plugin_CFLAGS =						\
 	-I$(top_builddir)						\
 	-I$(top_srcdir)							\
@@ -16,12 +22,14 @@
 	$(LIBXFCE4UTIL_CFLAGS)						\
 	$(LIBXFCEGUI4_CFLAGS)						\
 	$(LIBXFCE4PANEL_CFLAGS)						\
+        $(THUNAR_VFS_CFLAGS)						\
 	$(PLATFORM_CFLAGS)
 
 xfce4_places_plugin_LDADD =						\
 	$(LIBXFCE4UTIL_LIBS)						\
 	$(LIBXFCEGUI4_LIBS)						\
-	$(LIBXFCE4PANEL_LIBS)
+	$(LIBXFCE4PANEL_LIBS)						\
+	@THUNAR_VFS_LIBS@
 
 
 #

Copied: xfce4-places-plugin/trunk/panel-plugin/model.c (from rev 2670, xfce4-places-plugin/branches/volumes/panel-plugin/model.c)
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model.c	                        (rev 0)
+++ xfce4-places-plugin/trunk/panel-plugin/model.c	2007-04-05 19:12:04 UTC (rev 2671)
@@ -0,0 +1,77 @@
+/*  xfce4-places-plugin
+ *
+ *  Copyright (c) 2007 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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "model_system.c"
+#include "model_volumes.c"
+#include "model_user.c"
+
+typedef struct
+{
+    BookmarksSystem  *system;
+    BookmarksVolumes *volumes;
+    BookmarksUser    *user;
+} Bookmarks;
+
+static Bookmarks*
+places_bookmarks_init()
+{
+    DBG("initializing model");
+
+    Bookmarks *b = g_new0(Bookmarks, 1);
+
+    b->system = places_bookmarks_system_init();
+    b->volumes = places_bookmarks_volumes_init();
+    b->user = places_bookmarks_user_init();
+
+    return b;
+}
+
+static void
+places_bookmarks_visit(Bookmarks *b,
+                       gpointer pass_thru, 
+                       BOOKMARK_ITEM_FUNC(item_func),
+                       BOOKMARK_SEPARATOR_FUNC(separator_func))
+{
+    places_bookmarks_system_visit(b->system, pass_thru, item_func, separator_func);
+    places_bookmarks_volumes_visit(b->volumes, pass_thru, item_func, separator_func);
+    separator_func(pass_thru);
+    places_bookmarks_user_visit(b->user, pass_thru, item_func, separator_func);
+}
+
+static gboolean
+places_bookmarks_changed(Bookmarks *b)
+{
+    // avoid short-circuit of || since changed() has side-effects
+    gboolean changed = FALSE;
+    changed = places_bookmarks_system_changed(b->system) || changed;
+    changed = places_bookmarks_volumes_changed(b->volumes) || changed;
+    changed = places_bookmarks_user_changed(b->user) || changed;
+    return changed || TRUE;
+}
+
+static void
+places_bookmarks_finalize(Bookmarks *b)
+{
+    places_bookmarks_system_finalize(b->system);
+    places_bookmarks_volumes_finalize(b->volumes);
+    places_bookmarks_user_finalize(b->user);
+    g_free(b);
+}
+
+// vim: ai et tabstop=4

Copied: xfce4-places-plugin/trunk/panel-plugin/model.h (from rev 2670, xfce4-places-plugin/branches/volumes/panel-plugin/model.h)
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model.h	                        (rev 0)
+++ xfce4-places-plugin/trunk/panel-plugin/model.h	2007-04-05 19:12:04 UTC (rev 2671)
@@ -0,0 +1,37 @@
+/*  xfce4-places-plugin
+ *
+ *  Copyright (c) 2007 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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _XFCE_PANEL_PLACES_MODEL_H
+#define _XFCE_PANEL_PLACES_MODEL_H
+
+#include <glib.h>
+
+#define BOOKMARK_ITEM_FUNC(symbol)      void (*symbol) (gpointer, const gchar*, const gchar*, const gchar*)
+#define BOOKMARK_SEPARATOR_FUNC(symbol) void (*symbol) (gpointer)
+
+typedef struct
+{
+    gchar           *label;
+    gchar           *uri;
+    gchar           *icon;
+    gpointer        *data;
+} BookmarkInfo;
+
+#endif
+// vim: ai et tabstop=4

Copied: xfce4-places-plugin/trunk/panel-plugin/model_system.c (from rev 2670, xfce4-places-plugin/branches/volumes/panel-plugin/model_system.c)
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_system.c	                        (rev 0)
+++ xfce4-places-plugin/trunk/panel-plugin/model_system.c	2007-04-05 19:12:04 UTC (rev 2671)
@@ -0,0 +1,99 @@
+/*  xfce4-places-plugin
+ *
+ *  Copyright (c) 2007 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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "model.h"
+#include <libxfce4util/libxfce4util.h>
+
+typedef struct
+{
+  GPtrArray *bookmarks;
+} BookmarksSystem;
+
+static BookmarksSystem*
+places_bookmarks_system_init()
+{
+    BookmarksSystem *b = g_new0(BookmarksSystem, 1);
+
+    BookmarkInfo *bookmark;
+    b->bookmarks = g_ptr_array_sized_new(4);
+    
+    const gchar *home_dir = xfce_get_homedir();
+
+    // These icon names are consistent with Thunar.
+
+    // Home
+    bookmark = g_new0(BookmarkInfo, 1);
+    bookmark->label = g_strdup(g_get_user_name());
+    bookmark->uri = g_strdup(home_dir);
+    bookmark->icon = "gnome-fs-home";
+    g_ptr_array_add(b->bookmarks, bookmark);
+
+    // Trash
+    bookmark = g_new0(BookmarkInfo, 1);
+    bookmark->label = _("Trash");
+    bookmark->uri = "trash:///";
+    bookmark->icon = "gnome-fs-trash-full";
+    g_ptr_array_add(b->bookmarks, bookmark);
+
+    // Desktop
+    bookmark = g_new0(BookmarkInfo, 1);
+    bookmark->label = _("Desktop");
+    bookmark->uri = g_build_filename(home_dir, "Desktop", NULL);
+    bookmark->icon = "gnome-fs-desktop";
+    g_ptr_array_add(b->bookmarks, bookmark);
+    
+    // File System (/)
+    bookmark = g_new0(BookmarkInfo, 1);
+    bookmark->label = _("File System");
+    bookmark->uri = "/";
+    bookmark->icon = "gnome-dev-harddisk";
+    g_ptr_array_add(b->bookmarks, bookmark);
+
+    return b;
+}
+
+static gboolean
+places_bookmarks_system_changed(BookmarksSystem *b)
+{
+    return FALSE;
+}
+
+static void
+places_bookmarks_system_visit(BookmarksSystem *b,
+                              gpointer pass_thru, 
+                              BOOKMARK_ITEM_FUNC(item_func),
+                              BOOKMARK_SEPARATOR_FUNC(separator_func))
+{
+    guint k;
+    BookmarkInfo *bi;
+    
+    for(k=0; k < b->bookmarks->len; k++){
+        bi = g_ptr_array_index(b->bookmarks, k);
+        item_func(pass_thru, bi->label, bi->uri, bi->icon);
+    }
+}
+
+static void
+places_bookmarks_system_finalize(BookmarksSystem *b)
+{
+    g_ptr_array_free(b->bookmarks, TRUE);
+    g_free(b);
+}
+
+// vim: ai et tabstop=4

Copied: xfce4-places-plugin/trunk/panel-plugin/model_user.c (from rev 2670, xfce4-places-plugin/branches/volumes/panel-plugin/model_user.c)
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_user.c	                        (rev 0)
+++ xfce4-places-plugin/trunk/panel-plugin/model_user.c	2007-04-05 19:12:04 UTC (rev 2671)
@@ -0,0 +1,141 @@
+/*  xfce4-places-plugin
+ *
+ *  Copyright (c) 2007 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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "model.h"
+#include <glib/gstdio.h>
+#include "unescape_uri.c"
+
+typedef struct
+{
+  GPtrArray *bookmarks;
+  gchar     *filename;
+  time_t     loaded;
+} BookmarksUser;
+
+
+// internal
+
+static void
+places_bookmarks_user_reinit(BookmarksUser *b)
+{
+    DBG("initializing");
+    BookmarkInfo *bi;
+
+    gchar *contents;
+    gchar **split;
+    gchar **lines;
+    int i;
+    
+    if (!g_file_get_contents(b->filename, &contents, NULL, NULL)) {
+        DBG("Error opening gtk bookmarks file");
+    }else{
+    
+        lines = g_strsplit (contents, "\n", -1);
+        g_free(contents);
+  
+        for (i = 0; lines[i]; i++) {
+            if(!lines[i][0])
+                continue;
+    
+            bi = g_new0(BookmarkInfo, 1);
+            bi->icon = "gnome-fs-directory";
+
+            // See if the line is in the form "file:///path" or "file:///path friendly-name"
+            split = g_strsplit(lines[i], " ", 2);
+            if(split[1]){
+                bi->label = g_strdup(split[1]);
+                bi->uri = g_strdup(split[0]);
+            }else{
+                bi->label = places_unescape_uri_string(g_strrstr(lines[i], "/") + sizeof(gchar));
+                bi->uri = g_strdup(lines[i]);
+            }
+
+            g_ptr_array_add(b->bookmarks, bi);
+            g_free(split);
+        }
+
+        g_strfreev(lines);
+    }
+}
+
+static time_t
+places_bookmarks_user_get_mtime(BookmarksUser *b)
+{
+    struct stat buf;
+    if(g_stat(b->filename, &buf) == 0)
+        return buf.st_mtime;
+    return 0;
+}
+
+// external
+
+static BookmarksUser*
+places_bookmarks_user_init()
+{ 
+    BookmarksUser *b = g_new0(BookmarksUser, 1);
+
+    b->filename = g_build_filename(xfce_get_homedir(), ".gtk-bookmarks", NULL);
+    b->bookmarks = g_ptr_array_new();
+    b->loaded = places_bookmarks_user_get_mtime(b);
+    
+    places_bookmarks_user_reinit(b);
+    return b;
+}
+
+static gboolean
+places_bookmarks_user_changed(BookmarksUser *b)
+{
+    time_t mtime = places_bookmarks_user_get_mtime(b);
+    
+    if(mtime > b->loaded){
+        g_ptr_array_free(b->bookmarks, TRUE);
+        b->bookmarks = g_ptr_array_new();
+        b->loaded = mtime;
+        places_bookmarks_user_reinit(b);
+        return TRUE;
+    }
+
+    return FALSE;
+}
+
+static void
+places_bookmarks_user_visit(BookmarksUser *b,
+                            gpointer pass_thru, 
+                            BOOKMARK_ITEM_FUNC(item_func),
+                            BOOKMARK_SEPARATOR_FUNC(separator_func))
+{
+    guint k;
+    BookmarkInfo *bi;
+    
+    for(k=0; k < b->bookmarks->len; k++){
+        bi = g_ptr_array_index(b->bookmarks, k);
+        item_func(pass_thru, bi->label, bi->uri, bi->icon);
+    }
+}
+
+static void
+places_bookmarks_user_finalize(BookmarksUser *b)
+{
+    g_ptr_array_free(b->bookmarks, TRUE);
+    g_free(b->filename);
+    g_free(b);
+}
+
+
+// vim: ai et tabstop=4

Copied: xfce4-places-plugin/trunk/panel-plugin/model_volumes.c (from rev 2670, xfce4-places-plugin/branches/volumes/panel-plugin/model_volumes.c)
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_volumes.c	                        (rev 0)
+++ xfce4-places-plugin/trunk/panel-plugin/model_volumes.c	2007-04-05 19:12:04 UTC (rev 2671)
@@ -0,0 +1,234 @@
+/*  xfce4-places-plugin
+ *
+ *  Copyright (c) 2007 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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "model.h"
+#include <thunar-vfs/thunar-vfs.h>
+
+typedef struct
+{
+    GPtrArray *bookmarks;
+    gboolean   changed;
+    ThunarVfsVolumeManager *volume_manager;
+} BookmarksVolumes;
+
+static gboolean places_show_volume(ThunarVfsVolume *volume);
+static void places_bookmarks_volumes_add(BookmarksVolumes *b, const GList *volumes);
+
+
+/********** ThunarVFS Callbacks **********/
+
+static void
+places_cb_volume_changed(ThunarVfsVolume *volume, BookmarksVolumes *b){
+    DBG("volume changed"); 
+    // unfortunately there tends to be like 3 of these in a row
+
+    guint k;
+
+    if(places_show_volume(volume)){
+
+        // make sure it's in the array
+        for(k = 0; k < b->bookmarks->len; k++){
+            BookmarkInfo *bi = g_ptr_array_index(b->bookmarks, k);
+            if(THUNAR_VFS_VOLUME(bi->data) == volume)
+                break;
+        }
+
+        if(k == b->bookmarks->len){ // it's not there
+            DBG("adding volume to array");
+
+            places_bookmarks_volumes_add(b, g_list_prepend(NULL, volume));
+            b->changed = TRUE;
+        }else{
+            DBG("volume already in array");
+        }
+
+    }else{
+        // make sure it's not in the array
+        for(k = 0; k < b->bookmarks->len; k++){
+            BookmarkInfo *bi = g_ptr_array_index(b->bookmarks, k);
+            if(THUNAR_VFS_VOLUME(bi->data) == volume){ // it is there
+                DBG("dropping volume from array");
+                
+                bi = g_ptr_array_remove_index(b->bookmarks, k);
+                g_object_unref(bi->data);
+                g_free(bi);
+                
+                b->changed = TRUE;
+            }
+        }
+    }
+}
+
+static void
+places_cb_volumes_added(ThunarVfsVolumeManager *volume_manager, const GList *volumes, BookmarksVolumes *b){
+    DBG("volumes added");
+    places_bookmarks_volumes_add(b, volumes);
+    b->changed = TRUE;
+}
+
+static void
+places_cb_volumes_removed(ThunarVfsVolumeManager *volume_manager, const GList *volumes, BookmarksVolumes *b){
+    DBG("volumes removed");
+
+    GList *vol_iter;
+    guint k;
+
+    // step through existing bookmarks
+    for(k = 0; k < b->bookmarks->len; k++){
+        BookmarkInfo *bi = g_ptr_array_index(b->bookmarks, k);
+
+        // step through removals
+        vol_iter = (GList*) volumes;
+        while(vol_iter){
+            if(bi->data == vol_iter->data){ // it is there
+                
+                // delete the bookmark
+                bi = g_ptr_array_remove_index(b->bookmarks, k);
+                DBG("Removing bookmark %s", bi->label);
+                
+                if(bi->data)
+                    g_object_unref(bi->data);
+                g_free(bi);
+                
+                b->changed = TRUE;
+            }
+
+            vol_iter = vol_iter->next;
+        }
+    }
+}
+
+// internal
+static gboolean
+places_show_volume(ThunarVfsVolume *volume){
+    
+    DBG("Volume: %s [mounted=%x removable=%x present=%x]", thunar_vfs_volume_get_name(volume), 
+                                                           thunar_vfs_volume_is_mounted(volume),
+                                                           thunar_vfs_volume_is_removable(volume), 
+                                                           thunar_vfs_volume_is_present(volume));
+
+    return thunar_vfs_volume_is_mounted(volume) && 
+           thunar_vfs_volume_is_removable(volume) && 
+           thunar_vfs_volume_is_present(volume);
+}
+
+
+static void
+places_bookmarks_volumes_add(BookmarksVolumes *b, const GList *volumes)
+{
+    ThunarVfsVolume *volume;
+    BookmarkInfo *bi;
+    GtkIconTheme *icon_theme = gtk_icon_theme_get_default();
+
+    while(volumes){
+        volume = THUNAR_VFS_VOLUME(volumes->data);
+        
+        g_signal_connect (volume, "changed",
+                      G_CALLBACK(places_cb_volume_changed), b);
+
+        if(places_show_volume(volume)){
+
+            g_object_ref(volume);
+
+            bi          = g_new0(BookmarkInfo, 1);
+            bi->label   = g_strdup( thunar_vfs_volume_get_name(volume) );
+            bi->uri     = thunar_vfs_path_dup_uri( thunar_vfs_volume_get_mount_point(volume) );
+            bi->icon    = g_strdup( thunar_vfs_volume_lookup_icon_name(volume, icon_theme) );
+            bi->data    = (gpointer) volume;
+
+            g_ptr_array_add(b->bookmarks, bi);
+        }
+
+        volumes = volumes->next;
+    }
+}
+
+// external
+
+static BookmarksVolumes*
+places_bookmarks_volumes_init()
+{
+    DBG("init");
+    BookmarksVolumes *b = g_new0(BookmarksVolumes, 1);
+
+    thunar_vfs_init();
+    
+    b->bookmarks = g_ptr_array_new();
+    b->changed = FALSE;
+    b->volume_manager = thunar_vfs_volume_manager_get_default();
+    
+    places_bookmarks_volumes_add(b, thunar_vfs_volume_manager_get_volumes(b->volume_manager));
+
+    g_signal_connect (b->volume_manager, "volumes-added",
+                      G_CALLBACK (places_cb_volumes_added), b);
+
+    g_signal_connect (b->volume_manager, "volumes-removed",
+                      G_CALLBACK (places_cb_volumes_removed), b);
+
+    DBG("done");
+
+    return b;
+}
+
+static void
+places_bookmarks_volumes_finalize(BookmarksVolumes *b)
+{
+    guint k;
+    
+    thunar_vfs_shutdown();
+    g_object_unref(b->volume_manager);
+    
+    for(k = 0; k < b->bookmarks->len; k++){
+        BookmarkInfo *bi = g_ptr_array_remove_index(b->bookmarks, k);
+        if(bi->data)
+            g_object_unref(bi->data);
+    }
+
+    g_ptr_array_free(b->bookmarks, TRUE);
+    g_free(b);
+}
+
+static gboolean
+places_bookmarks_volumes_changed(BookmarksVolumes *b)
+{
+    if(b->changed){
+        b->changed = FALSE;
+        return TRUE;
+    }else{
+        return FALSE;
+    }
+}
+
+static void
+places_bookmarks_volumes_visit(BookmarksVolumes *b,
+                               gpointer pass_thru, 
+                               BOOKMARK_ITEM_FUNC(item_func),
+                               BOOKMARK_SEPARATOR_FUNC(separator_func))
+{
+    guint k;
+    BookmarkInfo *bi;
+    
+    for(k=0; k < b->bookmarks->len; k++){
+        bi = g_ptr_array_index(b->bookmarks, k);
+        item_func(pass_thru, bi->label, bi->uri, bi->icon);
+    }
+}
+
+
+// vim: ai et tabstop=4

Modified: xfce4-places-plugin/trunk/panel-plugin/places.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/places.c	2007-04-05 18:50:30 UTC (rev 2670)
+++ xfce4-places-plugin/trunk/panel-plugin/places.c	2007-04-05 19:12:04 UTC (rev 2671)
@@ -22,32 +22,18 @@
 #endif
 
 #include <gtk/gtk.h>
-#include <glib/gstdio.h>
 
-#include <libxfce4util/libxfce4util.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 #include <libxfce4panel/xfce-arrow-button.h>
 #include <libxfce4panel/xfce-hvbox.h>
 #include <libxfce4panel/xfce-panel-convenience.h>
 #include <libxfcegui4/libxfcegui4.h>
 
+#include "model.c"
 #include "places.h"
-#include "unescape_uri.c"
 
 #define PLUGIN_NAME "places"
 
-/********** Structs **********/
-static BookmarkInfo*
-places_construct_BookmarkInfo(gchar* label, gchar* uri, gchar* icon)
-{
-    BookmarkInfo *info = g_new(BookmarkInfo, 1);
-    info->label = label;
-    info->uri = uri;
-    info->icon = icon;
-    return info;
-}
-
-
 /********** Initialization **********/
 XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL(places_construct);
 
@@ -63,7 +49,9 @@
 
     PlacesData *pd = panel_slice_new0(PlacesData);
     pd->plugin = plugin;
-    places_init_bookmarks(pd);
+
+    pd->bookmarks = places_bookmarks_init();
+    
     places_init_ui(pd);
 
     g_signal_connect (pd->panel_button, "button-release-event",
@@ -84,88 +72,6 @@
 }
 
 static void
-places_init_bookmarks(PlacesData *pd)
-{
-    DBG("initializing");
-
-    pd->bookmarks_system = g_ptr_array_new();
-    places_init_bookmarks_system(pd);
-
-    pd->bookmarks_user_filename = g_build_filename(xfce_get_homedir(), ".gtk-bookmarks", NULL);
-    pd->bookmarks_user_loaded = -1;
-    pd->bookmarks_user = g_ptr_array_new();
-    places_init_bookmarks_user(pd);
-
-}
-
-static void
-places_init_bookmarks_system(PlacesData *pd)
-{
-    DBG("initializing");
-
-    const gchar *home_dir = xfce_get_homedir();
-
-    // These icon names are consistent with Thunar.
-
-    // Home
-    g_ptr_array_add(pd->bookmarks_system, places_construct_BookmarkInfo(g_strdup(g_get_user_name()),
-                                                g_strdup(home_dir), "gnome-fs-home"));
-
-    // Trash
-    g_ptr_array_add(pd->bookmarks_system, places_construct_BookmarkInfo(_("Trash"), 
-                                                "trash:///", "gnome-fs-trash-full"));
-    
-    // Desktop
-    g_ptr_array_add(pd->bookmarks_system, places_construct_BookmarkInfo(_("Desktop"), 
-                                                g_build_filename(home_dir, "Desktop", NULL), "gnome-fs-desktop"));
-    
-    // File System (/)
-    g_ptr_array_add(pd->bookmarks_system, places_construct_BookmarkInfo(_("File System"), 
-                                                "/", "gnome-dev-harddisk"));
-}
-
-static void
-places_init_bookmarks_user(PlacesData *pd)
-{
-    DBG("initializing");
-
-    gchar *contents;
-    gchar **split;
-    gchar **lines;
-    int i;
-    
-    if (!g_file_get_contents(pd->bookmarks_user_filename, &contents, NULL, NULL)) {
-        DBG("Error opening gtk bookmarks file");
-    }else{
-    
-        pd->bookmarks_user_loaded = places_get_bookmarks_user_mtime(pd);
-
-        lines = g_strsplit (contents, "\n", -1);
-        g_free (contents);
-  
-        for (i = 0; lines[i]; i++) {
-            if(!lines[i][0])
-                continue;
-    
-            // See if the line is in the form "file:///path" or "file:///path friendly-name"
-            split = g_strsplit(lines[i], " ", 2);
-            if(split[1]){
-                g_ptr_array_add(pd->bookmarks_user, places_construct_BookmarkInfo(g_strdup(split[1]), 
-                                                                   g_strdup(split[0]), "gnome-fs-directory"));
-            }else{
-                g_ptr_array_add(pd->bookmarks_user, places_construct_BookmarkInfo(places_unescape_uri_string(g_strrstr(lines[i], "/") + sizeof(gchar)), 
-                                                                   g_strdup(lines[i]), "gnome-fs-directory"));
-            }
-            g_free(split);
-
-        }
-
-        g_strfreev(lines);
-    }
-}
-
-
-static void
 places_init_ui(PlacesData *pd)
 {
     DBG("initializing");
@@ -215,79 +121,71 @@
 }
 
 static void
-places_init_panel_menu(PlacesData *pd)
+places_build_menu_item(gpointer _pd, const gchar *label, const gchar *uri, const gchar *icon)
 {
-    DBG("initializing");
+    g_assert(_pd);
+    g_return_if_fail(label && label != "");
+    g_return_if_fail(uri && uri != "");
 
-    pd->panel_menu = gtk_menu_new();
-    pd->panel_menu_open = FALSE;
-    
-    places_init_panel_menu_system(pd);
-    
-    // separator
-    gtk_menu_shell_append(GTK_MENU_SHELL(pd->panel_menu),
-                          places_bookmark_info_to_gtk_menu_item(NULL));
+    PlacesData *pd = (PlacesData*) _pd;
+    GtkWidget *item = gtk_image_menu_item_new_with_label(label);
 
-    places_init_panel_menu_user(pd);
+    if(G_LIKELY(icon != NULL)){
+        GdkPixbuf *pb = xfce_themed_icon_load(icon, 16);
+        
+        if(G_LIKELY(pb != NULL)){
+            GtkWidget *image = gtk_image_new_from_pixbuf(pb);
+            g_object_unref(pb);
+            gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
+        }
+    }
 
-
-    gtk_widget_show(pd->panel_menu);
-    // This helps allocate resources beforehand so it'll pop up faster the first time
-    gtk_widget_realize(pd->panel_menu);
-    
-    gtk_menu_attach_to_widget(GTK_MENU(pd->panel_menu), pd->panel_arrow, NULL);
-
+    g_signal_connect(item, "button-release-event",
+                     G_CALLBACK(places_cb_menu_item_act), (gchar*) uri);
+    gtk_menu_shell_append(GTK_MENU_SHELL(pd->panel_menu), item);
 }
 
-
 static void
-places_init_panel_menu_system(PlacesData *pd)
+places_build_menu_separator(gpointer _pd)
 {
-    DBG("initializing");
-
-    int k;
-    for(k = 0; k < pd->bookmarks_system->len; k++){
-        BookmarkInfo *i = g_ptr_array_index(pd->bookmarks_system, k);
-        gtk_menu_shell_append(GTK_MENU_SHELL(pd->panel_menu), 
-                              places_bookmark_info_to_gtk_menu_item(i));
-     }
+    g_assert(_pd);
+    PlacesData *pd = (PlacesData*) _pd;
+    gtk_menu_shell_append(GTK_MENU_SHELL(pd->panel_menu),
+                          gtk_menu_item_new());
 }
 
 static void
-places_init_panel_menu_user(PlacesData *pd)
+places_init_panel_menu(PlacesData *pd)
 {
     DBG("initializing");
+    g_assert(pd && pd->panel_menu == NULL);
 
-    int k;
-    for(k = 0; k < pd->bookmarks_user->len; k++){
-        BookmarkInfo *i = g_ptr_array_index(pd->bookmarks_user, k);
-        gtk_menu_shell_append(GTK_MENU_SHELL(pd->panel_menu), 
-                              places_bookmark_info_to_gtk_menu_item(i));
+    pd->panel_menu = gtk_menu_new();
+    pd->panel_menu_open = FALSE;
+    
+    places_bookmarks_visit(pd->bookmarks, pd, 
+                           places_build_menu_item, 
+                           places_build_menu_separator);
 
-    }
-}
+    gtk_widget_show_all(pd->panel_menu);
 
+    // This helps allocate resources beforehand so it'll pop up faster the first time
+    gtk_widget_realize(pd->panel_menu);
+    
+    gtk_menu_attach_to_widget(GTK_MENU(pd->panel_menu), pd->panel_arrow, NULL);
 
+}
 
 /********** Library **********/
 
 static void
-places_load_thunar(const gchar * path)
+places_load_thunar(const gchar *path)
 {
-    gchar * cmd = g_strconcat("thunar ", path, NULL);
-    xfce_exec(cmd, FALSE, FALSE, NULL);
+    gchar *cmd = g_strconcat("thunar ", path, NULL);
+    xfce_exec(cmd, FALSE, TRUE, NULL);
     g_free(cmd);
 }
 
-static time_t
-places_get_bookmarks_user_mtime(PlacesData *pd)
-{
-    struct stat buf;
-    if(g_stat(pd->bookmarks_user_filename, &buf) == 0)
-        return buf.st_mtime;
-    return 0;
-}
-
 /********** UI Helpers **********/
 
 static void
@@ -302,34 +200,6 @@
     pd->panel_menu_open = FALSE;  
 }
 
-static GtkWidget*
-places_bookmark_info_to_gtk_menu_item(BookmarkInfo *i)
-{
-    GtkWidget *item;
-    GtkWidget *image;
-
-    if(i != NULL) { // regular item
-        item = gtk_image_menu_item_new_with_label(i->label);
-        
-        GdkPixbuf *pb = xfce_themed_icon_load(i->icon, 16);
-        if(pb != NULL){
-            image = gtk_image_new_from_pixbuf(pb);
-            g_object_unref(pb);
-            gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
-        }
-
-        g_signal_connect (item, "button-release-event",
-                          G_CALLBACK(places_cb_menu_item_act), i);
-
-    } else { //separator
-        item = gtk_menu_item_new();
-    }
-        
-    gtk_widget_show(item);
-
-    return item;
-}
-
 static void
 places_ui_redraw(PlacesData *pd)
 {
@@ -465,15 +335,13 @@
     }else{
         // This will make it behave like a mouse release when it's really a mouse press
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(arrow), TRUE);
+    
+        DBG("Has the model changed?");
+        if(places_bookmarks_changed(pd->bookmarks)){
+            DBG("Model changed");
 
-        if(places_get_bookmarks_user_mtime(pd) > pd->bookmarks_user_loaded){
-            DBG("bookmarks file changed");
-
             gtk_widget_destroy(pd->panel_menu);
-            
-            g_ptr_array_free(pd->bookmarks_user, TRUE);
-            pd->bookmarks_user = g_ptr_array_new();
-            places_init_bookmarks_user(pd);
+            pd->panel_menu = NULL;
 
             places_init_panel_menu(pd);
             g_signal_connect (pd->panel_menu, "deactivate", 
@@ -490,11 +358,11 @@
 }
 
 static gboolean
-places_cb_menu_item_act(GtkWidget *widget, GdkEventButton *event, BookmarkInfo *item)
+places_cb_menu_item_act(GtkWidget *widget, GdkEventButton *event, const gchar* uri)
 {
     DBG("load thunar for item");
 
-    places_load_thunar((const gchar*) item->uri);
+    places_load_thunar(uri);
     
     return FALSE;
 }
@@ -507,9 +375,7 @@
     
     DBG("load thunar at home directory");
     
-    // TODO: don't open if they dragged mouse away
-    places_load_thunar(g_get_home_dir());
-
+    places_load_thunar(NULL);
     return FALSE;
 }
 
@@ -518,10 +384,8 @@
 {
     DBG ("Free data: %s", PLUGIN_NAME);
     g_assert(pd != NULL);
-    
-    g_ptr_array_free(pd->bookmarks_system, TRUE);
-    g_ptr_array_free(pd->bookmarks_user, TRUE);
-    g_free(pd->bookmarks_user_filename);
+   
+    places_bookmarks_finalize(pd->bookmarks);
 
     panel_slice_free(PlacesData, pd);
 }

Modified: xfce4-places-plugin/trunk/panel-plugin/places.h
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/places.h	2007-04-05 18:50:30 UTC (rev 2670)
+++ xfce4-places-plugin/trunk/panel-plugin/places.h	2007-04-05 19:12:04 UTC (rev 2671)
@@ -33,41 +33,20 @@
   gboolean   panel_menu_open;
   int        panel_size;
 
-  // bookmarks
-  GPtrArray *bookmarks_system;
-  GPtrArray *bookmarks_user;
-  gchar     *bookmarks_user_filename;
-  time_t     bookmarks_user_loaded;
+  gpointer   bookmarks;
 
 } PlacesData;
 
-
-typedef struct
-{
-    gchar *label;
-    gchar *uri;
-    gchar *icon;
-} BookmarkInfo;
-static BookmarkInfo* places_construct_BookmarkInfo(gchar* label, gchar* uri, gchar* icon);
-
 // Init
 static void places_construct(XfcePanelPlugin*);
- static void places_init_bookmarks(PlacesData*);
-  static void places_init_bookmarks_system(PlacesData*);
-  static void places_init_bookmarks_user(PlacesData*);
- static void places_init_ui(PlacesData*);
-  static void places_init_panel_menu(PlacesData*);
-   static void places_init_panel_menu_system(PlacesData*);
-   static void places_init_panel_menu_user(PlacesData*);
+static void places_init_ui(PlacesData*);
+static void places_init_panel_menu(PlacesData*);
 
-
 // Library
 static void places_load_thunar(const gchar*);
-static time_t places_get_bookmarks_user_mtime(PlacesData*);
 
 // UI Helpers
 static void places_close_menu(PlacesData*);
-static GtkWidget* places_bookmark_info_to_gtk_menu_item(BookmarkInfo*);
 static void places_ui_redraw(PlacesData*);
 
 // GTK Callbacks
@@ -75,7 +54,7 @@
 static void places_cb_menu_position(GtkMenu*, int*, int*, gboolean*, PlacesData*);
 static void places_cb_menu_close(GtkMenuShell*, PlacesData*);
 static gboolean places_cb_menu_open(GtkButton*, GdkEventButton*, PlacesData*);
-static gboolean places_cb_menu_item_act(GtkWidget*, GdkEventButton*, BookmarkInfo*);
+static gboolean places_cb_menu_item_act(GtkWidget*, GdkEventButton*, const gchar*);
 static gboolean places_cb_button_act(GtkWidget*, GdkEventButton*, gpointer);
 static void places_cb_free_data(XfcePanelPlugin*, PlacesData*);
 

Modified: xfce4-places-plugin/trunk/panel-plugin/unescape_uri.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/unescape_uri.c	2007-04-05 18:50:30 UTC (rev 2670)
+++ xfce4-places-plugin/trunk/panel-plugin/unescape_uri.c	2007-04-05 19:12:04 UTC (rev 2671)
@@ -27,6 +27,9 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#ifndef _XFCE_PANEL_PLACES_UNESCAPE_URI_C
+#define _XFCE_PANEL_PLACES_UNESCAPE_URI_C
+
 #include <string.h>
 #include <glib.h>
 
@@ -116,3 +119,5 @@
 places_unescape_uri_string(const gchar* escaped) {
 	return g_unescape_uri_string(escaped, -1, "", FALSE);
 }
+
+#endif




More information about the Goodies-commits mailing list