Skip to content
Permalink
Browse files

Avoid deprecated g_type_class_add_private under libcaja-private

Changed CajaFileConflictDialog and CajaFile
  • Loading branch information...
yetist authored and lukefromdc committed Jan 26, 2019
1 parent e5129f9 commit 0b073710ad39202758525b9dd0a08f35fa84481d
@@ -3502,7 +3502,7 @@ top_left_read_callback (GObject *source_object,
{
TopLeftTextReadState *state;
CajaDirectory *directory;
CajaFileDetails *file_details;
CajaFilePrivate *file_details;
gsize file_size;
char *file_contents;

@@ -37,7 +37,7 @@
#include "caja-file.h"
#include "caja-icon-info.h"

struct _CajaFileConflictDialogDetails
struct _CajaFileConflictDialogPrivate
{
/* conflicting objects */
CajaFile *source;
@@ -63,13 +63,9 @@ struct _CajaFileConflictDialogDetails
GtkWidget *src_image;
};

G_DEFINE_TYPE (CajaFileConflictDialog,
caja_file_conflict_dialog,
GTK_TYPE_DIALOG);

#define CAJA_FILE_CONFLICT_DIALOG_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), CAJA_TYPE_FILE_CONFLICT_DIALOG, \
CajaFileConflictDialogDetails))
G_DEFINE_TYPE_WITH_PRIVATE (CajaFileConflictDialog,
caja_file_conflict_dialog,
GTK_TYPE_DIALOG);

