+2005-09-06 Benedikt Meurer <benny@xfce.org>
+
+ * thunar-vfs/thunar-vfs-uri.c: Invoke the parent's finalize method, as
+ that will be required for language bindings once we have weak/toggle
+ references for ExoObject.
+ * thunar/thunar-local-file.c(thunar_local_file_rename): Re-register with
+ the VFS monitor if the rename succeeds.
+ * thunar-vfs/thunar-vfs-uri.c(thunar_vfs_uri_hash): Don't hash the
+ hostname if it's NULL.
+ * thunar-vfs/thunar-vfs-uri.c(thunar_vfs_uri_equal): We don't need to
+ query the hostname string here, as local files will always have host
+ set to NULL.
+ * tests/test-thunar-vfs-uri.c(main): Extend the ThunarVfsURI test.
+ * pixmaps/, Makefile.am, configure.in.in, thunar/thunar-window.c,
+ thunar/Makefile.am: Initial idea for the about dialog logo.
+
2005-09-05 Benedikt Meurer <benny@xfce.org>
* thunar-vfs/thunar-vfs-info.{c,h}, thunar-vfs/thunar-vfs-listdir-job.c:
SUBDIRS = \
docs \
+ pixmaps \
po \
thunar-vfs \
thunarx \
docs/design/Makefile
docs/papers/Makefile
po/Makefile.in
+pixmaps/Makefile
tests/Makefile
tests/data/Makefile
thunar/Makefile
--- /dev/null
+# $Id$
+
+pixmapsdir = $(datadir)/pixmaps/Thunar
+pixmaps_DATA = \
+ Thunar-about-logo.png
+
+EXTRA_DIST = \
+ $(pixmaps_DATA)
+
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
g_assert (exo_str_is_equal (thunar_vfs_uri_get_name (a), "/"));
g_assert (exo_str_is_equal (thunar_vfs_uri_get_path (a), "/"));
g_assert (thunar_vfs_uri_parent (a) == NULL);
- g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (a, THUNAR_VFS_URI_HIDE_HOST), "file:///"));
+ g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (a, 0), "file:///"));
/* verify that URI parsing works */
a = thunar_vfs_uri_new_for_path ("/tmp");
b = thunar_vfs_uri_relative (a, "bin");
g_assert (!thunar_vfs_uri_equal (a, b));
g_assert (thunar_vfs_uri_equal (a, thunar_vfs_uri_parent (b)));
- g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (a, THUNAR_VFS_URI_HIDE_HOST), "file:///usr"));
- g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (b, THUNAR_VFS_URI_HIDE_HOST), "file:///usr/bin"));
+ g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (a, 0), "file:///usr"));
+ g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (b, 0), "file:///usr/bin"));
/* verify that trash:// uris work */
a = thunar_vfs_uri_new ("trash:", NULL);
g_assert (thunar_vfs_uri_equal (a, b));
g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (a, 0), "trash:///"));
+ /* verify thunar_vfs_uri_to_string */
+ a = thunar_vfs_uri_new ("file:///a ", NULL);
+ b = thunar_vfs_uri_new ("file:///b+", NULL);
+ g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (a, THUNAR_VFS_URI_STRING_UTF8), "file:///a "));
+ g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (a, THUNAR_VFS_URI_STRING_ESCAPED), "file:///a%20"));
+ g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (b, THUNAR_VFS_URI_STRING_UTF8), "file:///b+"));
+ g_assert (exo_str_is_equal (thunar_vfs_uri_to_string (b, THUNAR_VFS_URI_STRING_ESCAPED), "file:///b%2B"));
+
return EXIT_SUCCESS;
}
-static const gchar *home_path;
-static gchar *localhost;
+static ExoObjectClass *thunar_vfs_uri_parent_class;
+static const gchar *home_path;
+static gchar *localhost;
#ifndef G_DISABLE_CHECKS
G_LOCK_DEFINE_STATIC (debug_uris);
{
ExoObjectClass *exoobject_class;
+ /* determine the parent class */
+ thunar_vfs_uri_parent_class = g_type_class_peek_parent (klass);
+
/* determine the path to the current user's homedir */
home_path = xfce_get_homedir ();
/* free the path */
g_free (uri->path);
- /* We don't call the parent's finalize method here,
- * because we know that ExoObject does not finalize
- * anything. But this only works as long as we are
- * a direct decendant of ExoObject, so be sure to
- * verify that here.
- */
- g_assert (g_type_parent (THUNAR_VFS_TYPE_URI) == EXO_TYPE_OBJECT);
+ (*EXO_OBJECT_CLASS (thunar_vfs_uri_parent_class)->finalize) (object);
}
guint
thunar_vfs_uri_hash (gconstpointer uri)
{
- const gchar *host;
const gchar *p;
guint h;
h = (h << 5) - h + *p;
/* hash the host (if present) */
- host = thunar_vfs_uri_get_host (THUNAR_VFS_URI (uri));
- if (G_LIKELY (host != NULL))
- for (p = host; *p != '\0'; ++p)
+ if (G_LIKELY (THUNAR_VFS_URI (uri)->host != NULL))
+ for (p = THUNAR_VFS_URI (uri)->host; *p != '\0'; ++p)
h = (h << 5) - h + *p;
return h;
thunar_vfs_uri_equal (gconstpointer a,
gconstpointer b)
{
- const gchar *a_host;
- const gchar *b_host;
const gchar *a_name;
const gchar *b_name;
const gchar *a_path;
if (THUNAR_VFS_URI (a)->scheme != THUNAR_VFS_URI (b)->scheme)
return FALSE;
- /* compare the host names (TODO: speedup?!) */
- a_host = thunar_vfs_uri_get_host (THUNAR_VFS_URI (a));
- b_host = thunar_vfs_uri_get_host (THUNAR_VFS_URI (b));
- if (!exo_str_is_equal (a_host, b_host))
- return FALSE;
-
a_name = THUNAR_VFS_URI (a)->name;
b_name = THUNAR_VFS_URI (b)->name;
if (G_LIKELY (*ap != '\0' || *bp != '\0'))
return FALSE;
+ /* compare the host names */
+ if (!exo_str_is_equal (THUNAR_VFS_URI (a)->host, THUNAR_VFS_URI (b)->host))
+ return FALSE;
+
a_path = THUNAR_VFS_URI (a)->path;
b_path = THUNAR_VFS_URI (b)->path;
INCLUDES = \
-I$(top_srcdir) \
+ -DDATADIR=\"$(datadir)\" \
-DEXO_API_SUBJECT_TO_CHANGE \
-DEXO_DISABLE_DEPRECATED \
-DG_LOG_DOMAIN=\"Thunar\" \
succeed = thunar_vfs_info_rename (local_file->info, name, error);
if (G_LIKELY (succeed))
{
+ /* need to re-register the monitor handle for the new uri */
+ if (G_LIKELY (local_file->handle != NULL))
+ {
+ /* drop the previous handle (with the old URI) */
+ thunar_vfs_monitor_remove (monitor, local_file->handle);
+
+ /* register the new handle (with the new URI) */
+ local_file->handle = thunar_vfs_monitor_add_file (monitor, local_file->info->uri, thunar_local_file_monitor, local_file);
+ }
+
/* perform the rename on the file cache */
_thunar_file_cache_rename (file, previous_uri);
"this program; if not, write to the Free Software Foundation, Inc., 59 Temple\n"
"Place, Suite 330, Boston, MA 02111-1307 USA.\n";
+ GdkPixbuf *logo;
+
+ /* try to load the about logo */
+ logo = gdk_pixbuf_new_from_file (DATADIR "/pixmaps/Thunar/Thunar-about-logo.png", NULL);
+
+ /* open the about dialog */
gtk_about_dialog_set_email_hook ((gpointer) exo_noop, NULL, NULL);
gtk_about_dialog_set_url_hook ((gpointer) exo_noop, NULL, NULL);
gtk_show_about_dialog (GTK_WINDOW (window),
"comments", _("Thunar is a fast and easy to use file manager\nfor the Xfce Desktop Environment."),
"copyright", "Copyright © 2004-2005 Benedikt Meurer",
"license", license,
+ "logo", logo,
"name", PACKAGE_NAME,
"translator-credits", _("translator-credits"),
"version", PACKAGE_VERSION,
"website", "http://thunar.xfce.org/",
NULL);
+
+ /* release the about logo (if any) */
+ if (G_LIKELY (logo != NULL))
+ g_object_unref (G_OBJECT (logo));
}