From 5983fddbce5b60b277343b1b22a205f04ff79f03 Mon Sep 17 00:00:00 2001 From: Dave Camp Date: Thu, 1 May 2003 02:28:59 +0000 Subject: Merged bugfixes from HEAD. 2003-04-30 Dave Camp Merged bugfixes from HEAD. 2003-04-23 Dave Camp * src/file-manager/fm-properties-window.c: (create_emblems_page): Modify emblems on the original_file, not the target_file. 2003-04-23 Alexander Larsson * src/file-manager/fm-list-view.c (key_press_callback): * libnautilus-private/nautilus-icon-container.c (key_press_event): * docs/key_mouse_navigation.txt (Keyboard): Bring up context menu is Ctrl-F10, not Shift-F9 2003-04-23 Alexander Larsson * src/file-manager/fm-desktop-icon-view.c (volume_ops_callback): Check for file: instead of is_local when verifying a volume desktop file is ok. Fixes bug #98306. 2003-04-23 Alexander Larsson * src/nautilus-window-menus.c (view_menu_zoom_normal_callback): Do a zoom to 100%, not a best-fit. Fixes bug #109413, patch by Jens Finke. 2003-04-16 Alexander Larsson * cut-n-paste-code/libegg/Makefile.am: * cut-n-paste-code/libegg/egg-recent-vfs-util.c: * cut-n-paste-code/libegg/egg-recent-vfs-util.h: Remove old files * cut-n-paste-code/libegg/egg-recent-item.c: (egg_recent_item_set_uri), (egg_recent_item_get_uri_for_display): * cut-n-paste-code/libegg/egg-recent-model.c: (egg_recent_model_update_item), (egg_recent_model_filter), (egg_recent_model_read), (egg_recent_model_add_full), (egg_recent_model_get_list), (egg_recent_model_changed): * cut-n-paste-code/libegg/egg-screen-exec.c: (egg_screen_exec_environment), (egg_screen_execute_command_line_async): Update libegg stuff. Among other stuff this makes nautilus scripts execute in the right directory. 2003-04-16 Alexander Larsson * components/emblem/Nautilus_View_emblem.server.in.in: * components/history/Nautilus_View_history.server.in.in: * components/image_properties/Nautilus_View_image_properties.server.in.in: * components/notes/Nautilus_View_notes.server.in.in: * components/tree/Nautilus_View_tree.server.in.in: Don't add .so to the server files. This makes it work on systems that don't use .so as the library name. * src/nautilus-main.c: (main): * src/nautilus-server-connect.c: (browse): Don't initialize array to a non-constant value. --- ChangeLog | 65 ++- .../emblem/Nautilus_View_emblem.server.in.in | 2 +- .../history/Nautilus_View_history.server.in.in | 2 +- .../Nautilus_View_image_properties.server.in.in | 2 +- components/notes/Nautilus_View_notes.server.in.in | 2 +- components/tree/Nautilus_View_tree.server.in.in | 2 +- cut-n-paste-code/libegg/Makefile.am | 2 - cut-n-paste-code/libegg/egg-recent-item.c | 7 +- cut-n-paste-code/libegg/egg-recent-model.c | 31 +- cut-n-paste-code/libegg/egg-recent-vfs-utils.c | 570 --------------------- cut-n-paste-code/libegg/egg-recent-vfs-utils.h | 42 -- cut-n-paste-code/libegg/egg-screen-exec.c | 21 +- docs/key_mouse_navigation.txt | 2 +- libnautilus-private/nautilus-icon-container.c | 9 +- src/file-manager/fm-desktop-icon-view.c | 8 +- src/file-manager/fm-list-view.c | 9 +- src/file-manager/fm-properties-window.c | 3 +- src/nautilus-main.c | 23 +- src/nautilus-navigation-window-menus.c | 2 +- src/nautilus-server-connect.c | 4 +- src/nautilus-window-menus.c | 2 +- 21 files changed, 137 insertions(+), 673 deletions(-) delete mode 100644 cut-n-paste-code/libegg/egg-recent-vfs-utils.c delete mode 100644 cut-n-paste-code/libegg/egg-recent-vfs-utils.h diff --git a/ChangeLog b/ChangeLog index d1c158c4f..01a635db2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,67 @@ -2003-04-02 Dave Camp +2003-04-30 Dave Camp - * src/file-manager/fm-list-view.c (motion_notify_callback): Only + Merged bugfixes from HEAD. + +2003-04-23 Dave Camp + + * src/file-manager/fm-properties-window.c: (create_emblems_page): + Modify emblems on the original_file, not the target_file. + +2003-04-23 Alexander Larsson + * src/file-manager/fm-list-view.c (key_press_callback): + * libnautilus-private/nautilus-icon-container.c (key_press_event): + * docs/key_mouse_navigation.txt (Keyboard): + Bring up context menu is Ctrl-F10, not Shift-F9 + +2003-04-23 Alexander Larsson + * src/file-manager/fm-desktop-icon-view.c (volume_ops_callback): + Check for file: instead of is_local when verifying a volume desktop file + is ok. Fixes bug #98306. + +2003-04-23 Alexander Larsson + + * src/nautilus-window-menus.c (view_menu_zoom_normal_callback): + Do a zoom to 100%, not a best-fit. + Fixes bug #109413, patch by Jens Finke. + +2003-04-16 Alexander Larsson + + * cut-n-paste-code/libegg/Makefile.am: + * cut-n-paste-code/libegg/egg-recent-vfs-util.c: + * cut-n-paste-code/libegg/egg-recent-vfs-util.h: + Remove old files + + * cut-n-paste-code/libegg/egg-recent-item.c: + (egg_recent_item_set_uri), (egg_recent_item_get_uri_for_display): + * cut-n-paste-code/libegg/egg-recent-model.c: + (egg_recent_model_update_item), (egg_recent_model_filter), + (egg_recent_model_read), (egg_recent_model_add_full), + (egg_recent_model_get_list), (egg_recent_model_changed): + * cut-n-paste-code/libegg/egg-screen-exec.c: + (egg_screen_exec_environment), + (egg_screen_execute_command_line_async): + + Update libegg stuff. + Among other stuff this makes nautilus scripts execute in the + right directory. + +2003-04-16 Alexander Larsson + + * components/emblem/Nautilus_View_emblem.server.in.in: + * components/history/Nautilus_View_history.server.in.in: + * components/image_properties/Nautilus_View_image_properties.server.in.in: + * components/notes/Nautilus_View_notes.server.in.in: + * components/tree/Nautilus_View_tree.server.in.in: + Don't add .so to the server files. This makes it work on systems that + don't use .so as the library name. + + * src/nautilus-main.c: (main): + * src/nautilus-server-connect.c: (browse): + Don't initialize array to a non-constant value. + +2003-04-02 Dave Camp + + * src/file-manager/fm-list-view.c (motion_notify_callback): Only handle motion_notify_event for the bin window. === nautilus 2.2.3.1 === diff --git a/components/emblem/Nautilus_View_emblem.server.in.in b/components/emblem/Nautilus_View_emblem.server.in.in index bbd698c20..4a9c825dd 100644 --- a/components/emblem/Nautilus_View_emblem.server.in.in +++ b/components/emblem/Nautilus_View_emblem.server.in.in @@ -1,7 +1,7 @@ + type="shlib" location="@BONOBODIR@/libnautilus-emblem-view"> diff --git a/components/history/Nautilus_View_history.server.in.in b/components/history/Nautilus_View_history.server.in.in index d52de7190..736c4ab46 100644 --- a/components/history/Nautilus_View_history.server.in.in +++ b/components/history/Nautilus_View_history.server.in.in @@ -1,7 +1,7 @@ + type="shlib" location="@BONOBODIR@/libnautilus-history-view"> diff --git a/components/image_properties/Nautilus_View_image_properties.server.in.in b/components/image_properties/Nautilus_View_image_properties.server.in.in index 55651cb96..afa1d90b3 100644 --- a/components/image_properties/Nautilus_View_image_properties.server.in.in +++ b/components/image_properties/Nautilus_View_image_properties.server.in.in @@ -1,7 +1,7 @@ + type="shlib" location="@BONOBODIR@/libnautilus-image-properties-view"> diff --git a/components/notes/Nautilus_View_notes.server.in.in b/components/notes/Nautilus_View_notes.server.in.in index edb4165e8..3137f5416 100644 --- a/components/notes/Nautilus_View_notes.server.in.in +++ b/components/notes/Nautilus_View_notes.server.in.in @@ -1,7 +1,7 @@ + type="shlib" location="@BONOBODIR@/libnautilus-notes-view"> diff --git a/components/tree/Nautilus_View_tree.server.in.in b/components/tree/Nautilus_View_tree.server.in.in index 3f5b6e542..a9b29cb04 100644 --- a/components/tree/Nautilus_View_tree.server.in.in +++ b/components/tree/Nautilus_View_tree.server.in.in @@ -1,7 +1,7 @@ + type="shlib" location="@BONOBODIR@/libnautilus-tree-view"> diff --git a/cut-n-paste-code/libegg/Makefile.am b/cut-n-paste-code/libegg/Makefile.am index 5a357c363..cf33c608b 100644 --- a/cut-n-paste-code/libegg/Makefile.am +++ b/cut-n-paste-code/libegg/Makefile.am @@ -18,8 +18,6 @@ EGG_RECENT_FILES = \ egg-recent-model.h \ egg-recent-item.c \ egg-recent-item.h \ - egg-recent-vfs-utils.c \ - egg-recent-vfs-utils.h \ $(NULL) EGG_TREE_DND_FILES = \ diff --git a/cut-n-paste-code/libegg/egg-recent-item.c b/cut-n-paste-code/libegg/egg-recent-item.c index 4b42aca75..ee4a248ad 100644 --- a/cut-n-paste-code/libegg/egg-recent-item.c +++ b/cut-n-paste-code/libegg/egg-recent-item.c @@ -25,7 +25,6 @@ #include #include #include "egg-recent-item.h" -#include "egg-recent-vfs-utils.h" @@ -187,7 +186,7 @@ egg_recent_item_set_uri (EggRecentItem *item, const gchar *uri) /* if G_BROKEN_FILENAMES is not set, this should succede */ if (g_utf8_validate (uri, -1, NULL)) { - item->uri = egg_recent_vfs_make_uri_from_input (uri); + item->uri = gnome_vfs_make_uri_from_input (uri); } else { utf8_uri = g_filename_to_utf8 (uri, -1, NULL, NULL, NULL); @@ -197,7 +196,7 @@ egg_recent_item_set_uri (EggRecentItem *item, const gchar *uri) } if (g_utf8_validate (utf8_uri, -1, NULL)) { - item->uri = egg_recent_vfs_make_uri_from_input (utf8_uri); + item->uri = gnome_vfs_make_uri_from_input (utf8_uri); } else { g_free (utf8_uri); return FALSE; @@ -233,7 +232,7 @@ egg_recent_item_get_uri_utf8 (const EggRecentItem *item) gchar * egg_recent_item_get_uri_for_display (const EggRecentItem *item) { - return egg_recent_vfs_format_uri_for_display (item->uri); + return gnome_vfs_format_uri_for_display (item->uri); } void diff --git a/cut-n-paste-code/libegg/egg-recent-model.c b/cut-n-paste-code/libegg/egg-recent-model.c index 2f6ee5498..fa4f3d862 100644 --- a/cut-n-paste-code/libegg/egg-recent-model.c +++ b/cut-n-paste-code/libegg/egg-recent-model.c @@ -36,7 +36,6 @@ #include #include "egg-recent-model.h" #include "egg-recent-item.h" -#include "egg-recent-vfs-utils.h" #define EGG_RECENT_MODEL_FILE_PATH "/.recently-used" #define EGG_RECENT_MODEL_BUFFER_SIZE 8192 @@ -261,7 +260,7 @@ egg_recent_model_update_item (GList *items, EggRecentItem *upd_item) while (tmp) { EggRecentItem *item = tmp->data; - if (egg_recent_vfs_uris_match (egg_recent_item_peek_uri (item), uri)) { + if (gnome_vfs_uris_match (egg_recent_item_peek_uri (item), uri)) { egg_recent_item_set_timestamp (item, (time_t) -1); egg_recent_model_add_new_groups (item, upd_item); @@ -559,7 +558,7 @@ egg_recent_model_filter (EggRecentModel *model, model->priv->scheme_filter_values != NULL) { gchar *scheme; - scheme = egg_recent_vfs_get_uri_scheme (uri); + scheme = gnome_vfs_get_uri_scheme (uri); if (egg_recent_model_string_match (model->priv->scheme_filter_values, scheme)) @@ -586,6 +585,7 @@ egg_recent_model_filter (EggRecentModel *model, +#if 0 static void egg_recent_model_monitor_list_cb (GnomeVFSMonitorHandle *handle, const gchar *monitor_uri, @@ -637,7 +637,7 @@ egg_recent_model_monitor_list (EggRecentModel *model, GList *list) g_free (uri); } } - +#endif static gboolean @@ -718,8 +718,10 @@ egg_recent_model_read (EggRecentModel *model, FILE *file) content = egg_recent_model_read_raw (model, file); - if (strlen (content) <= 0) + if (strlen (content) <= 0) { + g_free (content); return NULL; + } parse_info_init (&info); @@ -1212,20 +1214,26 @@ egg_recent_model_add_full (EggRecentModel * model, EggRecentItem *item) GList *list = NULL; gboolean ret = FALSE; gboolean updated = FALSE; + char *uri; time_t t; - gchar *uri; g_return_val_if_fail (model != NULL, FALSE); g_return_val_if_fail (EGG_IS_RECENT_MODEL (model), FALSE); + uri = egg_recent_item_get_uri (item); + if (strncmp (uri, "recent-files://", strlen ("recent-files://")) == 0) { + g_free (uri); + return FALSE; + } else { + g_free (uri); + } + file = egg_recent_model_open_file (model); g_return_val_if_fail (file != NULL, FALSE); time (&t); egg_recent_item_set_timestamp (item, t); - uri = egg_recent_item_get_uri (item); - if (egg_recent_model_lock_file (file)) { /* read existing stuff */ @@ -1384,14 +1392,15 @@ egg_recent_model_get_list (EggRecentModel *model) GList *list=NULL; file = egg_recent_model_open_file (model); - g_return_val_if_fail (file != NULL, FALSE); + g_return_val_if_fail (file != NULL, NULL); if (egg_recent_model_lock_file (file)) { list = egg_recent_model_read (model, file); } else { g_warning ("Failed to lock: %s", strerror (errno)); - return FALSE; + fclose (file); + return NULL; } if (!egg_recent_model_unlock_file (file)) @@ -1629,7 +1638,7 @@ egg_recent_model_changed (EggRecentModel *model) if (model->priv->limit > 0) { list = egg_recent_model_get_list (model); - egg_recent_model_monitor_list (model, list); + /* egg_recent_model_monitor_list (model, list); */ g_signal_emit (G_OBJECT (model), model_signals[CHANGED], 0, list); diff --git a/cut-n-paste-code/libegg/egg-recent-vfs-utils.c b/cut-n-paste-code/libegg/egg-recent-vfs-utils.c deleted file mode 100644 index 51083dd96..000000000 --- a/cut-n-paste-code/libegg/egg-recent-vfs-utils.c +++ /dev/null @@ -1,570 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ - -/* gnome-vfs-utils.c - Utility gnome-vfs methods. Will use gnome-vfs - HEAD in time. - - Copyright (C) 1999 Free Software Foundation - Copyright (C) 2000, 2001 Eazel, Inc. - - The Gnome Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Gnome Library 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 Library General Public - License along with the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - - Authors: Ettore Perazzoli - John Sullivan - Darin Adler -*/ - -#include - -#include "egg-recent-vfs-utils.h" - -#include -#include -#include - -#ifdef ENABLE_NLS -#include - -#include -#define _(String) gettext(String) - -#ifdef gettext_noop -#define N_(String) gettext_noop(String) -#else -#define N_(String) (String) -#endif -#else /* NLS is disabled */ -#define _(String) (String) -#define N_(String) (String) -#define textdomain(String) (String) -#define gettext(String) (String) -#define dgettext(Domain,String) (String) -#define dcgettext(Domain,String,Type) (String) -#define bindtextdomain(Domain,Directory) (Domain) -#endif - -static char * -make_valid_utf8 (const char *name) -{ - GString *string; - const char *remainder, *invalid; - int remaining_bytes, valid_bytes; - - string = NULL; - remainder = name; - remaining_bytes = strlen (name); - - while (remaining_bytes != 0) { - if (g_utf8_validate (remainder, remaining_bytes, &invalid)) { - break; - } - valid_bytes = invalid - remainder; - - if (string == NULL) { - string = g_string_sized_new (remaining_bytes); - } - g_string_append_len (string, remainder, valid_bytes); - g_string_append_c (string, '?'); - - remaining_bytes -= valid_bytes + 1; - remainder = invalid + 1; - } - - if (string == NULL) { - return g_strdup (name); - } - - g_string_append (string, remainder); - g_string_append (string, _(" (invalid Unicode)")); - g_assert (g_utf8_validate (string->str, -1, NULL)); - - return g_string_free (string, FALSE); -} - -static gboolean -istr_has_prefix (const char *haystack, const char *needle) -{ - const char *h, *n; - char hc, nc; - - /* Eat one character at a time. */ - h = haystack == NULL ? "" : haystack; - n = needle == NULL ? "" : needle; - do { - if (*n == '\0') { - return TRUE; - } - if (*h == '\0') { - return FALSE; - } - hc = *h++; - nc = *n++; - hc = g_ascii_tolower (hc); - nc = g_ascii_tolower (nc); - } while (hc == nc); - return FALSE; -} - -static gboolean -str_has_prefix (const char *haystack, const char *needle) -{ - const char *h, *n; - - /* Eat one character at a time. */ - h = haystack == NULL ? "" : haystack; - n = needle == NULL ? "" : needle; - do { - if (*n == '\0') { - return TRUE; - } - if (*h == '\0') { - return FALSE; - } - } while (*h++ == *n++); - return FALSE; -} - -static gboolean -uri_is_local_scheme (const char *uri) -{ - gboolean is_local_scheme; - char *temp_scheme; - int i; - char *local_schemes[] = {"file:", "help:", "ghelp:", "gnome-help:", - "trash:", "man:", "info:", - "hardware:", "search:", "pipe:", - "gnome-trash:", NULL}; - - is_local_scheme = FALSE; - for (temp_scheme = *local_schemes, i = 0; temp_scheme != NULL; i++, temp_scheme = local_schemes[i]) { - is_local_scheme = istr_has_prefix (uri, temp_scheme); - if (is_local_scheme) { - break; - } - } - - return is_local_scheme; -} - -static char * -handle_trailing_slashes (const char *uri) -{ - char *temp, *uri_copy; - gboolean previous_char_is_column, previous_chars_are_slashes_without_column; - gboolean previous_chars_are_slashes_with_column; - gboolean is_local_scheme; - - g_assert (uri != NULL); - - uri_copy = g_strdup (uri); - if (strlen (uri_copy) <= 2) { - return uri_copy; - } - - is_local_scheme = uri_is_local_scheme (uri); - - previous_char_is_column = FALSE; - previous_chars_are_slashes_without_column = FALSE; - previous_chars_are_slashes_with_column = FALSE; - - /* remove multiple trailing slashes */ - for (temp = uri_copy; *temp != '\0'; temp++) { - if (*temp == '/' && !previous_char_is_column) { - previous_chars_are_slashes_without_column = TRUE; - } else if (*temp == '/' && previous_char_is_column) { - previous_chars_are_slashes_without_column = FALSE; - previous_char_is_column = TRUE; - previous_chars_are_slashes_with_column = TRUE; - } else { - previous_chars_are_slashes_without_column = FALSE; - previous_char_is_column = FALSE; - previous_chars_are_slashes_with_column = FALSE; - } - - if (*temp == ':') { - previous_char_is_column = TRUE; - } - } - - if (*temp == '\0' && previous_chars_are_slashes_without_column) { - if (is_local_scheme) { - /* go back till you remove them all. */ - for (temp--; *(temp) == '/'; temp--) { - *temp = '\0'; - } - } else { - /* go back till you remove them all but one. */ - for (temp--; *(temp - 1) == '/'; temp--) { - *temp = '\0'; - } - } - } - - if (*temp == '\0' && previous_chars_are_slashes_with_column) { - /* go back till you remove them all but three. */ - for (temp--; *(temp - 3) != ':' && *(temp - 2) != ':' && *(temp - 1) != ':'; temp--) { - *temp = '\0'; - } - } - - - return uri_copy; -} - -static char * -make_uri_canonical (const char *uri) -{ - char *canonical_uri, *old_uri, *p; - gboolean relative_uri; - - relative_uri = FALSE; - - if (uri == NULL) { - return NULL; - } - - /* FIXME bugzilla.eazel.com 648: - * This currently ignores the issue of two uris that are not identical but point - * to the same data except for the specific cases of trailing '/' characters, - * file:/ and file:///, and "lack of file:". - */ - - canonical_uri = handle_trailing_slashes (uri); - - /* Note: In some cases, a trailing slash means nothing, and can - * be considered equivalent to no trailing slash. But this is - * not true in every case; specifically not for web addresses passed - * to a web-browser. So we don't have the trailing-slash-equivalence - * logic here, but we do use that logic in EelDirectory where - * the rules are more strict. - */ - - /* Add file: if there is no scheme. */ - if (strchr (canonical_uri, ':') == NULL) { - old_uri = canonical_uri; - - if (old_uri[0] != '/') { - /* FIXME bugzilla.eazel.com 5069: - * bandaid alert. Is this really the right thing to do? - * - * We got what really is a relative path. We do a little bit of - * a stretch here and assume it was meant to be a cryptic absolute path, - * and convert it to one. Since we can't call gnome_vfs_uri_new and - * gnome_vfs_uri_to_string to do the right make-canonical conversion, - * we have to do it ourselves. - */ - relative_uri = TRUE; - canonical_uri = gnome_vfs_make_path_name_canonical (old_uri); - g_free (old_uri); - old_uri = canonical_uri; - canonical_uri = g_strconcat ("file:///", old_uri, NULL); - } else { - canonical_uri = g_strconcat ("file:", old_uri, NULL); - } - g_free (old_uri); - } - - /* Lower-case the scheme. */ - for (p = canonical_uri; *p != ':'; p++) { - g_assert (*p != '\0'); - *p = g_ascii_tolower (*p); - } - - if (!relative_uri) { - old_uri = canonical_uri; - canonical_uri = gnome_vfs_make_uri_canonical (canonical_uri); - if (canonical_uri != NULL) { - g_free (old_uri); - } else { - canonical_uri = old_uri; - } - } - - /* FIXME bugzilla.eazel.com 2802: - * Work around gnome-vfs's desire to convert file:foo into file://foo - * by converting to file:///foo here. When you remove this, check that - * typing "foo" into location bar does not crash and returns an error - * rather than displaying the contents of / - */ - if (str_has_prefix (canonical_uri, "file://") - && !str_has_prefix (canonical_uri, "file:///")) { - old_uri = canonical_uri; - canonical_uri = g_strconcat ("file:/", old_uri + 5, NULL); - g_free (old_uri); - } - - return canonical_uri; -} - -static char * -format_uri_for_display (const char *uri, gboolean filenames_are_locale_encoded) -{ - char *canonical_uri, *path, *utf8_path; - - g_return_val_if_fail (uri != NULL, g_strdup ("")); - - canonical_uri = make_uri_canonical (uri); - - /* If there's no fragment and it's a local path. */ - path = gnome_vfs_get_local_path_from_uri (canonical_uri); - - if (path != NULL) { - if (filenames_are_locale_encoded) { - utf8_path = g_locale_to_utf8 (path, -1, NULL, NULL, NULL); - if (utf8_path) { - g_free (canonical_uri); - g_free (path); - return utf8_path; - } - } else if (g_utf8_validate (path, -1, NULL)) { - g_free (canonical_uri); - return path; - } - } - - if (canonical_uri && !g_utf8_validate (canonical_uri, -1, NULL)) { - utf8_path = make_valid_utf8 (canonical_uri); - g_free (canonical_uri); - canonical_uri = utf8_path; - } - - g_free (path); - return canonical_uri; -} - -char * -egg_recent_vfs_format_uri_for_display (const char *uri) -{ - static gboolean broken_filenames; - - broken_filenames = g_getenv ("G_BROKEN_FILENAMES") != NULL; - - return format_uri_for_display (uri, broken_filenames); -} - -static gboolean -is_valid_scheme_character (char c) -{ - return g_ascii_isalnum (c) || c == '+' || c == '-' || c == '.'; -} - -static gboolean -has_valid_scheme (const char *uri) -{ - const char *p; - - p = uri; - - if (!is_valid_scheme_character (*p)) { - return FALSE; - } - - do { - p++; - } while (is_valid_scheme_character (*p)); - - return *p == ':'; -} - -static char * -escape_high_chars (const guchar *string) -{ - char *result; - const guchar *scanner; - guchar *result_scanner; - int escape_count; - static const gchar hex[16] = "0123456789ABCDEF"; - -#define ACCEPTABLE(a) ((a)>=32 && (a)<128) - - escape_count = 0; - - if (string == NULL) { - return NULL; - } - - for (scanner = string; *scanner != '\0'; scanner++) { - if (!ACCEPTABLE(*scanner)) { - escape_count++; - } - } - - if (escape_count == 0) { - return g_strdup (string); - } - - /* allocate two extra characters for every character that - * needs escaping and space for a trailing zero - */ - result = g_malloc (scanner - string + escape_count * 2 + 1); - for (scanner = string, result_scanner = result; *scanner != '\0'; scanner++) { - if (!ACCEPTABLE(*scanner)) { - *result_scanner++ = '%'; - *result_scanner++ = hex[*scanner >> 4]; - *result_scanner++ = hex[*scanner & 15]; - - } else { - *result_scanner++ = *scanner; - } - } - - *result_scanner = '\0'; - - return result; -} - -static char * -make_uri_from_input_internal (const char *text, - gboolean filenames_are_locale_encoded, - gboolean strip_trailing_whitespace) -{ - char *stripped, *path, *uri, *locale_path, *filesystem_path, *escaped; - - g_return_val_if_fail (text != NULL, g_strdup ("")); - - /* Strip off leading whitespaces (since they can't be part of a valid - uri). Only strip off trailing whitespaces when requested since - they might be part of a valid uri. - */ - if (strip_trailing_whitespace) { - stripped = g_strstrip (g_strdup (text)); - } else { - stripped = g_strchug (g_strdup (text)); - } - - switch (stripped[0]) { - case '\0': - uri = g_strdup (""); - break; - case '/': - if (filenames_are_locale_encoded) { - GError *error = NULL; - locale_path = g_locale_from_utf8 (stripped, -1, NULL, NULL, &error); - if (locale_path != NULL) { - uri = gnome_vfs_get_uri_from_local_path (locale_path); - g_free (locale_path); - } else { - /* We couldn't convert to the locale. */ - /* FIXME: We should probably give a user-visible error here. */ - uri = g_strdup(""); - } - } else { - uri = gnome_vfs_get_uri_from_local_path (stripped); - } - break; - case '~': - if (filenames_are_locale_encoded) { - filesystem_path = g_locale_from_utf8 (stripped, -1, NULL, NULL, NULL); - } else { - filesystem_path = g_strdup (stripped); - } - /* deliberately falling into default case on fail */ - if (filesystem_path != NULL) { - path = gnome_vfs_expand_initial_tilde (filesystem_path); - g_free (filesystem_path); - if (*path == '/') { - uri = gnome_vfs_get_uri_from_local_path (path); - g_free (path); - break; - } - g_free (path); - } - /* don't insert break here, read above comment */ - default: - if (has_valid_scheme (stripped)) { - uri = escape_high_chars (stripped); - } else { - escaped = escape_high_chars (stripped); - uri = g_strconcat ("http://", escaped, NULL); - g_free (escaped); - } - } - - g_free (stripped); - - return uri; - -} - -char * -egg_recent_vfs_make_uri_from_input (const char *uri) -{ - static gboolean broken_filenames; - - broken_filenames = g_getenv ("G_BROKEN_FILENAMES") != NULL; - - return make_uri_from_input_internal (uri, broken_filenames, TRUE); -} - -static char * -make_uri_canonical_strip_fragment (const char *uri) -{ - const char *fragment; - char *without_fragment, *canonical; - - fragment = strchr (uri, '#'); - if (fragment == NULL) { - return make_uri_canonical (uri); - } - - without_fragment = g_strndup (uri, fragment - uri); - canonical = make_uri_canonical (without_fragment); - g_free (without_fragment); - return canonical; -} - -static gboolean -uris_match (const char *uri_1, const char *uri_2, gboolean ignore_fragments) -{ - char *canonical_1, *canonical_2; - gboolean result; - - if (ignore_fragments) { - canonical_1 = make_uri_canonical_strip_fragment (uri_1); - canonical_2 = make_uri_canonical_strip_fragment (uri_2); - } else { - canonical_1 = make_uri_canonical (uri_1); - canonical_2 = make_uri_canonical (uri_2); - } - - result = strcmp (canonical_1, canonical_2) == 0; - - g_free (canonical_1); - g_free (canonical_2); - - return result; -} - -gboolean -egg_recent_vfs_uris_match (const char *uri_1, const char *uri_2) -{ - return uris_match (uri_1, uri_2, FALSE); -} - -char * -egg_recent_vfs_get_uri_scheme (const char *uri) -{ - char *colon; - - g_return_val_if_fail (uri != NULL, NULL); - - colon = strchr (uri, ':'); - - if (colon == NULL) { - return NULL; - } - - return g_strndup (uri, colon - uri); -} diff --git a/cut-n-paste-code/libegg/egg-recent-vfs-utils.h b/cut-n-paste-code/libegg/egg-recent-vfs-utils.h deleted file mode 100644 index 619b25b49..000000000 --- a/cut-n-paste-code/libegg/egg-recent-vfs-utils.h +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* gnome-vfs-utils.h - Utility gnome-vfs methods. Will use gnome-vfs - HEAD in time. - - Copyright (C) 1999 Free Software Foundation - Copyright (C) 2000 Eazel, Inc. - - The Gnome Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The Gnome Library 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 Library General Public - License along with the Gnome Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - - Authors: Ettore Perazzoli - John Sullivan -*/ - -#ifndef EGG_RECENT_VFS_UTILS_H -#define EGG_RECENT_VFS_UTILS_H - -#include - -G_BEGIN_DECLS - -char *egg_recent_vfs_format_uri_for_display (const char *uri); -char *egg_recent_vfs_make_uri_from_input (const char *uri); -gboolean egg_recent_vfs_uris_match (const char *uri_1, - const char *uri_2); -char *egg_recent_vfs_get_uri_scheme (const char *uri); - -G_END_DECLS - -#endif /* GNOME_VFS_UTILS_H */ diff --git a/cut-n-paste-code/libegg/egg-screen-exec.c b/cut-n-paste-code/libegg/egg-screen-exec.c index 94a068e36..2a96e8c8b 100644 --- a/cut-n-paste-code/libegg/egg-screen-exec.c +++ b/cut-n-paste-code/libegg/egg-screen-exec.c @@ -96,25 +96,26 @@ char ** egg_screen_exec_environment (GdkScreen *screen) { char **retval = NULL; - int i; + int i, env_len; #ifdef HAVE_GTK_MULTIHEAD int display_index = -1; g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL); - for (i = 0; environ [i]; i++) - if (!strncmp (environ [i], "DISPLAY", 7)) - display_index = i; + for (env_len = 0; environ [env_len]; env_len++) + if (!strncmp (environ [env_len], "DISPLAY", 7)) + display_index = env_len; if (display_index == -1) - display_index = i++; + display_index = env_len++; #else - for (i = 0; environ [i]; i++); + for (env_len = 0; environ [env_len]; env_len++); #endif - retval = g_new (char *, i + 1); + retval = g_new (char *, env_len + 1); + retval [env_len] = NULL; - for (i = 0; environ [i]; i++) + for (i = 0; i < env_len; i++) #ifdef HAVE_GTK_MULTIHEAD if (i == display_index) retval [i] = egg_screen_exec_display_string (screen); @@ -122,7 +123,7 @@ egg_screen_exec_environment (GdkScreen *screen) #endif retval [i] = g_strdup (environ [i]); - retval [i] = NULL; + g_assert (i == env_len); return retval; } @@ -247,7 +248,7 @@ egg_screen_execute_command_line_async (GdkScreen *screen, if (gdk_screen_get_default () != screen) envp = egg_screen_exec_environment (screen); - retval = g_spawn_async (g_get_home_dir (), + retval = g_spawn_async (NULL, argv, envp, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, error); g_strfreev (argv); diff --git a/docs/key_mouse_navigation.txt b/docs/key_mouse_navigation.txt index d051510e2..1f523a493 100644 --- a/docs/key_mouse_navigation.txt +++ b/docs/key_mouse_navigation.txt @@ -52,7 +52,7 @@ Alt Up - go up a directory Alt Down - enter directory / activate selection Shift-F10 bring up context menu for selection, or the directory context menu if nothing is selected -Shift-F9 bring up context menu for directory +Ctrl-F10 bring up context menu for directory Other key presses are used for typeahead search diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index b19d00edb..ecf29328a 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -3324,14 +3324,11 @@ key_press_event (GtkWidget *widget, undo_stretching (container); handled = TRUE; break; - case GDK_F9: - if (event->state & GDK_SHIFT_MASK) { + case GDK_F10: + if (event->state & GDK_CONTROL_MASK) { handled = handle_popups (container, event, "context_click_background"); - } - break; - case GDK_F10: - if (event->state & GDK_SHIFT_MASK) { + } else if (event->state & GDK_SHIFT_MASK) { if (has_selection (container)) { handled = handle_popups (container, event, "context_click_selection"); diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c index 11fc141ab..8fc15e76d 100644 --- a/src/file-manager/fm-desktop-icon-view.c +++ b/src/file-manager/fm-desktop-icon-view.c @@ -875,12 +875,14 @@ volume_ops_callback (BonoboUIComponent *component, gpointer data, const char *ve file = NAUTILUS_FILE (selection->data); - if (!nautilus_file_is_local (file)) { + uri = nautilus_file_get_uri (file); + if (!eel_str_has_prefix (uri, "file:")) { + /* Don't allow volume ops on remote uris */ + g_free (uri); nautilus_file_list_free (selection); return; } - - uri = nautilus_file_get_uri (file); + mount_uri = nautilus_link_local_get_link_uri (uri); mount_path = gnome_vfs_get_local_path_from_uri (mount_uri); g_free (uri); diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c index 59d16a27d..5bb774411 100644 --- a/src/file-manager/fm-list-view.c +++ b/src/file-manager/fm-list-view.c @@ -507,13 +507,10 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat view = FM_DIRECTORY_VIEW (callback_data); switch (event->keyval) { - case GDK_F9: - if (event->state & GDK_SHIFT_MASK) { - fm_directory_view_pop_up_background_context_menu (view, &button_event); - } - break; case GDK_F10: - if (event->state & GDK_SHIFT_MASK) { + if (event->state & GDK_CONTROL_MASK) { + fm_directory_view_pop_up_background_context_menu (view, &button_event); + } else if (event->state & GDK_SHIFT_MASK) { if (tree_view_has_selection (GTK_TREE_VIEW (widget))) { fm_directory_view_pop_up_selection_context_menu (view, &button_event); } else { diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 661cb0d3f..593e3de9b 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -1764,8 +1764,7 @@ create_emblems_page (FMPropertiesWindow *window) NautilusFile *file; GList *icons, *l; - - file = window->details->target_file; + file = window->details->original_file; /* The emblems wrapped table */ scroller = eel_scrolled_wrap_table_new (TRUE, &emblems_table); diff --git a/src/nautilus-main.c b/src/nautilus-main.c index 8895b1931..a752d9b61 100644 --- a/src/nautilus-main.c +++ b/src/nautilus-main.c @@ -141,25 +141,36 @@ main (int argc, char *argv[]) char **argv_copy; GnomeProgram *program; GValue context_as_value = { 0 }; + int i; struct poptOption options[] = { #ifndef NAUTILUS_OMIT_SELF_CHECK - { "check", 'c', POPT_ARG_NONE, &perform_self_check, 0, + { "check", 'c', POPT_ARG_NONE, NULL, 0, N_("Perform a quick set of self-check tests."), NULL }, #endif - { "geometry", 'g', POPT_ARG_STRING, &geometry, 0, + { "geometry", 'g', POPT_ARG_STRING, NULL, 0, N_("Create the initial window with the given geometry."), N_("GEOMETRY") }, - { "no-default-window", 'n', POPT_ARG_NONE, &no_default_window, 0, + { "no-default-window", 'n', POPT_ARG_NONE, NULL, 0, N_("Only create windows for explicitly specified URIs."), NULL }, - { "no-desktop", '\0', POPT_ARG_NONE, &no_desktop, 0, + { "no-desktop", '\0', POPT_ARG_NONE, NULL, 0, N_("Do not manage the desktop (ignore the preference set in the preferences dialog)."), NULL }, - { "quit", 'q', POPT_ARG_NONE, &kill_shell, 0, + { "quit", 'q', POPT_ARG_NONE, NULL, 0, N_("Quit Nautilus."), NULL }, - { "restart", '\0', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN, &restart_shell, 0, + { "restart", '\0', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN, NULL, 0, N_("Restart Nautilus."), NULL }, { NULL, '\0', 0, NULL, 0, NULL, NULL } }; + i = 0; +#ifndef NAUTILUS_OMIT_SELF_CHECK + options[i++].arg = &perform_self_check; +#endif + options[i++].arg = &geometry; + options[i++].arg = &no_default_window; + options[i++].arg = &no_desktop; + options[i++].arg = &kill_shell; + options[i++].arg = &restart_shell; + if (g_getenv ("NAUTILUS_DEBUG") != NULL) { eel_make_warnings_and_criticals_stop_in_debugger (); } diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c index 5c40a3a69..3f0e67582 100644 --- a/src/nautilus-navigation-window-menus.c +++ b/src/nautilus-navigation-window-menus.c @@ -538,7 +538,7 @@ view_menu_zoom_normal_callback (BonoboUIComponent *component, gpointer user_data, const char *verb) { - nautilus_window_zoom_to_fit (NAUTILUS_WINDOW (user_data)); + nautilus_window_zoom_to_level (NAUTILUS_WINDOW (user_data), 1.0); } static void diff --git a/src/nautilus-server-connect.c b/src/nautilus-server-connect.c index d09162d2f..2a458ef80 100644 --- a/src/nautilus-server-connect.c +++ b/src/nautilus-server-connect.c @@ -122,7 +122,9 @@ gnome_vfs_make_directory_with_parents (const gchar * text_uri, guint perm) static void browse (char *uri) { - char *argv[3] = {"nautilus", uri, NULL}; + char *argv[3] = {"nautilus", NULL, NULL}; + + argv[1] = uri; D (("browse (%s)", uri)); if (gnome_execute_async (g_get_home_dir (), 2, argv) < 0) diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c index 5c40a3a69..3f0e67582 100644 --- a/src/nautilus-window-menus.c +++ b/src/nautilus-window-menus.c @@ -538,7 +538,7 @@ view_menu_zoom_normal_callback (BonoboUIComponent *component, gpointer user_data, const char *verb) { - nautilus_window_zoom_to_fit (NAUTILUS_WINDOW (user_data)); + nautilus_window_zoom_to_level (NAUTILUS_WINDOW (user_data), 1.0); } static void -- cgit v1.2.1