static void
file_icons_changed (CajaFile *file,
@@ -104,7 +100,7 @@ file_list_ready_cb (GList *files,
CajaFile *src, *dest, *dest_dir;
time_t src_mtime, dest_mtime;
gboolean source_is_dir, dest_is_dir, should_show_type;
CajaFileConflictDialogDetails *details;
CajaFileConflictDialogPrivate *details;
char *primary_text, *message, *secondary_text;
const gchar *message_extra;
char *dest_name, *dest_dir_name, *edit_name;
@@ -384,7 +380,7 @@ static void
build_dialog_appearance (CajaFileConflictDialog *fcd)
{
GList *files = NULL;
CajaFileConflictDialogDetails *details = fcd->details;
CajaFileConflictDialogPrivate *details = fcd->details;

files = g_list_prepend (files, details->source);
files = g_list_prepend (files, details->destination);
@@ -403,7 +399,7 @@ set_source_and_destination (GtkWidget *w,
GFile *dest_dir)
{
CajaFileConflictDialog *dialog;
CajaFileConflictDialogDetails *details;
CajaFileConflictDialogPrivate *details;

dialog = CAJA_FILE_CONFLICT_DIALOG (w);
details = dialog->details;
@@ -419,7 +415,7 @@ static void
entry_text_changed_cb (GtkEditable *entry,
CajaFileConflictDialog *dialog)
{
CajaFileConflictDialogDetails *details;
CajaFileConflictDialogPrivate *details;

details = dialog->details;

@@ -453,7 +449,7 @@ static void
expander_activated_cb (GtkExpander *w,
CajaFileConflictDialog *dialog)
{
CajaFileConflictDialogDetails *details;
CajaFileConflictDialogPrivate *details;
int start_pos, end_pos;

details = dialog->details;
@@ -477,7 +473,7 @@ static void
checkbox_toggled_cb (GtkToggleButton *t,
CajaFileConflictDialog *dialog)
{
CajaFileConflictDialogDetails *details;
CajaFileConflictDialogPrivate *details;

details = dialog->details;

@@ -506,7 +502,7 @@ static void
reset_button_clicked_cb (GtkButton *w,
CajaFileConflictDialog *dialog)
{
CajaFileConflictDialogDetails *details;
CajaFileConflictDialogPrivate *details;
int start_pos, end_pos;

details = dialog->details;
@@ -525,7 +521,7 @@ static void
diff_button_clicked_cb (GtkButton *w,
CajaFileConflictDialog *dialog)
{
CajaFileConflictDialogDetails *details;
CajaFileConflictDialogPrivate *details;
details = dialog->details;

GError *error;
@@ -564,11 +560,11 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
{
GtkWidget *hbox, *vbox, *vbox2;
GtkWidget *widget, *dialog_area;
CajaFileConflictDialogDetails *details;
CajaFileConflictDialogPrivate *details;
GtkDialog *dialog;
gboolean source_is_dir;

details = fcd->details = CAJA_FILE_CONFLICT_DIALOG_GET_PRIVATE (fcd);
details = fcd->details = caja_file_conflict_dialog_get_instance_private (fcd);
dialog = GTK_DIALOG (fcd);

source_is_dir = caja_file_is_directory (details->source);
@@ -687,7 +683,7 @@ caja_file_conflict_dialog_init (CajaFileConflictDialog *fcd)
static void
do_finalize (GObject *self)
{
CajaFileConflictDialogDetails *details =
CajaFileConflictDialogPrivate *details =
CAJA_FILE_CONFLICT_DIALOG (self)->details;

g_free (details->conflict_name);
@@ -720,8 +716,6 @@ static void
caja_file_conflict_dialog_class_init (CajaFileConflictDialogClass *klass)
{
G_OBJECT_CLASS (klass)->finalize = do_finalize;

g_type_class_add_private (klass, sizeof (CajaFileConflictDialogDetails));
}

char *
@@ -48,12 +48,12 @@

typedef struct _CajaFileConflictDialog CajaFileConflictDialog;
typedef struct _CajaFileConflictDialogClass CajaFileConflictDialogClass;
typedef struct _CajaFileConflictDialogDetails CajaFileConflictDialogDetails;
typedef struct _CajaFileConflictDialogPrivate CajaFileConflictDialogPrivate;

struct _CajaFileConflictDialog
{
GtkDialog parent;
CajaFileConflictDialogDetails *details;
CajaFileConflictDialogPrivate *details;
};

struct _CajaFileConflictDialogClass
@@ -58,7 +58,7 @@ typedef struct
char emblem_keywords[1];
} CajaFileSortByEmblemCache;

struct CajaFileDetails
struct _CajaFilePrivate
{
CajaDirectory *directory;

@@ -167,13 +167,14 @@ static void file_mount_unmounted (GMount *mount, gpointer data);
static void metadata_hash_free (GHashTable *hash);

G_DEFINE_TYPE_WITH_CODE (CajaFile, caja_file, G_TYPE_OBJECT,
G_ADD_PRIVATE (CajaFile)
G_IMPLEMENT_INTERFACE (CAJA_TYPE_FILE_INFO,
caja_file_info_iface_init));

static void
caja_file_init (CajaFile *file)
{
file->details = G_TYPE_INSTANCE_GET_PRIVATE ((file), CAJA_TYPE_FILE, CajaFileDetails);
file->details = caja_file_get_instance_private (file);

caja_file_clear_info (file);
caja_file_invalidate_extension_info_internal (file);
@@ -8607,8 +8608,6 @@ caja_file_class_init (CajaFileClass *class)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);

g_type_class_add_private (class, sizeof (CajaFileDetails));

eel_g_settings_add_auto_enum (caja_preferences,
CAJA_PREFERENCES_DATE_FORMAT,
&date_format_pref);
@@ -30,6 +30,8 @@
#include <libcaja-private/caja-file-attributes.h>
#include <libcaja-private/caja-icon-info.h>

G_BEGIN_DECLS

/* CajaFile is an object used to represent a single element of a
* CajaDirectory. It's lightweight and relies on CajaDirectory
* to do most of the work.
@@ -494,12 +496,12 @@ void caja_file_list_cancel_call_when_ready (CajaFileLis
/* Debugging */
void caja_file_dump (CajaFile *file);

typedef struct CajaFileDetails CajaFileDetails;
typedef struct _CajaFilePrivate CajaFilePrivate;

struct CajaFile
{
GObject parent_slot;
CajaFileDetails *details;
CajaFilePrivate *details;
};

/* This is actually a "protected" type, but it must be here so we can
@@ -596,4 +598,6 @@ typedef struct
void (* poll_for_media) (CajaFile *file);
} CajaFileClass;

G_END_DECLS

#endif /* CAJA_FILE_H */

0 comments on commit 0b07371

Please sign in to comment.
You can’t perform that action at this time.