From d90f8124e6dd2cec64f8db75fd38e1b3dc3d99fe Mon Sep 17 00:00:00 2001 From: Darin Adler Date: Wed, 31 May 2000 23:27:26 +0000 Subject: Fixed a bug where I accidentally treated root as "unable to access * libnautilus-extensions/nautilus-file.c: (nautilus_file_denies_access_permission): Fixed a bug where I accidentally treated root as "unable to access anything" instead of "able to access everything". * src/nautilus-sidebar-tabs.h: Fixed file name in include guard. I'll probably need to write a script to find the broken ones. * src/nautilus-window-manage-views.c: (handle_unreadable_location): Fixed a bug where we unref's a file object before using it. * src/nautilus-window-private.h: Got rid of a straggler prototype for a nonexistent function. * RENAMING: Some are done. --- ChangeLog | 18 ++++++++++++++++++ RENAMING | 6 +++--- libnautilus-extensions/nautilus-file.c | 10 +++++----- libnautilus-private/nautilus-file.c | 10 +++++----- src/nautilus-sidebar-tabs.h | 6 +++--- src/nautilus-window-manage-views.c | 13 +++++++------ src/nautilus-window-private.h | 1 - 7 files changed, 41 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb20e1c04..2b7bf0c08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2000-05-31 Darin Adler + + * libnautilus-extensions/nautilus-file.c: + (nautilus_file_denies_access_permission): Fixed a bug where I + accidentally treated root as "unable to access anything" instead + of "able to access everything". + + * src/nautilus-sidebar-tabs.h: Fixed file name in include guard. + I'll probably need to write a script to find the broken ones. + + * src/nautilus-window-manage-views.c: (handle_unreadable_location): + Fixed a bug where we unref's a file object before using it. + + * src/nautilus-window-private.h: Got rid of a straggler prototype + for a nonexistent function. + + * RENAMING: Some are done. + 2000-05-31 Ramiro Estrugo * src/nautilus-sidebar-tabs.c: diff --git a/RENAMING b/RENAMING index 3632cfbcb..eb11cdb03 100644 --- a/RENAMING +++ b/RENAMING @@ -11,14 +11,14 @@ components/websearch/ntl-web-search.c -> components/websearch/nautilus-web-searc ---------------------------- classes and other data types ---------------------------- -*IndexPanel* -> *Sidebar* -*MetaView* -> *SidebarPanel* +NautilusIndexTabs -> NautilusSidebarTabs +NautilusIndexTitle -> NautilusSidebarTitle NavigationRequestInfo -> NavigationRequest +NautilusApp -> NautilusApplication NavigationInfo -> Location SelectionInfo -> Selection SelectionRequestInfo -> SelectionRequest StatusRequestInfo -> Status (or StatusRequest) -NautilusApp -> NautilusApplication -------------- function names diff --git a/libnautilus-extensions/nautilus-file.c b/libnautilus-extensions/nautilus-file.c index 7ad8c2593..dab9340a8 100644 --- a/libnautilus-extensions/nautilus-file.c +++ b/libnautilus-extensions/nautilus-file.c @@ -322,13 +322,13 @@ nautilus_file_denies_access_permission (NautilusFile *file, g_assert (NAUTILUS_IS_FILE (file)); - /* Once the file is gone, you can't do much of anything. */ + /* Once the file is gone, you are denied permission to do anything. */ if (nautilus_file_is_gone (file)) { return TRUE; } /* File system does not provide permission bits. - * Can't determine specific permissions, so return FALSE. + * Can't determine specific permissions, do not deny permission at all. */ if (!nautilus_file_can_get_permissions (file)) { return FALSE; @@ -337,9 +337,9 @@ nautilus_file_denies_access_permission (NautilusFile *file, /* Check the user. */ user_id = geteuid (); - /* Root can do anything. */ + /* Root is not forbidden to do anything. */ if (user_id == 0) { - return TRUE; + return FALSE; } /* File owner's access is governed by the owner bits. */ @@ -386,7 +386,7 @@ nautilus_file_can_read (NautilusFile *file) g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE); return !nautilus_file_denies_access_permission - (file, + (file, GNOME_VFS_PERM_USER_READ, GNOME_VFS_PERM_GROUP_READ, GNOME_VFS_PERM_OTHER_READ); diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c index 7ad8c2593..dab9340a8 100644 --- a/libnautilus-private/nautilus-file.c +++ b/libnautilus-private/nautilus-file.c @@ -322,13 +322,13 @@ nautilus_file_denies_access_permission (NautilusFile *file, g_assert (NAUTILUS_IS_FILE (file)); - /* Once the file is gone, you can't do much of anything. */ + /* Once the file is gone, you are denied permission to do anything. */ if (nautilus_file_is_gone (file)) { return TRUE; } /* File system does not provide permission bits. - * Can't determine specific permissions, so return FALSE. + * Can't determine specific permissions, do not deny permission at all. */ if (!nautilus_file_can_get_permissions (file)) { return FALSE; @@ -337,9 +337,9 @@ nautilus_file_denies_access_permission (NautilusFile *file, /* Check the user. */ user_id = geteuid (); - /* Root can do anything. */ + /* Root is not forbidden to do anything. */ if (user_id == 0) { - return TRUE; + return FALSE; } /* File owner's access is governed by the owner bits. */ @@ -386,7 +386,7 @@ nautilus_file_can_read (NautilusFile *file) g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE); return !nautilus_file_denies_access_permission - (file, + (file, GNOME_VFS_PERM_USER_READ, GNOME_VFS_PERM_GROUP_READ, GNOME_VFS_PERM_OTHER_READ); diff --git a/src/nautilus-sidebar-tabs.h b/src/nautilus-sidebar-tabs.h index fc2e4b39b..b8adaab51 100644 --- a/src/nautilus-sidebar-tabs.h +++ b/src/nautilus-sidebar-tabs.h @@ -22,8 +22,8 @@ * This is the header file for the tabs widget for the index panel. */ -#ifndef NAUTILUS_INDEX_TABS_H -#define NAUTILUS_INDEX_TABS_H +#ifndef NAUTILUS_SIDEBAR_TABS_H +#define NAUTILUS_SIDEBAR_TABS_H #include @@ -88,4 +88,4 @@ void nautilus_index_tabs_set_visible (NautilusIndexTabs *index_t } #endif /* __cplusplus */ -#endif /* NAUTILUS_INDEX_TABS_H */ +#endif /* NAUTILUS_SIDEBAR_TABS_H */ diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c index f3df5666e..f2096eee9 100644 --- a/src/nautilus-window-manage-views.c +++ b/src/nautilus-window-manage-views.c @@ -609,7 +609,8 @@ nautilus_window_load_sidebar_panel (NautilusWindow *window, } static gboolean -handle_unreadable_location (NautilusWindow *window, const char *uri) { +handle_unreadable_location (NautilusWindow *window, const char *uri) +{ NautilusFile *file; gboolean unreadable; char *file_name; @@ -625,17 +626,17 @@ handle_unreadable_location (NautilusWindow *window, const char *uri) { } unreadable = !nautilus_file_can_read (file); - nautilus_file_unref (file); if (unreadable) { file_name = nautilus_file_get_name (file); - message = g_strdup_printf (_("You do not have the permissions necessary to view \"%s.\""), file_name); - gtk_widget_show (gnome_error_dialog_parented (message, - GTK_WINDOW (window))); + message = g_strdup_printf (_("You do not have the permissions necessary to view \"%s\"."), file_name); g_free (file_name); + nautilus_error_dialog_parented (message, GTK_WINDOW (window)); g_free (message); } + nautilus_file_unref (file); + return unreadable; } @@ -643,7 +644,7 @@ void nautilus_window_request_location_change (NautilusWindow *window, Nautilus_NavigationRequestInfo *loc, NautilusViewFrame *requesting_view) -{ +{ NautilusWindow *new_window; gboolean create_new_window; diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h index 0e752562b..06316f184 100644 --- a/src/nautilus-window-private.h +++ b/src/nautilus-window-private.h @@ -42,7 +42,6 @@ void nautilus_window_begin_location_change(NautilusWindow *window, NautilusViewFrame *requesting_view, NautilusLocationChangeType type, guint distance); -void nautilus_window_remove_meta_view_real(NautilusWindow *window, NautilusViewFrame *meta_view); void nautilus_window_load_content_view_menu (NautilusWindow *window, NautilusNavigationInfo *ni); NautilusViewFrame *nautilus_window_load_content_view(NautilusWindow *window, const char *iid, -- cgit v1.2.1