diff options
author | Sirbu Lavinia Stefania <sirbu.lavinia.stefania@gmail.com> | 2016-10-03 01:06:19 +0300 |
---|---|---|
committer | Ernestas Kulik <ernestask@src.gnome.org> | 2016-10-07 15:59:49 +0300 |
commit | 47d77924109e2492b883f46c2e280ab1021ebe56 (patch) | |
tree | fc0aded7f269e51bdbe67456e9efc798f1a3953d /src/nautilus-mime-application-chooser.h | |
parent | a1b358be8a08c4c762e8476882635b0b35e0c0c5 (diff) | |
download | nautilus-47d77924109e2492b883f46c2e280ab1021ebe56.tar.gz |
mime-application-chooser: port to G_DECLARE* type
Currently we are using the old GObject class declarations, which have two
problems.
One problem is that we cannot use smart pointers like g_autoptr. The other
problem is the boilerplate code generated that makes the code less readable,
so harder to understand.
To fix this use G_DECLARE* type.
https://bugzilla.gnome.org/show_bug.cgi?id=771928
Diffstat (limited to 'src/nautilus-mime-application-chooser.h')
-rw-r--r-- | src/nautilus-mime-application-chooser.h | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/nautilus-mime-application-chooser.h b/src/nautilus-mime-application-chooser.h index fd7ae1e0a..ea23203d7 100644 --- a/src/nautilus-mime-application-chooser.h +++ b/src/nautilus-mime-application-chooser.h @@ -26,26 +26,15 @@ #include <gtk/gtk.h> -#define NAUTILUS_TYPE_MIME_APPLICATION_CHOOSER (nautilus_mime_application_chooser_get_type ()) -#define NAUTILUS_MIME_APPLICATION_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_MIME_APPLICATION_CHOOSER, NautilusMimeApplicationChooser)) -#define NAUTILUS_MIME_APPLICATION_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_MIME_APPLICATION_CHOOSER, NautilusMimeApplicationChooserClass)) -#define NAUTILUS_IS_MIME_APPLICATION_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_MIME_APPLICATION_CHOOSER) +G_BEGIN_DECLS -typedef struct _NautilusMimeApplicationChooser NautilusMimeApplicationChooser; -typedef struct _NautilusMimeApplicationChooserClass NautilusMimeApplicationChooserClass; -typedef struct _NautilusMimeApplicationChooserDetails NautilusMimeApplicationChooserDetails; +#define NAUTILUS_TYPE_MIME_APPLICATION_CHOOSER (nautilus_mime_application_chooser_get_type ()) -struct _NautilusMimeApplicationChooser { - GtkBox parent; - NautilusMimeApplicationChooserDetails *details; -}; +G_DECLARE_FINAL_TYPE (NautilusMimeApplicationChooser, nautilus_mime_application_chooser, NAUTILUS, MIME_APPLICATION_CHOOSER, GtkBox) -struct _NautilusMimeApplicationChooserClass { - GtkBoxClass parent_class; -}; - -GType nautilus_mime_application_chooser_get_type (void); GtkWidget * nautilus_mime_application_chooser_new (GList *files, const char *mime_type); +G_END_DECLS + #endif /* NAUTILUS_MIME_APPLICATION_CHOOSER_H */ |