diff options
author | Ernestas Kulik <ernestask@gnome.org> | 2018-08-26 11:12:36 +0300 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2018-08-26 11:12:36 +0300 |
commit | 0b998dbeb243dc68bbb8520731424af7f2c3ff48 (patch) | |
tree | c2dc1801276126d4f2672b09d305b17d7eed11bd /src | |
parent | c28776c4b44ad395891d4fbdaa92d4bde4617d70 (diff) | |
download | nautilus-0b998dbeb243dc68bbb8520731424af7f2c3ff48.tar.gz |
search-directory-file: Drop g_type_class_add_private()
One of the simpler offenders to fix.
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-search-directory-file.c | 22 | ||||
-rw-r--r-- | src/nautilus-search-directory-file.h | 29 |
2 files changed, 14 insertions, 37 deletions
diff --git a/src/nautilus-search-directory-file.c b/src/nautilus-search-directory-file.c index 38dc18504..e8091d497 100644 --- a/src/nautilus-search-directory-file.c +++ b/src/nautilus-search-directory-file.c @@ -36,8 +36,10 @@ #include "nautilus-query.h" #include "nautilus-search-directory.h" -struct NautilusSearchDirectoryFileDetails +struct _NautilusSearchDirectoryFile { + NautilusFile parent_instance; + gchar *metadata_filename; }; @@ -182,7 +184,7 @@ search_directory_file_set_metadata (NautilusFile *file, search_file = NAUTILUS_SEARCH_DIRECTORY_FILE (file); nautilus_keyfile_metadata_set_string (file, - search_file->details->metadata_filename, + search_file->metadata_filename, "directory", key, value); } @@ -195,7 +197,7 @@ search_directory_file_set_metadata_as_list (NautilusFile *file, search_file = NAUTILUS_SEARCH_DIRECTORY_FILE (file); nautilus_keyfile_metadata_set_stringv (file, - search_file->details->metadata_filename, + search_file->metadata_filename, "directory", key, (const gchar **) value); } @@ -247,14 +249,10 @@ nautilus_search_directory_file_init (NautilusSearchDirectoryFile *search_file) file = NAUTILUS_FILE (search_file); - search_file->details = G_TYPE_INSTANCE_GET_PRIVATE (search_file, - NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE, - NautilusSearchDirectoryFileDetails); - xdg_dir = nautilus_get_user_directory (); - search_file->details->metadata_filename = g_build_filename (xdg_dir, - "search-metadata", - NULL); + search_file->metadata_filename = g_build_filename (xdg_dir, + "search-metadata", + NULL); g_free (xdg_dir); file->details->got_file_info = TRUE; @@ -281,7 +279,7 @@ nautilus_search_directory_file_finalize (GObject *object) search_file = NAUTILUS_SEARCH_DIRECTORY_FILE (object); - g_free (search_file->details->metadata_filename); + g_free (search_file->metadata_filename); G_OBJECT_CLASS (nautilus_search_directory_file_parent_class)->finalize (object); } @@ -309,6 +307,4 @@ nautilus_search_directory_file_class_init (NautilusSearchDirectoryFileClass *kla file_class->get_where_string = search_directory_file_get_where_string; file_class->set_metadata = search_directory_file_set_metadata; file_class->set_metadata_as_list = search_directory_file_set_metadata_as_list; - - g_type_class_add_private (object_class, sizeof (NautilusSearchDirectoryFileDetails)); } diff --git a/src/nautilus-search-directory-file.h b/src/nautilus-search-directory-file.h index 8cd90d444..05c0ec08d 100644 --- a/src/nautilus-search-directory-file.h +++ b/src/nautilus-search-directory-file.h @@ -24,28 +24,9 @@ #include "nautilus-file.h" -#define NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE nautilus_search_directory_file_get_type() -#define NAUTILUS_SEARCH_DIRECTORY_FILE(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE, NautilusSearchDirectoryFile)) -#define NAUTILUS_SEARCH_DIRECTORY_FILE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE, NautilusSearchDirectoryFileClass)) -#define NAUTILUS_IS_SEARCH_DIRECTORY_FILE(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE)) -#define NAUTILUS_IS_SEARCH_DIRECTORY_FILE_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE)) -#define NAUTILUS_SEARCH_DIRECTORY_FILE_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE, NautilusSearchDirectoryFileClass)) +#define NAUTILUS_TYPE_SEARCH_DIRECTORY_FILE nautilus_search_directory_file_get_type () +G_DECLARE_FINAL_TYPE (NautilusSearchDirectoryFile, nautilus_search_directory_file, + NAUTILUS, SEARCH_DIRECTORY_FILE, + NautilusFile) -typedef struct NautilusSearchDirectoryFileDetails NautilusSearchDirectoryFileDetails; - -typedef struct { - NautilusFile parent_slot; - NautilusSearchDirectoryFileDetails *details; -} NautilusSearchDirectoryFile; - -typedef struct { - NautilusFileClass parent_slot; -} NautilusSearchDirectoryFileClass; - -GType nautilus_search_directory_file_get_type (void); -void nautilus_search_directory_file_update_display_name (NautilusSearchDirectoryFile *search_file);
\ No newline at end of file +void nautilus_search_directory_file_update_display_name (NautilusSearchDirectoryFile *search_file); |