summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2019-01-26 12:11:10 +0800
committerlukefromdc <[email protected]>2019-01-31 19:36:27 +0000
commit0b073710ad39202758525b9dd0a08f35fa84481d (patch)
tree7e1d23e9cbf9ad0da62ec17e770665aa217f7c70
parente5129f93e489c1716d815452075f57a64b5fa149 (diff)
downloadcaja-0b073710ad39202758525b9dd0a08f35fa84481d.tar.bz2
caja-0b073710ad39202758525b9dd0a08f35fa84481d.tar.xz
Avoid deprecated g_type_class_add_private under libcaja-private
Changed CajaFileConflictDialog and CajaFile
-rw-r--r--libcaja-private/caja-directory-async.c2
-rw-r--r--libcaja-private/caja-file-conflict-dialog.c36
-rw-r--r--libcaja-private/caja-file-conflict-dialog.h4
-rw-r--r--libcaja-private/caja-file-private.h2
-rw-r--r--libcaja-private/caja-file.c5
-rw-r--r--libcaja-private/caja-file.h8
6 files changed, 27 insertions, 30 deletions
diff --git a/libcaja-private/caja-directory-async.c b/libcaja-private/caja-directory-async.c
index 73876e72..983b6e7c 100644
--- a/libcaja-private/caja-directory-async.c
+++ b/libcaja-private/caja-directory-async.c
@@ -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;
diff --git a/libcaja-private/caja-file-conflict-dialog.c b/libcaja-private/caja-file-conflict-dialog.c
index c51c626e..edc809d0 100644
--- a/libcaja-private/caja-file-conflict-dialog.c
+++ b/libcaja-private/caja-file-conflict-dialog.c
@@ -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 *
diff --git a/libcaja-private/caja-file-conflict-dialog.h b/libcaja-private/caja-file-conflict-dialog.h
index 8dd9e281..11631af6 100644
--- a/libcaja-private/caja-file-conflict-dialog.h
+++ b/libcaja-private/caja-file-conflict-dialog.h
@@ -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
diff --git a/libcaja-private/caja-file-private.h b/libcaja-private/caja-file-private.h
index 1130862a..f5e77be7 100644
--- a/libcaja-private/caja-file-private.h
+++ b/libcaja-private/caja-file-private.h
@@ -58,7 +58,7 @@ typedef struct
char emblem_keywords[1];
} CajaFileSortByEmblemCache;
-struct CajaFileDetails
+struct _CajaFilePrivate
{
CajaDirectory *directory;
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
index 4b35195c..01e9db83 100644
--- a/libcaja-private/caja-file.c
+++ b/libcaja-private/caja-file.c
@@ -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);
diff --git a/libcaja-private/caja-file.h b/libcaja-private/caja-file.h
index e68783b8..4c24b15a 100644
--- a/libcaja-private/caja-file.h
+++ b/libcaja-private/caja-file.h
@@ -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 */