Commit 0ae549f1 authored by Paolo Bacchilega's avatar Paolo Bacchilega

removed calls to g_type_class_add_private

It's deprecated.
parent 473d9d3d
......@@ -33,8 +33,7 @@
#include "gth-burn-task.h"
struct _GthBurnTaskPrivate
{
struct _GthBurnTaskPrivate {
GthBrowser *browser;
GFile *location;
GList *selected_files;
......@@ -51,7 +50,10 @@ struct _GthBurnTaskPrivate
};
G_DEFINE_TYPE (GthBurnTask, gth_burn_task, GTH_TYPE_TASK)
G_DEFINE_TYPE_WITH_CODE (GthBurnTask,
gth_burn_task,
GTH_TYPE_TASK,
G_ADD_PRIVATE (GthBurnTask))
static void
......@@ -70,23 +72,18 @@ gth_burn_task_finalize (GObject *object)
task = GTH_BURN_TASK (object);
if (task->priv != NULL) {
gtk_widget_destroy (task->priv->dialog);
g_hash_table_foreach (task->priv->content, free_file_list_from_content, NULL);
g_hash_table_unref (task->priv->content);
g_hash_table_unref (task->priv->parents);
g_free (task->priv->current_directory);
_g_object_unref (task->priv->file_source);
_g_object_unref (task->priv->test);
_g_object_unref (task->priv->builder);
_g_object_list_unref (task->priv->selected_files);
g_free (task->priv->base_directory);
g_object_unref (task->priv->location);
g_object_unref (task->priv->browser);
g_free (task->priv);
task->priv = NULL;
}
gtk_widget_destroy (task->priv->dialog);
g_hash_table_foreach (task->priv->content, free_file_list_from_content, NULL);
g_hash_table_unref (task->priv->content);
g_hash_table_unref (task->priv->parents);
g_free (task->priv->current_directory);
_g_object_unref (task->priv->file_source);
_g_object_unref (task->priv->test);
_g_object_unref (task->priv->builder);
_g_object_list_unref (task->priv->selected_files);
g_free (task->priv->base_directory);
g_object_unref (task->priv->location);
g_object_unref (task->priv->browser);
G_OBJECT_CLASS (gth_burn_task_parent_class)->finalize (object);
}
......@@ -445,10 +442,20 @@ gth_burn_task_class_init (GthBurnTaskClass *class)
static void
gth_burn_task_init (GthBurnTask *task)
{
task->priv = g_new0 (GthBurnTaskPrivate, 1);
task->priv = gth_burn_task_get_instance_private (task);
task->priv->browser = NULL;
task->priv->location = NULL;
task->priv->selected_files = NULL;
task->priv->dialog = NULL;
task->priv->builder = NULL;
task->priv->test = NULL;
task->priv->file_source = NULL;
task->priv->base_directory = NULL;
task->priv->current_directory = NULL;
task->priv->content = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
task->priv->parents = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) gtk_tree_path_free);
task->priv->builder = NULL;
task->priv->session = NULL;
task->priv->track = NULL;
}
......
......@@ -35,9 +35,6 @@
#include "preferences.h"
G_DEFINE_TYPE (GthImageSaverJpeg, gth_image_saver_jpeg, GTH_TYPE_IMAGE_SAVER)
struct _GthImageSaverJpegPrivate {
GtkBuilder *builder;
GSettings *settings;
......@@ -45,6 +42,12 @@ struct _GthImageSaverJpegPrivate {
};
G_DEFINE_TYPE_WITH_CODE (GthImageSaverJpeg,
gth_image_saver_jpeg,
GTH_TYPE_IMAGE_SAVER,
G_ADD_PRIVATE (GthImageSaverJpeg))
static void
gth_image_saver_jpeg_finalize (GObject *object)
{
......@@ -506,8 +509,6 @@ gth_image_saver_jpeg_class_init (GthImageSaverJpegClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
g_type_class_add_private (klass, sizeof (GthImageSaverJpegPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_jpeg_finalize;
......@@ -527,7 +528,7 @@ gth_image_saver_jpeg_class_init (GthImageSaverJpegClass *klass)
static void
gth_image_saver_jpeg_init (GthImageSaverJpeg *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_JPEG, GthImageSaverJpegPrivate);
self->priv = gth_image_saver_jpeg_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_JPEG_SCHEMA);
self->priv->builder = NULL;
self->priv->default_ext = NULL;
......
......@@ -42,15 +42,18 @@
#endif
G_DEFINE_TYPE (GthImageSaverPng, gth_image_saver_png, GTH_TYPE_IMAGE_SAVER)
struct _GthImageSaverPngPrivate {
GtkBuilder *builder;
GSettings *settings;
};
G_DEFINE_TYPE_WITH_CODE (GthImageSaverPng,
gth_image_saver_png,
GTH_TYPE_IMAGE_SAVER,
G_ADD_PRIVATE (GthImageSaverPng))
static void
gth_image_saver_png_finalize (GObject *object)
{
......@@ -343,8 +346,6 @@ gth_image_saver_png_class_init (GthImageSaverPngClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
g_type_class_add_private (klass, sizeof (GthImageSaverPngPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_png_finalize;
......@@ -364,7 +365,7 @@ gth_image_saver_png_class_init (GthImageSaverPngClass *klass)
static void
gth_image_saver_png_init (GthImageSaverPng *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_PNG, GthImageSaverPngPrivate);
self->priv = gth_image_saver_png_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_PNG_SCHEMA);
self->priv->builder = NULL;
}
......@@ -26,15 +26,18 @@
#include "preferences.h"
G_DEFINE_TYPE (GthImageSaverTga, gth_image_saver_tga, GTH_TYPE_IMAGE_SAVER)
struct _GthImageSaverTgaPrivate {
GtkBuilder *builder;
GSettings *settings;
};
G_DEFINE_TYPE_WITH_CODE (GthImageSaverTga,
gth_image_saver_tga,
GTH_TYPE_IMAGE_SAVER,
G_ADD_PRIVATE (GthImageSaverTga))
static void
gth_image_saver_tga_finalize (GObject *object)
{
......@@ -334,8 +337,6 @@ gth_image_saver_tga_class_init (GthImageSaverTgaClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
g_type_class_add_private (klass, sizeof (GthImageSaverTgaPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_tga_finalize;
......@@ -355,7 +356,7 @@ gth_image_saver_tga_class_init (GthImageSaverTgaClass *klass)
static void
gth_image_saver_tga_init (GthImageSaverTga *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_TGA, GthImageSaverTgaPrivate);
self->priv = gth_image_saver_tga_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_TGA_SCHEMA);
self->priv->builder = NULL;
}
......@@ -30,9 +30,6 @@
#include "preferences.h"
G_DEFINE_TYPE (GthImageSaverTiff, gth_image_saver_tiff, GTH_TYPE_IMAGE_SAVER)
struct _GthImageSaverTiffPrivate {
GSettings *settings;
GtkBuilder *builder;
......@@ -40,6 +37,12 @@ struct _GthImageSaverTiffPrivate {
};
G_DEFINE_TYPE_WITH_CODE (GthImageSaverTiff,
gth_image_saver_tiff,
GTH_TYPE_IMAGE_SAVER,
G_ADD_PRIVATE (GthImageSaverTiff))
static void
gth_image_saver_tiff_finalize (GObject *object)
{
......@@ -553,8 +556,6 @@ gth_image_saver_tiff_class_init (GthImageSaverTiffClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
g_type_class_add_private (klass, sizeof (GthImageSaverTiffPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_tiff_finalize;
......@@ -574,7 +575,7 @@ gth_image_saver_tiff_class_init (GthImageSaverTiffClass *klass)
static void
gth_image_saver_tiff_init (GthImageSaverTiff *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_TIFF, GthImageSaverTiffPrivate);
self->priv = gth_image_saver_tiff_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_TIFF_SCHEMA);
self->priv->builder = NULL;
self->priv->default_ext = NULL;
......
......@@ -30,15 +30,18 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
G_DEFINE_TYPE (GthImageSaverWebp, gth_image_saver_webp, GTH_TYPE_IMAGE_SAVER)
struct _GthImageSaverWebpPrivate {
GtkBuilder *builder;
GSettings *settings;
};
G_DEFINE_TYPE_WITH_CODE (GthImageSaverWebp,
gth_image_saver_webp,
GTH_TYPE_IMAGE_SAVER,
G_ADD_PRIVATE (GthImageSaverWebp))
static void
gth_image_saver_webp_finalize (GObject *object)
{
......@@ -372,8 +375,6 @@ gth_image_saver_webp_class_init (GthImageSaverWebpClass *klass)
GObjectClass *object_class;
GthImageSaverClass *image_saver_class;
g_type_class_add_private (klass, sizeof (GthImageSaverWebpPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_image_saver_webp_finalize;
......@@ -393,7 +394,7 @@ gth_image_saver_webp_class_init (GthImageSaverWebpClass *klass)
static void
gth_image_saver_webp_init (GthImageSaverWebp *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMAGE_SAVER_WEBP, GthImageSaverWebpPrivate);
self->priv = gth_image_saver_webp_get_instance_private (self);
self->priv->settings = g_settings_new (GTHUMB_IMAGE_SAVERS_WEBP_SCHEMA);
self->priv->builder = NULL;
}
......@@ -44,7 +44,10 @@ struct _GthCatalogPrivate {
};
G_DEFINE_TYPE (GthCatalog, gth_catalog, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_CODE (GthCatalog,
gth_catalog,
G_TYPE_OBJECT,
G_ADD_PRIVATE (GthCatalog))
static void
......@@ -54,17 +57,13 @@ gth_catalog_finalize (GObject *object)
g_value_hash_unref (catalog->attributes);
if (catalog->priv != NULL) {
if (catalog->priv->file != NULL)
g_object_unref (catalog->priv->file);
g_free (catalog->priv->name);
_g_object_list_unref (catalog->priv->file_list);
g_hash_table_destroy (catalog->priv->file_hash);
gth_datetime_free (catalog->priv->date_time);
g_free (catalog->priv->order);
g_free (catalog->priv);
catalog->priv = NULL;
}
if (catalog->priv->file != NULL)
g_object_unref (catalog->priv->file);
g_free (catalog->priv->name);
_g_object_list_unref (catalog->priv->file_list);
g_hash_table_destroy (catalog->priv->file_hash);
gth_datetime_free (catalog->priv->date_time);
g_free (catalog->priv->order);
G_OBJECT_CLASS (gth_catalog_parent_class)->finalize (object);
}
......@@ -245,9 +244,17 @@ static void
gth_catalog_init (GthCatalog *catalog)
{
catalog->attributes = g_value_hash_new ();
catalog->priv = g_new0 (GthCatalogPrivate, 1);
catalog->priv->date_time = gth_datetime_new ();
catalog->priv = gth_catalog_get_instance_private (catalog);
catalog->priv->type = GTH_CATALOG_TYPE_INVALID;
catalog->priv->file = NULL;
catalog->priv->file_list = NULL;
catalog->priv->file_hash = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, NULL, NULL);
catalog->priv->name = NULL;
catalog->priv->date_time = gth_datetime_new ();
catalog->priv->active = FALSE;
catalog->priv->order = NULL;
catalog->priv->order_inverse = FALSE;
catalog->priv->cancellable = NULL;
}
......
......@@ -28,8 +28,7 @@
#include "gth-file-source-catalogs.h"
struct _GthFileSourceCatalogsPrivate
{
struct _GthFileSourceCatalogsPrivate {
GList *files;
GthCatalog *catalog;
ListReady ready_func;
......@@ -37,7 +36,10 @@ struct _GthFileSourceCatalogsPrivate
};
G_DEFINE_TYPE (GthFileSourceCatalogs, gth_file_source_catalogs, GTH_TYPE_FILE_SOURCE)
G_DEFINE_TYPE_WITH_CODE (GthFileSourceCatalogs,
gth_file_source_catalogs,
GTH_TYPE_FILE_SOURCE,
G_ADD_PRIVATE (GthFileSourceCatalogs))
static GList *
......@@ -1455,14 +1457,9 @@ gth_file_source_catalogs_finalize (GObject *object)
{
GthFileSourceCatalogs *catalogs = GTH_FILE_SOURCE_CATALOGS (object);
if (catalogs->priv != NULL) {
g_object_unref (catalogs->priv->catalog);
_g_object_list_unref (catalogs->priv->files);
catalogs->priv->files = NULL;
g_free (catalogs->priv);
catalogs->priv = NULL;
}
g_object_unref (catalogs->priv->catalog);
_g_object_list_unref (catalogs->priv->files);
catalogs->priv->files = NULL;
G_OBJECT_CLASS (gth_file_source_catalogs_parent_class)->finalize (object);
}
......@@ -1500,6 +1497,9 @@ gth_file_source_catalogs_init (GthFileSourceCatalogs *catalogs)
{
gth_file_source_add_scheme (GTH_FILE_SOURCE (catalogs), "catalog");
catalogs->priv = g_new0 (GthFileSourceCatalogsPrivate, 1);
catalogs->priv = gth_file_source_catalogs_get_instance_private (catalogs);
catalogs->priv->files = NULL;
catalogs->priv->catalog = gth_catalog_new ();
catalogs->priv->ready_func = NULL;
catalogs->priv->ready_data = NULL;
}
......@@ -39,8 +39,7 @@ enum {
};
struct _GthOrganizeTaskPrivate
{
struct _GthOrganizeTaskPrivate {
GthBrowser *browser;
GFile *folder;
GthGroupPolicy group_policy;
......@@ -60,7 +59,10 @@ struct _GthOrganizeTaskPrivate
};
G_DEFINE_TYPE (GthOrganizeTask, gth_organize_task, GTH_TYPE_TASK)
G_DEFINE_TYPE_WITH_CODE (GthOrganizeTask,
gth_organize_task,
GTH_TYPE_TASK,
G_ADD_PRIVATE (GthOrganizeTask))
static void
......@@ -636,8 +638,6 @@ gth_organize_task_class_init (GthOrganizeTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
g_type_class_add_private (klass, sizeof (GthOrganizeTaskPrivate));
object_class = (GObjectClass*) klass;
object_class->finalize = gth_organize_task_finalize;
......@@ -804,7 +804,7 @@ gth_organize_task_init (GthOrganizeTask *self)
{
GIcon *icon;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_ORGANIZE_TASK, GthOrganizeTaskPrivate);
self->priv = gth_organize_task_get_instance_private (self);
self->priv->builder = _gtk_builder_new_from_file ("organize-files-task.ui", "catalogs");
self->priv->results_liststore = (GtkListStore *) gtk_builder_get_object (self->priv->builder, "results_liststore");
self->priv->catalogs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
......
......@@ -37,7 +37,10 @@ struct _GthChangeDateTaskPrivate {
};
G_DEFINE_TYPE (GthChangeDateTask, gth_change_date_task, GTH_TYPE_TASK)
G_DEFINE_TYPE_WITH_CODE (GthChangeDateTask,
gth_change_date_task,
GTH_TYPE_TASK,
G_ADD_PRIVATE (GthChangeDateTask))
static void
......@@ -342,8 +345,6 @@ gth_change_date_task_class_init (GthChangeDateTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
g_type_class_add_private (klass, sizeof (GthChangeDateTaskPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_change_date_task_finalize;
......@@ -355,7 +356,7 @@ gth_change_date_task_class_init (GthChangeDateTaskClass *klass)
static void
gth_change_date_task_init (GthChangeDateTask *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_CHANGE_DATE_TASK, GthChangeDateTaskPrivate);
self->priv = gth_change_date_task_get_instance_private (self);
self->priv->date_time = gth_datetime_new ();
}
......
......@@ -48,10 +48,11 @@ static void gth_comment_dom_domizable_interface_init (DomDomizableInterface *ifa
G_DEFINE_TYPE_WITH_CODE (GthComment,
gth_comment,
G_TYPE_OBJECT,
G_ADD_PRIVATE (GthComment)
G_IMPLEMENT_INTERFACE (GTH_TYPE_DUPLICABLE,
gth_comment_gth_duplicable_interface_init)
G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
gth_comment_dom_domizable_interface_init))
gth_comment_gth_duplicable_interface_init)
G_IMPLEMENT_INTERFACE (DOM_TYPE_DOMIZABLE,
gth_comment_dom_domizable_interface_init))
static void
......@@ -92,7 +93,6 @@ gth_comment_finalize (GObject *obj)
static void
gth_comment_class_init (GthCommentClass *klass)
{
g_type_class_add_private (klass, sizeof (GthCommentPrivate));
G_OBJECT_CLASS (klass)->finalize = gth_comment_finalize;
}
......@@ -100,7 +100,7 @@ gth_comment_class_init (GthCommentClass *klass)
static void
gth_comment_init (GthComment *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_COMMENT, GthCommentPrivate);
self->priv = gth_comment_get_instance_private (self);
self->priv->caption = NULL;
self->priv->note = NULL;
self->priv->place = NULL;
......
......@@ -33,7 +33,10 @@ struct _GthImportMetadataTaskPrivate {
};
G_DEFINE_TYPE (GthImportMetadataTask, gth_import_metadata_task, GTH_TYPE_TASK)
G_DEFINE_TYPE_WITH_CODE (GthImportMetadataTask,
gth_import_metadata_task,
GTH_TYPE_TASK,
G_ADD_PRIVATE (GthImportMetadataTask))
static void
......@@ -210,8 +213,6 @@ gth_import_metadata_task_class_init (GthImportMetadataTaskClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
g_type_class_add_private (klass, sizeof (GthImportMetadataTaskPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_import_metadata_task_finalize;
......@@ -223,7 +224,7 @@ gth_import_metadata_task_class_init (GthImportMetadataTaskClass *klass)
static void
gth_import_metadata_task_init (GthImportMetadataTask *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_IMPORT_METADATA_TASK, GthImportMetadataTaskPrivate);
self->priv = gth_import_metadata_task_get_instance_private (self);
self->priv->file_data = NULL;
}
......
......@@ -31,9 +31,6 @@
#define DEFAULT_FONT "Sans 12"
G_DEFINE_TYPE (GthContactSheetCreator, gth_contact_sheet_creator, GTH_TYPE_TASK)
typedef struct {
GthFileData *file_data;
cairo_surface_t *thumbnail;
......@@ -117,6 +114,12 @@ struct _GthContactSheetCreatorPrivate {
};
G_DEFINE_TYPE_WITH_CODE (GthContactSheetCreator,
gth_contact_sheet_creator,
GTH_TYPE_TASK,
G_ADD_PRIVATE (GthContactSheetCreator))
static int
get_text_height (GthContactSheetCreator *self,
const char *text,
......@@ -1059,8 +1062,6 @@ gth_contact_sheet_creator_class_init (GthContactSheetCreatorClass *klass)
GObjectClass *object_class;
GthTaskClass *task_class;
g_type_class_add_private (klass, sizeof (GthContactSheetCreatorPrivate));
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gth_contact_sheet_creator_finalize;
......@@ -1072,7 +1073,7 @@ gth_contact_sheet_creator_class_init (GthContactSheetCreatorClass *klass)
static void
gth_contact_sheet_creator_init (GthContactSheetCreator *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_CONTACT_SHEET_CREATOR, GthContactSheetCreatorPrivate);
self->priv = gth_contact_sheet_creator_get_instance_private (self);
self->priv->header = NULL;
self->priv->footer = NULL;
self->priv->destination = NULL;
......
......@@ -26,9 +26,6 @@
#define GET_WIDGET(x) (_gtk_builder_get_widget (self->priv->builder, (x)))
G_DEFINE_TYPE (GthContactSheetThemeDialog, gth_contact_sheet_theme_dialog, GTK_TYPE_DIALOG)
struct _GthContactSheetThemeDialogPrivate {
GtkBuilder *builder;
GtkWidget *copy_from_button;
......@@ -38,6 +35,12 @@ struct _GthContactSheetThemeDialogPrivate {
};
G_DEFINE_TYPE_WITH_CODE (GthContactSheetThemeDialog,
gth_contact_sheet_theme_dialog,
GTK_TYPE_DIALOG,
G_ADD_PRIVATE (GthContactSheetThemeDialog))
static void
gth_contact_sheet_theme_dialog_finalize (GObject *object)
{
......@@ -58,8 +61,6 @@ gth_contact_sheet_theme_dialog_class_init (GthContactSheetThemeDialogClass *klas
{
GObjectClass *object_class;
g_type_class_add_private (klass, sizeof (GthContactSheetThemeDialogPrivate));
object_class = (GObjectClass*) klass;
object_class->finalize = gth_contact_sheet_theme_dialog_finalize;