summaryrefslogtreecommitdiff
path: root/libnautilus-extensions/nautilus-link.h
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-09-13 18:13:56 +0000
committerDarin Adler <darin@src.gnome.org>2000-09-13 18:13:56 +0000
commita6a23a708e0837f6c09602ca86f74fc5d5767c55 (patch)
treeb33419a29ee4363b4bac0a8e1e948e2cb5e29d7f /libnautilus-extensions/nautilus-link.h
parent705c763022c031ceabacda81adf77d7e960bc39e (diff)
downloadnautilus-a6a23a708e0837f6c09602ca86f74fc5d5767c55.tar.gz
Fixed bugs in Nautilus link management, some other minor problems
I encountered along the way, and did the first cut at a state machine for NautilusViewFrame based on Maciej's design that can mostly replace the super-complicated one for NautilusWindow. * README: We no longer can use the ORBit that comes with HC1.2 with cvs HEAD, since warnings have been fixed in the code generated by the newer ORBit, so fix that line in the README. * libnautilus-extensions/nautilus-directory.c: (nautilus_directory_new): Use the new nautilus_uri_is_trash function to avoid hard-coding incorrect checks for "trash:". (nautilus_directory_copy_move_metadata_key): Make simple fix for empty metadata. This code gets replaced soon anyway. * libnautilus-extensions/nautilus-drag.c: (nautilus_drag_can_accept_item): Simplify code to get rid of illegal sync. I/O. It's OK to assume all NautilusLink objects point to directories for now, and if we make a change to do something fancier later, we have to do it with async. (nautilus_drag_default_drop_action_for_icons): Use the new nautilus_uri_is_trash function to avoid hard-coding incorrect checks for "trash:". * libnautilus-extensions/nautilus-drag.h: Fixed a typo. * libnautilus-extensions/nautilus-file-operations.c: (get_link_name): Fix unintialized variable warning in a simple way that avoids adding too much code. (get_duplicate_name): Fix unintialized variable warning in a simple way that avoids adding too much code. (nautilus_file_operations_copy_move): Use the new nautilus_uri_is_trash function to avoid hard-coding incorrect checks for "trash:". * libnautilus-extensions/nautilus-file-utilities.h: * libnautilus-extensions/nautilus-file-utilities.c: (nautilus_uri_is_trash): Add new function to avoid hard-coding incorrect checks for "trash:". (nautilus_make_uri_canonical), Use nautilus_uri_is_trash. * libnautilus-extensions/nautilus-icon-container.h: * libnautilus-extensions/nautilus-icon-container.c: Remove nautilus_icon_container_trash_link_is_in_selection for 3 reasons. It doesn't belong in NautilusIconContainer, the use of it in drag code was incorrectly looking at the destination directory's selection, and it used sync. I/O. * libnautilus-extensions/nautilus-icon-dnd.c: (selection_includes_trash), (nautilus_icon_container_receive_dropped_icons): Changed code to actually check selection -- the old code would check the selection in the target window. Unfortunately this still uses sync. I/O, but that's now covered by bug 3020. * libnautilus-extensions/nautilus-icon-factory.c: (nautilus_icon_factory_get_icon_for_file): Change to use new "local" API for links to make it clear that it uses sync. I/O and only works on local files. * libnautilus-extensions/nautilus-link.h: * libnautilus-extensions/nautilus-link.c: (get_tag), (get_link_type): Added functions to handle tags internally as part of getting rid of tag string values from the API. (nautilus_link_local_create): Changed name to local to emphasize this takes a path not a URI and uses sync. I/O. (local_set_root_property): Share code among the set functions. Before there were a lot of copies of the same code. Also made sure that it does no rewrite of the file if called to set a property to the same value it already has. (nautilus_link_local_set_icon), (nautilus_link_local_set_link_uri), (nautilus_link_local_set_type): Changed name to local to emphasize these take a path not a URI and use sync. I/O. Reimplement by calling local_set_root_property. (nautilus_link_local_get_additional_text): Change name to local and make it take a path instead of a URI to make it clear it uses sync. I/O and doesn't work on remote URIs. (nautilus_link_local_get_image_uri): Change name to local and make it take a path instead of a URI to make it clear it uses sync. I/O and doesn't work on remote URIs. (nautilus_link_local_get_link_uri): Change name to local and make it take a path instead of a URI to make it clear it uses sync. I/O and doesn't work on remote URIs. (nautilus_link_local_get_link_type): Change return value to be the NautilusLinkType enum instead of the type tag string to make the interface cleaner. Also changed name to local to make it clear that it takes a path instead of a URI and uses sync. I/O. (nautilus_link_local_is_volume_link), (nautilus_link_local_is_home_link), (nautilus_link_local_is_trash_link): Changed all three of these to take advantage of the new simpler get_link_type, and changed name to local to make it clear that they take a path instead of a URI and use sync. I/O. * src/file-manager/fm-desktop-icon-view.c: (create_mount_link): Use call by new "local" name. (trash_link_is_selection): Call new "local" function, which now requires a path rather than a URI. (fm_desktop_icon_view_trash_state_changed_callback): Use call by new "local" name. (volume_unmounted_callback): Fix bug where the unmounted callback was using a path as a URI without converting. (find_and_update_home_link): Use call by new "local" name. (place_home_directory): Use call by new "local" name. (find_and_rename_trash_link): Use call by new "local" name. (create_or_rename_trash): Use call by new "local" name. (remove_old_mount_links): Use call by new "local" name. (get_sort_category): Use new get_link_type call and a case statement instead of the old one and a list of string compares. * src/file-manager/fm-directory-view.c: (fm_directory_trash_link_in_selection): Wrote a new version of this function. This is similar to what was in NautilusIconContainer, but the one in there didn't belong there, and didn't really work for other callers. Also, the one in there didn't work at all for the list view case. This new function works for either icon or list view. It still has the limitation that it won't recognize a trash link if it's not local. * src/file-manager/fm-icon-view.c: (get_icon_drop_target_uri_callback): Fix to use new local calls, but still does sync. I/O. Bug 3020 reported about that. (get_icon_text_callback): Changed to use new local calls. Still a problem that it works only locally and uses sync. I/O. Bug 2531 was already reported about that. * src/file-manager/fm-properties-window.c: (get_and_ref_file_to_display): Changed to use new local calls and the simpler link type interface. * src/nautilus-view-frame-private.h: Moved some private declarations here since they are for objects used in one file and declared in another. * src/nautilus-view-frame.h: * src/nautilus-view-frame.c: (nautilus_view_frame_destroy_client): Destroy the "check if view is gone" timeout here; makes more sense than the way it was managed before. (nautilus_view_frame_destroy): Don't destroy the timeout here any more. Also, label was moved into details. (nautilus_view_frame_handle_client_gone): Renamed from handle_client_destroy_2. (view_frame_wait), (view_frame_underway), (view_frame_wait_is_over), (view_frame_loaded), (view_frame_failed): Added functions to implement view frame state machine transitions. (check_if_view_is_gone): Moved code to check if view is gone here; it's now activated automatically without requiring an explicit call to turn it on, since all callers were turning it on at load_client time. (nautilus_view_frame_load_client): Add state management. Moved the code to turn on the object check timeout here. (nautilus_view_frame_load_location): Add state management. (nautilus_view_frame_open_location): Add state management. (nautilus_view_frame_open_location_in_new_window): Add state management. (nautilus_view_frame_open_in_new_window_and_select): Add state management. (nautilus_view_frame_report_location_change): Add state management. (nautilus_view_frame_report_selection_change): Add state management. (nautilus_view_frame_report_status): Add state management. (nautilus_view_frame_report_load_underway): Add state management. (nautilus_view_frame_report_load_progress): Add state management. (nautilus_view_frame_report_load_complete): Add state management. (nautilus_view_frame_report_load_failed): Add state management. (nautilus_view_frame_set_title): Add state management. (nautilus_view_frame_zoom_level_changed): Add state management., (nautilus_view_frame_get_label), (nautilus_view_frame_set_label): Moved label into details structure. * src/nautilus-window-manage-views.c: (nautilus_window_load_sidebar_panel): Fixed code structure a bit (fixes bug 2463) and got rid of call to old nautilus_view_frame_set_active_errors function, which is no longer needed. (nautilus_window_load_content_view): Got rid of call to old nautilus_view_frame_set_active_errors function, which is no longer needed. * src/nautilus-window.c: (window_update_sidebar_panels_from_preferences): Got rid of call to old nautilus_view_frame_set_active_errors function, which is no longer needed.
Diffstat (limited to 'libnautilus-extensions/nautilus-link.h')
-rw-r--r--libnautilus-extensions/nautilus-link.h51
1 files changed, 21 insertions, 30 deletions
diff --git a/libnautilus-extensions/nautilus-link.h b/libnautilus-extensions/nautilus-link.h
index 11e0d9fdd..1f707f0c7 100644
--- a/libnautilus-extensions/nautilus-link.h
+++ b/libnautilus-extensions/nautilus-link.h
@@ -29,85 +29,78 @@
#include "nautilus-file.h"
/* Link types */
-typedef enum
-{
+typedef enum {
NAUTILUS_LINK_GENERIC,
NAUTILUS_LINK_TRASH,
NAUTILUS_LINK_MOUNT,
NAUTILUS_LINK_HOME
} NautilusLinkType;
-/* Link type XML tags */
-#define NAUTILUS_LINK_GENERIC_TAG "Generic Link"
-#define NAUTILUS_LINK_TRASH_TAG "Trash Link"
-#define NAUTILUS_LINK_MOUNT_TAG "Mount Link"
-#define NAUTILUS_LINK_HOME_TAG "Home Link"
-
/* Create a new link file. Takes a path, works locally, and uses sync. I/O.
* Returns TRUE if it succeeds, FALSE if it fails.
*/
-gboolean nautilus_link_create (const char *directory_path,
- const char *name,
- const char *image,
- const char *target_uri,
- NautilusLinkType link_type);
+gboolean nautilus_link_local_create (const char *directory_path,
+ const char *name,
+ const char *image,
+ const char *target_uri,
+ NautilusLinkType type);
/* Change the icon of an existing link file. Takes a path, works
* locally, and uses sync. I/O. Returns TRUE if it succeeds, FALSE if
* it fails. Does not check and see if it is a link file.
*/
-gboolean nautilus_link_set_icon (const char *path,
- const char *icon_name);
+gboolean nautilus_link_local_set_icon (const char *path,
+ const char *icon_name);
/* Specify the type of link that is represented
* Takes a path, works locally, and uses sync. I/O.
* Returns TRUE if it succeeds, FALSE if
* it fails. Does not check and see if it is a link file.
*/
-gboolean nautilus_link_set_type (const char *path,
- const char *type);
+gboolean nautilus_link_local_set_type (const char *path,
+ NautilusLinkType type);
/* Specify the link uri of link that is represented
* Takes a path, works locally, and uses sync. I/O.
* Returns TRUE if it succeeds, FALSE if
* it fails. Does not check and see if it is a link file.
*/
-gboolean nautilus_link_set_link_uri (const char *path,
- const char *uri);
+gboolean nautilus_link_local_set_link_uri (const char *path,
+ const char *uri);
/* Returns additional text to display under the name, NULL if
* none. Despite the fact that it takes a URI parameter, works only if
* the file is local and does sync. I/O.
*/
-char * nautilus_link_get_additional_text (const char *link_file_uri);
+char * nautilus_link_local_get_additional_text (const char *path);
/* Returns the image associated with a link file. Despite the fact
* that it takes a URI parameter, works only if the file is local and
* does sync. I/O on the link, although it does async. on the image
* and caches if the image is remote.
*/
-char * nautilus_link_get_image_uri (const char *link_file_uri);
+char * nautilus_link_local_get_image_uri (const char *path);
/* Returns the link type of a link file.
* Works only if the file is local and does sync. I/O
*/
-char * nautilus_link_get_link_type (const char *uri);
+NautilusLinkType nautilus_link_local_get_link_type (const char *path);
/* Returns if a link is a mount link.
* Works only if the file is local and does sync. I/O
*/
-gboolean nautilus_link_is_volume_link (const char *uri);
+gboolean nautilus_link_local_is_volume_link (const char *path);
/* Returns if a link is a home link.
* Works only if the file is local and does sync. I/O
*/
-gboolean nautilus_link_is_home_link (const char *uri);
+gboolean nautilus_link_local_is_home_link (const char *path);
/* Returns if a link is a trash link.
* Works only if the file is local and does sync. I/O
*/
-gboolean nautilus_link_is_trash_link (const char *uri);
+gboolean nautilus_link_local_is_trash_link (const char *path);
/* Returns the link uri associated with a link file. The first version
@@ -115,10 +108,8 @@ gboolean nautilus_link_is_trash_link (const char *uri);
* fact that it takes a URI parameter. The second version takes the
* contents of a file already in memory.
*/
-char * nautilus_link_get_link_uri (const char *link_file_uri);
-char * nautilus_link_get_link_uri_given_file_contents (const char *link_file_contents,
- int link_file_size);
-
-gboolean nautilus_link_can_accept_drag (const char *path);
+char * nautilus_link_local_get_link_uri (const char *path);
+char * nautilus_link_get_link_uri_given_file_contents (const char *link_file_contents,
+ int link_file_size);
#endif /* NAUTILUS_LINK_H */