[nautilus] Clean up metadata key names now that they are public
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [nautilus] Clean up metadata key names now that they are public
- Date: Tue, 14 Jul 2009 12:06:43 +0000 (UTC)
commit bd6db659cb232d8b8f81a9ada748025aa1d16fff
Author: Alexander Larsson <alexl redhat com>
Date: Tue Jul 14 13:53:05 2009 +0200
Clean up metadata key names now that they are public
Prefix all internal keys with "nautilus-".
Use dash, not underscore as delimitor (this is what gio file attrs use)
Rename "keyword" to "emblems"
Rename "default_component" to "nautilus-default-view"
libnautilus-private/nautilus-file.c | 4 +-
libnautilus-private/nautilus-metadata.c | 4 +-
libnautilus-private/nautilus-metadata.h | 74 +++++++++++++++---------------
src/nautilus-window-manage-views.c | 4 +-
4 files changed, 43 insertions(+), 43 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 6200c75..68a6907 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -6440,7 +6440,7 @@ nautilus_file_get_keywords (NautilusFile *file)
/* Put all the keywords into a list. */
keywords = nautilus_file_get_metadata_list
- (file, NAUTILUS_METADATA_KEY_KEYWORD);
+ (file, NAUTILUS_METADATA_KEY_EMBLEMS);
keywords = g_list_concat (keywords, eel_g_str_list_copy (file->details->extension_emblems));
keywords = g_list_concat (keywords, eel_g_str_list_copy (file->details->pending_extension_emblems));
@@ -6470,7 +6470,7 @@ nautilus_file_set_keywords (NautilusFile *file, GList *keywords)
canonical_keywords = sort_keyword_list_and_remove_duplicates
(g_list_copy (keywords));
nautilus_file_set_metadata_list
- (file, NAUTILUS_METADATA_KEY_KEYWORD, canonical_keywords);
+ (file, NAUTILUS_METADATA_KEY_EMBLEMS, canonical_keywords);
g_list_free (canonical_keywords);
}
diff --git a/libnautilus-private/nautilus-metadata.c b/libnautilus-private/nautilus-metadata.c
index c569aca..cc56094 100644
--- a/libnautilus-private/nautilus-metadata.c
+++ b/libnautilus-private/nautilus-metadata.c
@@ -25,7 +25,7 @@
#include <glib.h>
static char *used_metadata_names[] = {
- NAUTILUS_METADATA_KEY_DEFAULT_COMPONENT,
+ NAUTILUS_METADATA_KEY_DEFAULT_VIEW,
NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR,
NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE,
NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL,
@@ -56,7 +56,7 @@ static char *used_metadata_names[] = {
NAUTILUS_METADATA_KEY_ICON_SCALE,
NAUTILUS_METADATA_KEY_CUSTOM_ICON,
NAUTILUS_METADATA_KEY_SCREEN,
- NAUTILUS_METADATA_KEY_KEYWORD,
+ NAUTILUS_METADATA_KEY_EMBLEMS,
NULL
};
diff --git a/libnautilus-private/nautilus-metadata.h b/libnautilus-private/nautilus-metadata.h
index ffebddb..87aa02c 100644
--- a/libnautilus-private/nautilus-metadata.h
+++ b/libnautilus-private/nautilus-metadata.h
@@ -34,45 +34,45 @@
/* Per-file */
-#define NAUTILUS_METADATA_KEY_DEFAULT_COMPONENT "default_component"
-
-#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR "background_color"
-#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE "background_tile_image"
-
-#define NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL "icon_view_zoom_level"
-#define NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT "icon_view_auto_layout"
-#define NAUTILUS_METADATA_KEY_ICON_VIEW_TIGHTER_LAYOUT "icon_view_tighter_layout"
-#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY "icon_view_sort_by"
-#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED "icon_view_sort_reversed"
-#define NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED "icon_view_keep_aligned"
-#define NAUTILUS_METADATA_KEY_ICON_VIEW_LAYOUT_TIMESTAMP "icon_view_layout_timestamp"
-
-#define NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL "list_view_zoom_level"
-#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN "list_view_sort_column"
-#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED "list_view_sort_reversed"
-#define NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS "list_view_visible_columns"
-#define NAUTILUS_METADATA_KEY_LIST_VIEW_COLUMN_ORDER "list_view_column_order"
-
-#define NAUTILUS_METADATA_KEY_COMPACT_VIEW_ZOOM_LEVEL "compact_view_zoom_level"
-
-#define NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY "window_geometry"
-#define NAUTILUS_METADATA_KEY_WINDOW_SCROLL_POSITION "window_scroll_position"
-#define NAUTILUS_METADATA_KEY_WINDOW_SHOW_HIDDEN_FILES "window_show_hidden_files"
-#define NAUTILUS_METADATA_KEY_WINDOW_MAXIMIZED "window_maximized"
-#define NAUTILUS_METADATA_KEY_WINDOW_STICKY "window_sticky"
-#define NAUTILUS_METADATA_KEY_WINDOW_KEEP_ABOVE "window_keep_above"
-
-#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR "sidebar_background_color"
-#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE "sidebar_background_tile_image"
-#define NAUTILUS_METADATA_KEY_SIDEBAR_BUTTONS "sidebar_buttons"
-
+#define NAUTILUS_METADATA_KEY_DEFAULT_VIEW "nautilus-default-view"
+
+#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_COLOR "folder-background-color"
+#define NAUTILUS_METADATA_KEY_LOCATION_BACKGROUND_IMAGE "folder-background-image"
+
+#define NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL "nautilus-icon-view-zoom-level"
+#define NAUTILUS_METADATA_KEY_ICON_VIEW_AUTO_LAYOUT "nautilus-icon-view-auto-layout"
+#define NAUTILUS_METADATA_KEY_ICON_VIEW_TIGHTER_LAYOUT "nautilus-icon-view-tighter-layout"
+#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_BY "nautilus-icon-view-sort-by"
+#define NAUTILUS_METADATA_KEY_ICON_VIEW_SORT_REVERSED "nautilus-icon-view-sort-reversed"
+#define NAUTILUS_METADATA_KEY_ICON_VIEW_KEEP_ALIGNED "nautilus-icon-view-keep-aligned"
+#define NAUTILUS_METADATA_KEY_ICON_VIEW_LAYOUT_TIMESTAMP "nautilus-icon-view-layout-timestamp"
+
+#define NAUTILUS_METADATA_KEY_LIST_VIEW_ZOOM_LEVEL "nautilus-list-view-zoom-level"
+#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN "nautilus-list-view-sort-column"
+#define NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_REVERSED "nautilus-list-view-sort-reversed"
+#define NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS "nautilus-list-view-visible-columns"
+#define NAUTILUS_METADATA_KEY_LIST_VIEW_COLUMN_ORDER "nautilus-list-view-column-order"
+
+#define NAUTILUS_METADATA_KEY_COMPACT_VIEW_ZOOM_LEVEL "nautilus-compact-view-zoom-level"
+
+#define NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY "nautilus-window-geometry"
+#define NAUTILUS_METADATA_KEY_WINDOW_SCROLL_POSITION "nautilus-window-scroll-position"
+#define NAUTILUS_METADATA_KEY_WINDOW_SHOW_HIDDEN_FILES "nautilus-window-show-hidden-files"
+#define NAUTILUS_METADATA_KEY_WINDOW_MAXIMIZED "nautilus-window-maximized"
+#define NAUTILUS_METADATA_KEY_WINDOW_STICKY "nautilus-window-sticky"
+#define NAUTILUS_METADATA_KEY_WINDOW_KEEP_ABOVE "nautilus-window-keep-above"
+
+#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR "nautilus-sidebar-background-color"
+#define NAUTILUS_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE "nautilus-sidebar-background-image"
+#define NAUTILUS_METADATA_KEY_SIDEBAR_BUTTONS "nautilus-sidebar-buttons"
+
+#define NAUTILUS_METADATA_KEY_ICON_POSITION "nautilus-icon-position"
+#define NAUTILUS_METADATA_KEY_ICON_POSITION_TIMESTAMP "nautilus-icon-position-timestamp"
#define NAUTILUS_METADATA_KEY_ANNOTATION "annotation"
-#define NAUTILUS_METADATA_KEY_ICON_POSITION "icon_position"
-#define NAUTILUS_METADATA_KEY_ICON_POSITION_TIMESTAMP "icon_position_timestamp"
-#define NAUTILUS_METADATA_KEY_ICON_SCALE "icon_scale"
-#define NAUTILUS_METADATA_KEY_CUSTOM_ICON "custom_icon"
+#define NAUTILUS_METADATA_KEY_ICON_SCALE "icon-scale"
+#define NAUTILUS_METADATA_KEY_CUSTOM_ICON "custom-icon"
#define NAUTILUS_METADATA_KEY_SCREEN "screen"
-#define NAUTILUS_METADATA_KEY_KEYWORD "keyword"
+#define NAUTILUS_METADATA_KEY_EMBLEMS "emblems"
guint nautilus_metadata_get_id (const char *metadata);
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index b84bb15..24e9302 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -1071,7 +1071,7 @@ got_file_info_for_view_selection_callback (NautilusFile *file,
if (slot->location_change_type != NAUTILUS_LOCATION_CHANGE_FALLBACK) {
/* Look in metadata for view */
view_id = nautilus_file_get_metadata
- (file, NAUTILUS_METADATA_KEY_DEFAULT_COMPONENT, NULL);
+ (file, NAUTILUS_METADATA_KEY_DEFAULT_VIEW, NULL);
if (view_id != NULL &&
!nautilus_view_factory_view_supports_uri (view_id,
location,
@@ -2006,7 +2006,7 @@ nautilus_window_slot_set_content_view (NautilusWindowSlot *slot,
file = nautilus_file_get (slot->location);
nautilus_file_set_metadata
- (file, NAUTILUS_METADATA_KEY_DEFAULT_COMPONENT, NULL, id);
+ (file, NAUTILUS_METADATA_KEY_DEFAULT_VIEW, NULL, id);
nautilus_file_unref (file);
nautilus_window_slot_set_allow_stop (slot, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]