[Xfce4-commits] <thunar:nick/1.8> Use property notification by pspec.
Nick Schermer
noreply at xfce.org
Tue Aug 6 16:56:01 CEST 2013
Updating branch refs/heads/nick/1.8
to bf31082d2707414d8a01ed55b8dc813e08949e44 (commit)
from ac69e53e40162347d7dd8381fdcdb2879f55a622 (commit)
commit bf31082d2707414d8a01ed55b8dc813e08949e44
Author: Nick Schermer <nick at xfce.org>
Date: Tue Aug 6 16:46:31 2013 +0200
Use property notification by pspec.
plugins/thunar-apr/thunar-apr-abstract-page.c | 19 +++--
plugins/thunar-sbr/thunar-sbr-case-renamer.c | 22 ++++--
plugins/thunar-sbr/thunar-sbr-date-renamer.c | 71 +++++++++--------
plugins/thunar-sbr/thunar-sbr-insert-renamer.c | 69 ++++++++--------
plugins/thunar-sbr/thunar-sbr-number-renamer.c | 69 ++++++++--------
plugins/thunar-sbr/thunar-sbr-remove-renamer.c | 71 +++++++++--------
plugins/thunar-sbr/thunar-sbr-replace-renamer.c | 67 ++++++++--------
thunar/thunar-application.c | 23 +++---
thunar/thunar-chooser-button.c | 20 +++--
thunar/thunar-chooser-dialog.c | 33 +++++---
thunar/thunar-chooser-model.c | 22 ++++--
thunar/thunar-clipboard-manager.c | 23 ++++--
thunar/thunar-create-dialog.c | 37 +++++----
thunar/thunar-desktop-background.c | 20 +++--
thunar/thunar-desktop-preferences-dialog.c | 24 ++++--
thunar/thunar-details-view.c | 22 ++++--
thunar/thunar-device-monitor.c | 21 ++---
thunar/thunar-device.c | 60 +++++++-------
thunar/thunar-emblem-chooser.c | 18 +++--
thunar/thunar-folder.c | 43 +++++-----
thunar/thunar-history.c | 33 ++++----
thunar/thunar-icon-factory.c | 36 +++++----
thunar/thunar-icon-renderer.c | 70 +++++++++--------
thunar/thunar-icon-view.c | 20 +++--
thunar/thunar-image.c | 21 +++--
thunar/thunar-launcher.c | 20 ++---
thunar/thunar-list-model.c | 18 ++---
thunar/thunar-location-button.c | 38 +++++----
thunar/thunar-location-buttons.c | 27 +++++--
thunar/thunar-location-entry.c | 25 +++++-
thunar/thunar-path-entry.c | 19 +++--
thunar/thunar-permissions-chooser.c | 35 +++++----
thunar/thunar-preferences.c | 96 +++++++++++------------
thunar/thunar-private.h | 5 ++
thunar/thunar-progress-view.c | 54 +++++++------
thunar/thunar-properties-dialog.c | 20 +++--
thunar/thunar-renamer-dialog.c | 52 ++++++------
thunar/thunar-renamer-model.c | 71 +++++++++--------
thunar/thunar-shortcuts-icon-renderer.c | 29 ++++---
thunar/thunar-shortcuts-model.c | 22 ++++--
thunar/thunar-shortcuts-pane.c | 34 ++++++--
thunar/thunar-size-label.c | 36 ++++-----
thunar/thunar-standard-view.c | 22 +++---
thunar/thunar-statusbar.c | 20 +++--
thunar/thunar-tree-model.c | 22 ++++--
thunar/thunar-tree-pane.c | 33 ++++++--
thunar/thunar-tree-view.c | 29 ++++---
thunar/thunar-window.c | 66 ++++++++--------
thunarx/thunarx-property-page.c | 37 +++++----
thunarx/thunarx-provider-module.c | 17 +++-
thunarx/thunarx-renamer.c | 36 +++++----
51 files changed, 1058 insertions(+), 759 deletions(-)
diff --git a/plugins/thunar-apr/thunar-apr-abstract-page.c b/plugins/thunar-apr/thunar-apr-abstract-page.c
index e16075e..4c38c9d 100644
--- a/plugins/thunar-apr/thunar-apr-abstract-page.c
+++ b/plugins/thunar-apr/thunar-apr-abstract-page.c
@@ -32,6 +32,7 @@ enum
{
PROP_0,
PROP_FILE,
+ N_PROPERTIES
};
/* Signal identifiers */
@@ -57,7 +58,8 @@ static void thunar_apr_abstract_page_file_changed (ThunarAprAbstractPage *a
-static guint abstract_page_signals[LAST_SIGNAL];
+static guint abstract_page_signals[LAST_SIGNAL];
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -83,11 +85,14 @@ thunar_apr_abstract_page_class_init (ThunarAprAbstractPageClass *klass)
* The #ThunarxFileInfo for the file being displayed by
* this property page.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILE,
- g_param_spec_object ("file", "file", "file",
- THUNARX_TYPE_FILE_INFO,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_FILE] =
+ g_param_spec_object ("file",
+ "file",
+ "file",
+ THUNARX_TYPE_FILE_INFO,
+ G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarAprAbstractPage::file-changed:
@@ -246,7 +251,7 @@ thunar_apr_abstract_page_set_file (ThunarAprAbstractPage *abstract_page,
}
/* notify listeners */
- g_object_notify (G_OBJECT (abstract_page), "file");
+ g_object_notify_by_pspec (G_OBJECT (abstract_page), property_pspecs[PROP_FILE]);
}
diff --git a/plugins/thunar-sbr/thunar-sbr-case-renamer.c b/plugins/thunar-sbr/thunar-sbr-case-renamer.c
index a2ca8bd..7eff809 100644
--- a/plugins/thunar-sbr/thunar-sbr-case-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-case-renamer.c
@@ -33,6 +33,7 @@ enum
{
PROP_0,
PROP_MODE,
+ N_PROPERTIES
};
@@ -65,6 +66,10 @@ struct _ThunarSbrCaseRenamer
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
THUNARX_DEFINE_TYPE (ThunarSbrCaseRenamer, thunar_sbr_case_renamer, THUNARX_TYPE_RENAMER);
@@ -88,12 +93,15 @@ thunar_sbr_case_renamer_class_init (ThunarSbrCaseRenamerClass *klass)
* The #ThunarSbrCaseRenamerMode for this
* #ThunarSbrCaseRenamer instance.
**/
- g_object_class_install_property (gobject_class,
- PROP_MODE,
- g_param_spec_enum ("mode", "mode", "mode",
- THUNAR_SBR_TYPE_CASE_RENAMER_MODE,
- THUNAR_SBR_CASE_RENAMER_MODE_LOWER,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_MODE] =
+ g_param_spec_enum ("mode",
+ "mode",
+ "mode",
+ THUNAR_SBR_TYPE_CASE_RENAMER_MODE,
+ THUNAR_SBR_CASE_RENAMER_MODE_LOWER,
+ G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -310,7 +318,7 @@ thunar_sbr_case_renamer_set_mode (ThunarSbrCaseRenamer *case_renamer,
case_renamer->mode = mode;
/* notify listeners */
- g_object_notify (G_OBJECT (case_renamer), "mode");
+ g_object_notify_by_pspec (G_OBJECT (case_renamer), property_pspecs[PROP_MODE]);
/* emit the "changed" signal */
thunarx_renamer_changed (THUNARX_RENAMER (case_renamer));
diff --git a/plugins/thunar-sbr/thunar-sbr-date-renamer.c b/plugins/thunar-sbr/thunar-sbr-date-renamer.c
index 69fe7e8..4e4d7fc 100644
--- a/plugins/thunar-sbr/thunar-sbr-date-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-date-renamer.c
@@ -52,6 +52,7 @@ enum
PROP_FORMAT,
PROP_OFFSET,
PROP_OFFSET_MODE,
+ N_PROPERTIES
};
@@ -95,6 +96,10 @@ struct _ThunarSbrDateRenamer
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
THUNARX_DEFINE_TYPE (ThunarSbrDateRenamer, thunar_sbr_date_renamer, THUNARX_TYPE_RENAMER);
@@ -118,54 +123,52 @@ thunar_sbr_date_renamer_class_init (ThunarSbrDateRenamerClass *klass)
*
* The #ThunarSbrDateMode to use.
**/
- g_object_class_install_property (gobject_class,
- PROP_MODE,
- g_param_spec_enum ("mode",
- "mode",
- "mode",
- THUNAR_SBR_TYPE_DATE_MODE,
- THUNAR_SBR_DATE_MODE_NOW,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_MODE] =
+ g_param_spec_enum ("mode",
+ "mode",
+ "mode",
+ THUNAR_SBR_TYPE_DATE_MODE,
+ THUNAR_SBR_DATE_MODE_NOW,
+ G_PARAM_READWRITE);
/**
* ThunarSbrDateRenamer:format:
*
* The date format to insert.
**/
- g_object_class_install_property (gobject_class,
- PROP_FORMAT,
- g_param_spec_string ("format",
- "format",
- "format",
- "%Y%m%d",
- G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
+ property_pspecs[PROP_FORMAT] =
+ g_param_spec_string ("format",
+ "format",
+ "format",
+ "%Y%m%d",
+ G_PARAM_CONSTRUCT | G_PARAM_READWRITE);
/**
* ThunarSbrDateRenamer:offset:
*
* The starting offset at which to insert/overwrite.
**/
- g_object_class_install_property (gobject_class,
- PROP_OFFSET,
- g_param_spec_uint ("offset",
- "offset",
- "offset",
- 0, G_MAXUINT, 0,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_OFFSET] =
+ g_param_spec_uint ("offset",
+ "offset",
+ "offset",
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE);
/**
* ThunarSbrDateRenamer:offset-mode:
*
* The offset mode for the renamer.
**/
- g_object_class_install_property (gobject_class,
- PROP_OFFSET_MODE,
- g_param_spec_enum ("offset-mode",
- "offset-mode",
- "offset-mode",
- THUNAR_SBR_TYPE_OFFSET_MODE,
- THUNAR_SBR_OFFSET_MODE_LEFT,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_OFFSET_MODE] =
+ g_param_spec_enum ("offset-mode",
+ "offset-mode",
+ "offset-mode",
+ THUNAR_SBR_TYPE_OFFSET_MODE,
+ THUNAR_SBR_OFFSET_MODE_LEFT,
+ G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -636,7 +639,7 @@ thunar_sbr_date_renamer_set_mode (ThunarSbrDateRenamer *date_renamer,
thunarx_renamer_changed (THUNARX_RENAMER (date_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (date_renamer), "mode");
+ g_object_notify_by_pspec (G_OBJECT (date_renamer), property_pspecs[PROP_MODE]);
}
}
@@ -684,7 +687,7 @@ thunar_sbr_date_renamer_set_format (ThunarSbrDateRenamer *date_renamer,
thunarx_renamer_changed (THUNARX_RENAMER (date_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (date_renamer), "format");
+ g_object_notify_by_pspec (G_OBJECT (date_renamer), property_pspecs[PROP_FORMAT]);
}
}
@@ -730,7 +733,7 @@ thunar_sbr_date_renamer_set_offset (ThunarSbrDateRenamer *date_renamer,
thunarx_renamer_changed (THUNARX_RENAMER (date_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (date_renamer), "offset");
+ g_object_notify_by_pspec (G_OBJECT (date_renamer), property_pspecs[PROP_OFFSET]);
}
}
@@ -776,6 +779,6 @@ thunar_sbr_date_renamer_set_offset_mode (ThunarSbrDateRenamer *date_renamer,
thunarx_renamer_changed (THUNARX_RENAMER (date_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (date_renamer), "offset-mode");
+ g_object_notify_by_pspec (G_OBJECT (date_renamer), property_pspecs[PROP_OFFSET_MODE]);
}
}
diff --git a/plugins/thunar-sbr/thunar-sbr-insert-renamer.c b/plugins/thunar-sbr/thunar-sbr-insert-renamer.c
index 88d49a8..5304866 100644
--- a/plugins/thunar-sbr/thunar-sbr-insert-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-insert-renamer.c
@@ -36,6 +36,7 @@ enum
PROP_OFFSET,
PROP_OFFSET_MODE,
PROP_TEXT,
+ N_PROPERTIES
};
@@ -72,6 +73,10 @@ struct _ThunarSbrInsertRenamer
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
THUNARX_DEFINE_TYPE (ThunarSbrInsertRenamer, thunar_sbr_insert_renamer, THUNARX_TYPE_RENAMER);
@@ -95,52 +100,52 @@ thunar_sbr_insert_renamer_class_init (ThunarSbrInsertRenamerClass *klass)
*
* The #ThunarSbrInsertMode to use.
**/
- g_object_class_install_property (gobject_class,
- PROP_MODE,
- g_param_spec_enum ("mode", "mode", "mode",
- THUNAR_SBR_TYPE_INSERT_MODE,
- THUNAR_SBR_INSERT_MODE_INSERT,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_MODE] =
+ g_param_spec_enum ("mode",
+ "mode",
+ "mode",
+ THUNAR_SBR_TYPE_INSERT_MODE,
+ THUNAR_SBR_INSERT_MODE_INSERT,
+ G_PARAM_READWRITE);
/**
* ThunarSbrInsertRenamer:offset:
*
* The starting offset at which to insert/overwrite.
**/
- g_object_class_install_property (gobject_class,
- PROP_OFFSET,
- g_param_spec_uint ("offset",
- "offset",
- "offset",
- 0, G_MAXUINT, 1,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_OFFSET] =
+ g_param_spec_uint ("offset",
+ "offset",
+ "offset",
+ 0, G_MAXUINT, 1,
+ G_PARAM_READWRITE);
/**
* ThunarSbrInsertRenamer:offset-mode:
*
* The offset mode for the renamer.
**/
- g_object_class_install_property (gobject_class,
- PROP_OFFSET_MODE,
- g_param_spec_enum ("offset-mode",
- "offset-mode",
- "offset-mode",
- THUNAR_SBR_TYPE_OFFSET_MODE,
- THUNAR_SBR_OFFSET_MODE_LEFT,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_OFFSET_MODE] =
+ g_param_spec_enum ("offset-mode",
+ "offset-mode",
+ "offset-mode",
+ THUNAR_SBR_TYPE_OFFSET_MODE,
+ THUNAR_SBR_OFFSET_MODE_LEFT,
+ G_PARAM_READWRITE);
/**
* ThunarSbrInsertRenamer:text:
*
* The text to insert/overwrite.
**/
- g_object_class_install_property (gobject_class,
- PROP_TEXT,
- g_param_spec_string ("text",
- "text",
- "text",
- NULL,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_TEXT] =
+ g_param_spec_string ("text",
+ "text",
+ "text",
+ NULL,
+ G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -428,7 +433,7 @@ thunar_sbr_insert_renamer_set_mode (ThunarSbrInsertRenamer *insert_renamer,
thunarx_renamer_changed (THUNARX_RENAMER (insert_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (insert_renamer), "mode");
+ g_object_notify_by_pspec (G_OBJECT (insert_renamer), property_pspecs[PROP_MODE]);
}
}
@@ -474,7 +479,7 @@ thunar_sbr_insert_renamer_set_offset (ThunarSbrInsertRenamer *insert_renamer,
thunarx_renamer_changed (THUNARX_RENAMER (insert_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (insert_renamer), "offset");
+ g_object_notify_by_pspec (G_OBJECT (insert_renamer), property_pspecs[PROP_OFFSET]);
}
}
@@ -520,7 +525,7 @@ thunar_sbr_insert_renamer_set_offset_mode (ThunarSbrInsertRenamer *insert_rename
thunarx_renamer_changed (THUNARX_RENAMER (insert_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (insert_renamer), "offset-mode");
+ g_object_notify_by_pspec (G_OBJECT (insert_renamer), property_pspecs[PROP_OFFSET_MODE]);
}
}
@@ -567,7 +572,7 @@ thunar_sbr_insert_renamer_set_text (ThunarSbrInsertRenamer *insert_renamer,
thunarx_renamer_changed (THUNARX_RENAMER (insert_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (insert_renamer), "text");
+ g_object_notify_by_pspec (G_OBJECT (insert_renamer), property_pspecs[PROP_TEXT]);
}
}
diff --git a/plugins/thunar-sbr/thunar-sbr-number-renamer.c b/plugins/thunar-sbr/thunar-sbr-number-renamer.c
index 5cec044..6d101e7 100644
--- a/plugins/thunar-sbr/thunar-sbr-number-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-number-renamer.c
@@ -46,6 +46,7 @@ enum
PROP_START,
PROP_TEXT,
PROP_TEXT_MODE,
+ N_PROPERTIES
};
@@ -87,6 +88,10 @@ struct _ThunarSbrNumberRenamer
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
THUNARX_DEFINE_TYPE (ThunarSbrNumberRenamer, thunar_sbr_number_renamer, THUNARX_TYPE_RENAMER);
@@ -114,52 +119,52 @@ thunar_sbr_number_renamer_class_init (ThunarSbrNumberRenamerClass *klass)
*
* The #ThunarSbrNumberMode to use.
**/
- g_object_class_install_property (gobject_class,
- PROP_MODE,
- g_param_spec_enum ("mode", "mode", "mode",
- THUNAR_SBR_TYPE_NUMBER_MODE,
- THUNAR_SBR_NUMBER_MODE_123,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_MODE] =
+ g_param_spec_enum ("mode",
+ "mode",
+ "mode",
+ THUNAR_SBR_TYPE_NUMBER_MODE,
+ THUNAR_SBR_NUMBER_MODE_123,
+ G_PARAM_READWRITE);
/**
* ThunarSbrNumberRenamer:start:
*
* The starting value according to the #ThunarSbrNumberMode.
**/
- g_object_class_install_property (gobject_class,
- PROP_START,
- g_param_spec_string ("start",
- "start",
- "start",
- "1",
- G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
+ property_pspecs[PROP_START] =
+ g_param_spec_string ("start",
+ "start",
+ "start",
+ "1",
+ G_PARAM_CONSTRUCT | G_PARAM_READWRITE);
/**
* ThunarSbrNumberRenamer:text:
*
* The additional text, depending on the #ThunarSbrTextMode.
**/
- g_object_class_install_property (gobject_class,
- PROP_TEXT,
- g_param_spec_string ("text",
- "text",
- "text",
- ". ",
- G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
+ property_pspecs[PROP_TEXT] =
+ g_param_spec_string ("text",
+ "text",
+ "text",
+ ". ",
+ G_PARAM_CONSTRUCT | G_PARAM_READWRITE);
/**
* ThunarSbrNumberRenamer:text-mode:
*
* The text mode for the renamer.
**/
- g_object_class_install_property (gobject_class,
- PROP_TEXT_MODE,
- g_param_spec_enum ("text-mode",
- "text-mode",
- "text-mode",
- THUNAR_SBR_TYPE_TEXT_MODE,
- THUNAR_SBR_TEXT_MODE_NTO,
- G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
+ property_pspecs[PROP_TEXT_MODE] =
+ g_param_spec_enum ("text-mode",
+ "text-mode",
+ "text-mode",
+ THUNAR_SBR_TYPE_TEXT_MODE,
+ THUNAR_SBR_TEXT_MODE_NTO,
+ G_PARAM_CONSTRUCT | G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -575,7 +580,7 @@ thunar_sbr_number_renamer_set_mode (ThunarSbrNumberRenamer *number_renamer,
thunar_sbr_number_renamer_update (number_renamer);
/* notify listeners */
- g_object_notify (G_OBJECT (number_renamer), "mode");
+ g_object_notify_by_pspec (G_OBJECT (number_renamer), property_pspecs[PROP_MODE]);
}
}
@@ -622,7 +627,7 @@ thunar_sbr_number_renamer_set_start (ThunarSbrNumberRenamer *number_renamer,
thunar_sbr_number_renamer_update (number_renamer);
/* notify listeners */
- g_object_notify (G_OBJECT (number_renamer), "start");
+ g_object_notify_by_pspec (G_OBJECT (number_renamer), property_pspecs[PROP_START]);
}
}
@@ -669,7 +674,7 @@ thunar_sbr_number_renamer_set_text (ThunarSbrNumberRenamer *number_renamer,
thunar_sbr_number_renamer_update (number_renamer);
/* notify listeners */
- g_object_notify (G_OBJECT (number_renamer), "text");
+ g_object_notify_by_pspec (G_OBJECT (number_renamer), property_pspecs[PROP_TEXT]);
}
}
@@ -715,7 +720,7 @@ thunar_sbr_number_renamer_set_text_mode (ThunarSbrNumberRenamer *number_renamer,
thunar_sbr_number_renamer_update (number_renamer);
/* notify listeners */
- g_object_notify (G_OBJECT (number_renamer), "text-mode");
+ g_object_notify_by_pspec (G_OBJECT (number_renamer), property_pspecs[PROP_TEXT_MODE]);
}
}
diff --git a/plugins/thunar-sbr/thunar-sbr-remove-renamer.c b/plugins/thunar-sbr/thunar-sbr-remove-renamer.c
index 4738abc..b2277f0 100644
--- a/plugins/thunar-sbr/thunar-sbr-remove-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-remove-renamer.c
@@ -36,6 +36,7 @@ enum
PROP_END_OFFSET_MODE,
PROP_START_OFFSET,
PROP_START_OFFSET_MODE,
+ N_PROPERTIES
};
@@ -75,6 +76,10 @@ struct _ThunarSbrRemoveRenamer
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
THUNARX_DEFINE_TYPE (ThunarSbrRemoveRenamer, thunar_sbr_remove_renamer, THUNARX_TYPE_RENAMER);
@@ -101,54 +106,52 @@ thunar_sbr_remove_renamer_class_init (ThunarSbrRemoveRenamerClass *klass)
*
* The end offset for the character removal.
**/
- g_object_class_install_property (gobject_class,
- PROP_END_OFFSET,
- g_param_spec_uint ("end-offset",
- "end-offset",
- "end-offset",
- 0, G_MAXUINT, 1,
- G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
+ property_pspecs[PROP_END_OFFSET] =
+ g_param_spec_uint ("end-offset",
+ "end-offset",
+ "end-offset",
+ 0, G_MAXUINT, 1,
+ G_PARAM_CONSTRUCT | G_PARAM_READWRITE);
/**
* ThunarSbrRemoveRenamer:end-offset-mode:
*
* The end offset mode for the character removal.
**/
- g_object_class_install_property (gobject_class,
- PROP_END_OFFSET_MODE,
- g_param_spec_enum ("end-offset-mode",
- "end-offset-mode",
- "end-offset-mode",
- THUNAR_SBR_TYPE_OFFSET_MODE,
- THUNAR_SBR_OFFSET_MODE_LEFT,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_END_OFFSET_MODE] =
+ g_param_spec_enum ("end-offset-mode",
+ "end-offset-mode",
+ "end-offset-mode",
+ THUNAR_SBR_TYPE_OFFSET_MODE,
+ THUNAR_SBR_OFFSET_MODE_LEFT,
+ G_PARAM_READWRITE);
/**
* ThunarSbrRemoveRenamer:start-offset:
*
* The start offset for the character removal.
**/
- g_object_class_install_property (gobject_class,
- PROP_START_OFFSET,
- g_param_spec_uint ("start-offset",
- "start-offset",
- "start-offset",
- 0, G_MAXUINT, 0,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_START_OFFSET] =
+ g_param_spec_uint ("start-offset",
+ "start-offset",
+ "start-offset",
+ 0, G_MAXUINT, 0,
+ G_PARAM_READWRITE);
/**
* ThunarSbrRemoveRenamer:start-offset-mode:
*
* The start offset mode for the character removal.
**/
- g_object_class_install_property (gobject_class,
- PROP_START_OFFSET_MODE,
- g_param_spec_enum ("start-offset-mode",
- "start-offset-mode",
- "start-offset-mode",
- THUNAR_SBR_TYPE_OFFSET_MODE,
- THUNAR_SBR_OFFSET_MODE_LEFT,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_START_OFFSET_MODE] =
+ g_param_spec_enum ("start-offset-mode",
+ "start-offset-mode",
+ "start-offset-mode",
+ THUNAR_SBR_TYPE_OFFSET_MODE,
+ THUNAR_SBR_OFFSET_MODE_LEFT,
+ G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -469,7 +472,7 @@ thunar_sbr_remove_renamer_set_end_offset (ThunarSbrRemoveRenamer *remove_renamer
thunar_sbr_remove_renamer_update (remove_renamer);
/* notify listeners */
- g_object_notify (G_OBJECT (remove_renamer), "end-offset");
+ g_object_notify_by_pspec (G_OBJECT (remove_renamer), property_pspecs[PROP_END_OFFSET]);
}
}
@@ -515,7 +518,7 @@ thunar_sbr_remove_renamer_set_end_offset_mode (ThunarSbrRemoveRenamer *remove_re
thunar_sbr_remove_renamer_update (remove_renamer);
/* notify listeners */
- g_object_notify (G_OBJECT (remove_renamer), "end-offset-mode");
+ g_object_notify_by_pspec (G_OBJECT (remove_renamer), property_pspecs[PROP_END_OFFSET_MODE]);
}
}
@@ -561,7 +564,7 @@ thunar_sbr_remove_renamer_set_start_offset (ThunarSbrRemoveRenamer *remove_renam
thunar_sbr_remove_renamer_update (remove_renamer);
/* notify listeners */
- g_object_notify (G_OBJECT (remove_renamer), "start-offset");
+ g_object_notify_by_pspec (G_OBJECT (remove_renamer), property_pspecs[PROP_START_OFFSET]);
}
}
@@ -607,7 +610,7 @@ thunar_sbr_remove_renamer_set_start_offset_mode (ThunarSbrRemoveRenamer *remove_
thunar_sbr_remove_renamer_update (remove_renamer);
/* notify listeners */
- g_object_notify (G_OBJECT (remove_renamer), "start-offset-mode");
+ g_object_notify_by_pspec (G_OBJECT (remove_renamer), property_pspecs[PROP_START_OFFSET_MODE]);
}
}
diff --git a/plugins/thunar-sbr/thunar-sbr-replace-renamer.c b/plugins/thunar-sbr/thunar-sbr-replace-renamer.c
index 0b2aca4..9f09f2e 100644
--- a/plugins/thunar-sbr/thunar-sbr-replace-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-replace-renamer.c
@@ -47,6 +47,7 @@ enum
PROP_PATTERN,
PROP_REPLACEMENT,
PROP_REGEXP,
+ N_PROPERTIES
};
@@ -99,6 +100,10 @@ struct _ThunarSbrReplaceRenamer
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
THUNARX_DEFINE_TYPE (ThunarSbrReplaceRenamer, thunar_sbr_replace_renamer, THUNARX_TYPE_RENAMER);
@@ -126,52 +131,50 @@ thunar_sbr_replace_renamer_class_init (ThunarSbrReplaceRenamerClass *klass)
*
* Whether to use case sensitive search and replace.
**/
- g_object_class_install_property (gobject_class,
- PROP_CASE_SENSITIVE,
- g_param_spec_boolean ("case-sensitive",
- "case-sensitive",
- "case-sensitive",
- FALSE,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_CASE_SENSITIVE] =
+ g_param_spec_boolean ("case-sensitive",
+ "case-sensitive",
+ "case-sensitive",
+ FALSE,
+ G_PARAM_READWRITE);
/**
* ThunarSbrReplaceRenamer:pattern:
*
* The search pattern.
**/
- g_object_class_install_property (gobject_class,
- PROP_PATTERN,
- g_param_spec_string ("pattern",
- "pattern",
- "pattern",
- NULL,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_PATTERN] =
+ g_param_spec_string ("pattern",
+ "pattern",
+ "pattern",
+ NULL,
+ G_PARAM_READWRITE);
/**
* ThunarSbrReplaceRenamer:replacement:
*
* The replacement text.
**/
- g_object_class_install_property (gobject_class,
- PROP_REPLACEMENT,
- g_param_spec_string ("replacement",
- "replacement",
- "replacement",
- NULL,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_REPLACEMENT] =
+ g_param_spec_string ("replacement",
+ "replacement",
+ "replacement",
+ NULL,
+ G_PARAM_READWRITE);
/**
* ThunarSbrReplaceRenamer:regexp:
*
* Whether to use regular expressions.
**/
- g_object_class_install_property (gobject_class,
- PROP_REGEXP,
- g_param_spec_boolean ("regexp",
- "regexp",
- "regexp",
- FALSE,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_REGEXP] =
+ g_param_spec_boolean ("regexp",
+ "regexp",
+ "regexp",
+ FALSE,
+ G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -713,7 +716,7 @@ thunar_sbr_replace_renamer_set_case_sensitive (ThunarSbrReplaceRenamer *replace_
thunarx_renamer_changed (THUNARX_RENAMER (replace_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (replace_renamer), "case-sensitive");
+ g_object_notify_by_pspec (G_OBJECT (replace_renamer), property_pspecs[PROP_CASE_SENSITIVE]);
}
}
@@ -766,7 +769,7 @@ thunar_sbr_replace_renamer_set_pattern (ThunarSbrReplaceRenamer *replace_renamer
thunarx_renamer_changed (THUNARX_RENAMER (replace_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (replace_renamer), "pattern");
+ g_object_notify_by_pspec (G_OBJECT (replace_renamer), property_pspecs[PROP_PATTERN]);
}
}
@@ -822,7 +825,7 @@ thunar_sbr_replace_renamer_set_regexp (ThunarSbrReplaceRenamer *replace_renamer,
thunarx_renamer_changed (THUNARX_RENAMER (replace_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (replace_renamer), "regexp");
+ g_object_notify_by_pspec (G_OBJECT (replace_renamer), property_pspecs[PROP_REGEXP]);
}
}
@@ -870,7 +873,7 @@ thunar_sbr_replace_renamer_set_replacement (ThunarSbrReplaceRenamer *replace_ren
thunarx_renamer_changed (THUNARX_RENAMER (replace_renamer));
/* notify listeners */
- g_object_notify (G_OBJECT (replace_renamer), "replacement");
+ g_object_notify_by_pspec (G_OBJECT (replace_renamer), property_pspecs[PROP_REPLACEMENT]);
}
}
diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index 71bb616..3064aad 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -75,6 +75,7 @@ enum
{
PROP_0,
PROP_DAEMON,
+ N_PROPERTIES
};
@@ -165,8 +166,9 @@ struct _ThunarApplication
-static GQuark thunar_application_screen_quark;
-static GQuark thunar_application_startup_id_quark;
+static GQuark thunar_application_screen_quark;
+static GQuark thunar_application_startup_id_quark;
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -199,13 +201,14 @@ thunar_application_class_init (ThunarApplicationClass *klass)
* application should terminate once the last window is
* closed.
**/
- g_object_class_install_property (gobject_class,
- PROP_DAEMON,
- g_param_spec_boolean ("daemon",
- "daemon",
- "daemon",
- FALSE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_DAEMON] =
+ g_param_spec_boolean ("daemon",
+ "daemon",
+ "daemon",
+ FALSE,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -870,7 +873,7 @@ thunar_application_set_daemon (ThunarApplication *application,
if (application->daemon != daemonize)
{
application->daemon = daemonize;
- g_object_notify (G_OBJECT (application), "daemon");
+ _g_object_notify_by_pspec (G_OBJECT (application), property_pspecs[PROP_DAEMON]);
}
}
diff --git a/thunar/thunar-chooser-button.c b/thunar/thunar-chooser-button.c
index f2993b8..4a1b8d9 100644
--- a/thunar/thunar-chooser-button.c
+++ b/thunar/thunar-chooser-button.c
@@ -40,6 +40,7 @@ enum
{
PROP_0,
PROP_FILE,
+ N_PROPERTIES
};
@@ -96,6 +97,10 @@ struct _ThunarChooserButton
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarChooserButton, thunar_chooser_button, GTK_TYPE_COMBO_BOX)
@@ -120,11 +125,14 @@ thunar_chooser_button_class_init (ThunarChooserButtonClass *klass)
* The #ThunarFile for which a preferred application should
* be chosen.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILE,
- g_param_spec_object ("file", "file", "file",
- THUNAR_TYPE_FILE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FILE] =
+ g_param_spec_object ("file",
+ "file",
+ "file",
+ THUNAR_TYPE_FILE,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -575,7 +583,7 @@ thunar_chooser_button_set_file (ThunarChooserButton *chooser_button,
}
/* notify listeners */
- g_object_notify (G_OBJECT (chooser_button), "file");
+ _g_object_notify_by_pspec (G_OBJECT (chooser_button), property_pspecs[PROP_FILE]);
}
diff --git a/thunar/thunar-chooser-dialog.c b/thunar/thunar-chooser-dialog.c
index 1ce3f32..3a4a049 100644
--- a/thunar/thunar-chooser-dialog.c
+++ b/thunar/thunar-chooser-dialog.c
@@ -47,6 +47,7 @@ enum
PROP_0,
PROP_FILE,
PROP_OPEN,
+ N_PROPERTIES
};
@@ -124,6 +125,10 @@ struct _ThunarChooserDialog
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarChooserDialog, thunar_chooser_dialog, THUNAR_TYPE_ABSTRACT_DIALOG)
@@ -151,22 +156,26 @@ thunar_chooser_dialog_class_init (ThunarChooserDialogClass *klass)
*
* The #ThunarFile for which an application should be chosen.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILE,
- g_param_spec_object ("file", "file", "file",
- THUNAR_TYPE_FILE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FILE] =
+ g_param_spec_object ("file",
+ "file",
+ "file",
+ THUNAR_TYPE_FILE,
+ EXO_PARAM_READWRITE);
/**
* ThunarChooserDialog::open:
*
* Whether the chooser should open the specified file.
**/
- g_object_class_install_property (gobject_class,
- PROP_OPEN,
- g_param_spec_boolean ("open", "open", "open",
- FALSE,
- G_PARAM_CONSTRUCT | EXO_PARAM_READWRITE));
+ property_pspecs[PROP_OPEN] =
+ g_param_spec_boolean ("open",
+ "open",
+ "open",
+ FALSE,
+ G_PARAM_CONSTRUCT | EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -1118,7 +1127,7 @@ thunar_chooser_dialog_set_file (ThunarChooserDialog *dialog,
thunar_chooser_dialog_update_header (dialog);
/* notify listeners */
- g_object_notify (G_OBJECT (dialog), "file");
+ _g_object_notify_by_pspec (G_OBJECT (dialog), property_pspecs[PROP_FILE]);
}
@@ -1160,7 +1169,7 @@ thunar_chooser_dialog_set_open (ThunarChooserDialog *dialog,
gtk_button_set_label (GTK_BUTTON (dialog->accept_button), open ? GTK_STOCK_OPEN : GTK_STOCK_OK);
/* notify listeners */
- g_object_notify (G_OBJECT (dialog), "open");
+ _g_object_notify_by_pspec (G_OBJECT (dialog), property_pspecs[PROP_OPEN]);
}
diff --git a/thunar/thunar-chooser-model.c b/thunar/thunar-chooser-model.c
index e3ae672..aaad2bf 100644
--- a/thunar/thunar-chooser-model.c
+++ b/thunar/thunar-chooser-model.c
@@ -41,6 +41,7 @@ enum
{
PROP_0,
PROP_CONTENT_TYPE,
+ N_PROPERTIES
};
@@ -74,6 +75,10 @@ struct _ThunarChooserModel
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarChooserModel, thunar_chooser_model, GTK_TYPE_TREE_STORE)
@@ -94,14 +99,15 @@ thunar_chooser_model_class_init (ThunarChooserModelClass *klass)
*
* The content type for the model.
**/
- g_object_class_install_property (gobject_class,
- PROP_CONTENT_TYPE,
- g_param_spec_string ("content-type",
- "content-type",
- "content-type",
- NULL,
- G_PARAM_CONSTRUCT_ONLY |
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_CONTENT_TYPE] =
+ g_param_spec_string ("content-type",
+ "content-type",
+ "content-type",
+ NULL,
+ G_PARAM_CONSTRUCT_ONLY |
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
diff --git a/thunar/thunar-clipboard-manager.c b/thunar/thunar-clipboard-manager.c
index 19b50d0..cb9e32d 100644
--- a/thunar/thunar-clipboard-manager.c
+++ b/thunar/thunar-clipboard-manager.c
@@ -42,6 +42,7 @@ enum
{
PROP_0,
PROP_CAN_PASTE,
+ N_PROPERTIES
};
enum
@@ -124,8 +125,11 @@ static const GtkTargetEntry clipboard_targets[] =
{ "UTF8_STRING", 0, TARGET_UTF8_STRING }
};
-static GQuark thunar_clipboard_manager_quark = 0;
-static guint manager_signals[LAST_SIGNAL];
+
+
+static GQuark thunar_clipboard_manager_quark = 0;
+static guint manager_signals[LAST_SIGNAL];
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -150,11 +154,14 @@ thunar_clipboard_manager_class_init (ThunarClipboardManagerClass *klass)
* this #ThunarClipboardManager can be pasted into a folder
* displayed by a #ThunarView.
**/
- g_object_class_install_property (gobject_class,
- PROP_CAN_PASTE,
- g_param_spec_boolean ("can-paste", "can-pase", "can-paste",
- FALSE,
- EXO_PARAM_READABLE));
+ property_pspecs[PROP_CAN_PASTE] =
+ g_param_spec_boolean ("can-paste",
+ "can-pase",
+ "can-paste",
+ FALSE,
+ EXO_PARAM_READABLE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarClipboardManager::changed:
@@ -398,7 +405,7 @@ thunar_clipboard_manager_targets_received (GtkClipboard *clipboard,
/* notify listeners that we have a new clipboard state */
g_signal_emit (manager, manager_signals[CHANGED], 0);
- g_object_notify (G_OBJECT (manager), "can-paste");
+ _g_object_notify_by_pspec (G_OBJECT (manager), property_pspecs[PROP_CAN_PASTE]);
/* drop the reference taken for the callback */
g_object_unref (manager);
diff --git a/thunar/thunar-create-dialog.c b/thunar/thunar-create-dialog.c
index f31f337..e0ea3e4 100644
--- a/thunar/thunar-create-dialog.c
+++ b/thunar/thunar-create-dialog.c
@@ -39,6 +39,7 @@ enum
PROP_0,
PROP_FILENAME,
PROP_CONTENT_TYPE,
+ N_PROPERTIES
};
@@ -81,6 +82,10 @@ struct _ThunarCreateDialog
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarCreateDialog, thunar_create_dialog, THUNAR_TYPE_ABSTRACT_DIALOG)
@@ -104,26 +109,26 @@ thunar_create_dialog_class_init (ThunarCreateDialogClass *klass)
*
* The filename entered in the dialog's entry box.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILENAME,
- g_param_spec_string ("filename",
- "filename",
- "filename",
- NULL,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FILENAME] =
+ g_param_spec_string ("filename",
+ "filename",
+ "filename",
+ NULL,
+ EXO_PARAM_READWRITE);
/**
* ThunarCreateDialog::content-type:
*
* The content type of the file to create.
**/
- g_object_class_install_property (gobject_class,
- PROP_CONTENT_TYPE,
- g_param_spec_string ("content-type",
- "content-type",
- "content-type",
- NULL,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_CONTENT_TYPE] =
+ g_param_spec_string ("content-type",
+ "content-type",
+ "content-type",
+ NULL,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -352,7 +357,7 @@ thunar_create_dialog_set_filename (ThunarCreateDialog *dialog,
}
/* notify listeners */
- g_object_notify (G_OBJECT (dialog), "filename");
+ _g_object_notify_by_pspec (G_OBJECT (dialog), property_pspecs[PROP_FILENAME]);
}
@@ -381,7 +386,7 @@ thunar_create_dialog_set_content_type (ThunarCreateDialog *dialog,
thunar_create_dialog_update_image (dialog);
/* notify listeners */
- g_object_notify (G_OBJECT (dialog), "content-type");
+ _g_object_notify_by_pspec (G_OBJECT (dialog), property_pspecs[PROP_CONTENT_TYPE]);
}
diff --git a/thunar/thunar-desktop-background.c b/thunar/thunar-desktop-background.c
index b0a7a3c..0e19823 100644
--- a/thunar/thunar-desktop-background.c
+++ b/thunar/thunar-desktop-background.c
@@ -48,6 +48,7 @@ enum
{
PROP_0,
PROP_SOURCE_WINDOW,
+ N_PROPERTIES
};
@@ -136,6 +137,10 @@ BackgroundAsync;
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarDesktopBackground, thunar_desktop_background, G_TYPE_OBJECT)
@@ -151,12 +156,15 @@ thunar_desktop_background_class_init (ThunarDesktopBackgroundClass *klass)
gobject_class->get_property = thunar_desktop_background_get_property;
gobject_class->set_property = thunar_desktop_background_set_property;
- g_object_class_install_property (gobject_class,
- PROP_SOURCE_WINDOW,
- g_param_spec_object ("source-window", NULL, NULL,
- GDK_TYPE_WINDOW,
- EXO_PARAM_READWRITE
- | G_PARAM_CONSTRUCT_ONLY));
+ property_pspecs[PROP_SOURCE_WINDOW] =
+ g_param_spec_object ("source-window",
+ NULL,
+ NULL,
+ GDK_TYPE_WINDOW,
+ EXO_PARAM_READWRITE
+ | G_PARAM_CONSTRUCT_ONLY);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
diff --git a/thunar/thunar-desktop-preferences-dialog.c b/thunar/thunar-desktop-preferences-dialog.c
index 79c2f77..53d5532 100644
--- a/thunar/thunar-desktop-preferences-dialog.c
+++ b/thunar/thunar-desktop-preferences-dialog.c
@@ -35,6 +35,7 @@ enum
{
PROP_0,
PROP_CYCLE_TIME,
+ N_PROPERTIES
};
@@ -113,6 +114,10 @@ default_cycle_times[] =
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarDesktopPreferencesDialog, thunar_desktop_preferences_dialog, XFCE_TYPE_TITLED_DIALOG)
@@ -138,13 +143,16 @@ thunar_desktop_preferences_dialog_class_init (ThunarDesktopPreferencesDialogClas
gtkdialog_class = GTK_DIALOG_CLASS (klass);
gtkdialog_class->response = thunar_desktop_preferences_dialog_response;
- g_object_class_install_property (gobject_class,
- PROP_CYCLE_TIME,
- g_param_spec_uint ("cycle-time",
- NULL, NULL,
- 0, 86400,
- DEFAULT_BACKGROUND_CYCLE_TIME,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_CYCLE_TIME] =
+ g_param_spec_uint ("cycle-time",
+ NULL,
+ NULL,
+ 0,
+ 86400,
+ DEFAULT_BACKGROUND_CYCLE_TIME,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -718,7 +726,7 @@ thunar_desktop_preferences_dialog_cycle_time_changed (ThunarDesktopPreferencesDi
dialog->cycle_time_sec = default_cycle_times[active].seconds;
/* save xfconf setting */
- g_object_notify (G_OBJECT (dialog), "cycle-time");
+ _g_object_notify_by_pspec (G_OBJECT (dialog), property_pspecs[PROP_CYCLE_TIME]);
}
diff --git a/thunar/thunar-details-view.c b/thunar/thunar-details-view.c
index 05a539b..d256209 100644
--- a/thunar/thunar-details-view.c
+++ b/thunar/thunar-details-view.c
@@ -38,6 +38,7 @@ enum
{
PROP_0,
PROP_FIXED_COLUMNS,
+ N_PROPERTIES
};
@@ -136,6 +137,10 @@ static const GtkActionEntry action_entries[] =
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarDetailsView, thunar_details_view, THUNAR_TYPE_STANDARD_VIEW)
@@ -175,13 +180,14 @@ thunar_details_view_class_init (ThunarDetailsViewClass *klass)
*
* %TRUE to use fixed column widths.
**/
- g_object_class_install_property (gobject_class,
- PROP_FIXED_COLUMNS,
- g_param_spec_boolean ("fixed-columns",
- "fixed-columns",
- "fixed-columns",
- FALSE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FIXED_COLUMNS] =
+ g_param_spec_boolean ("fixed-columns",
+ "fixed-columns",
+ "fixed-columns",
+ FALSE,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -938,6 +944,6 @@ thunar_details_view_set_fixed_columns (ThunarDetailsView *details_view,
gtk_tree_view_set_fixed_height_mode (GTK_TREE_VIEW (GTK_BIN (details_view)->child), fixed_columns);
/* notify listeners */
- g_object_notify (G_OBJECT (details_view), "fixed-columns");
+ _g_object_notify_by_pspec (G_OBJECT (details_view), property_pspecs[PROP_FIXED_COLUMNS]);
}
}
diff --git a/thunar/thunar-device-monitor.c b/thunar/thunar-device-monitor.c
index 6ac8e82..26bab70 100644
--- a/thunar/thunar-device-monitor.c
+++ b/thunar/thunar-device-monitor.c
@@ -46,7 +46,8 @@ enum
enum
{
PROP_0,
- PROP_HIDDEN_DEVICES
+ PROP_HIDDEN_DEVICES,
+ N_PROPERTIES
};
@@ -122,7 +123,8 @@ struct _ThunarDeviceMonitor
-static guint device_monitor_signals[LAST_SIGNAL];
+static guint device_monitor_signals[LAST_SIGNAL];
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -140,13 +142,14 @@ thunar_device_monitor_class_init (ThunarDeviceMonitorClass *klass)
gobject_class->get_property = thunar_device_monitor_get_property;
gobject_class->set_property = thunar_device_monitor_set_property;
- g_object_class_install_property (gobject_class,
- PROP_HIDDEN_DEVICES,
- g_param_spec_boxed ("hidden-devices",
- NULL,
- NULL,
- G_TYPE_STRV,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_HIDDEN_DEVICES] =
+ g_param_spec_boxed ("hidden-devices",
+ NULL,
+ NULL,
+ G_TYPE_STRV,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
device_monitor_signals[DEVICE_ADDED] =
g_signal_new (I_("device-added"),
diff --git a/thunar/thunar-device.c b/thunar/thunar-device.c
index 94dd9a7..06991f7 100644
--- a/thunar/thunar-device.c
+++ b/thunar/thunar-device.c
@@ -39,7 +39,8 @@ enum
PROP_0,
PROP_DEVICE,
PROP_HIDDEN,
- PROP_KIND
+ PROP_KIND,
+ N_PROPERTIES
};
@@ -93,6 +94,10 @@ ThunarDeviceOperation;
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarDevice, thunar_device, G_TYPE_OBJECT)
@@ -107,33 +112,32 @@ thunar_device_class_init (ThunarDeviceClass *klass)
gobject_class->get_property = thunar_device_get_property;
gobject_class->set_property = thunar_device_set_property;
- g_object_class_install_property (gobject_class,
- PROP_DEVICE,
- g_param_spec_object ("device",
- "device",
- "device",
- G_TYPE_OBJECT,
- EXO_PARAM_READWRITE
- | G_PARAM_CONSTRUCT_ONLY));
-
- g_object_class_install_property (gobject_class,
- PROP_HIDDEN,
- g_param_spec_boolean ("hidden",
- "hidden",
- "hidden",
- FALSE,
- EXO_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class,
- PROP_KIND,
- g_param_spec_uint ("kind",
- "kind",
- "kind",
- THUNAR_DEVICE_KIND_VOLUME,
- THUNAR_DEVICE_KIND_MOUNT_REMOTE,
- THUNAR_DEVICE_KIND_VOLUME,
- EXO_PARAM_READWRITE
- | G_PARAM_CONSTRUCT_ONLY));
+ property_pspecs[PROP_DEVICE] =
+ g_param_spec_object ("device",
+ "device",
+ "device",
+ G_TYPE_OBJECT,
+ EXO_PARAM_READWRITE
+ | G_PARAM_CONSTRUCT_ONLY);
+
+ property_pspecs[PROP_HIDDEN] =
+ g_param_spec_boolean ("hidden",
+ "hidden",
+ "hidden",
+ FALSE,
+ EXO_PARAM_READWRITE);
+
+ property_pspecs[PROP_KIND] =
+ g_param_spec_uint ("kind",
+ "kind",
+ "kind",
+ THUNAR_DEVICE_KIND_VOLUME,
+ THUNAR_DEVICE_KIND_MOUNT_REMOTE,
+ THUNAR_DEVICE_KIND_VOLUME,
+ EXO_PARAM_READWRITE
+ | G_PARAM_CONSTRUCT_ONLY);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
diff --git a/thunar/thunar-emblem-chooser.c b/thunar/thunar-emblem-chooser.c
index 6235bac..c599bcd 100644
--- a/thunar/thunar-emblem-chooser.c
+++ b/thunar/thunar-emblem-chooser.c
@@ -39,6 +39,7 @@ enum
{
PROP_0,
PROP_FILES,
+ N_PROPERTIES
};
@@ -84,6 +85,10 @@ struct _ThunarEmblemChooser
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarEmblemChooser, thunar_emblem_chooser, GTK_TYPE_SCROLLED_WINDOW)
@@ -108,11 +113,14 @@ thunar_emblem_chooser_class_init (ThunarEmblemChooserClass *klass)
*
* The file for which emblems should be choosen.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILES,
- g_param_spec_boxed ("files", "files", "files",
- THUNARX_TYPE_FILE_INFO_LIST,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FILES] =
+ g_param_spec_boxed ("files",
+ "files",
+ "files",
+ THUNARX_TYPE_FILE_INFO_LIST,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
diff --git a/thunar/thunar-folder.c b/thunar/thunar-folder.c
index 3c417a1..d44312e 100644
--- a/thunar/thunar-folder.c
+++ b/thunar/thunar-folder.c
@@ -38,6 +38,7 @@ enum
PROP_0,
PROP_CORRESPONDING_FILE,
PROP_LOADING,
+ N_PROPERTIES
};
/* signal identifiers */
@@ -112,8 +113,9 @@ struct _ThunarFolder
-static guint folder_signals[LAST_SIGNAL];
-static GQuark thunar_folder_quark;
+static guint folder_signals[LAST_SIGNAL];
+static GQuark thunar_folder_quark;
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -139,15 +141,14 @@ thunar_folder_class_init (ThunarFolderClass *klass)
*
* The #ThunarFile referring to the #ThunarFolder.
**/
- g_object_class_install_property (gobject_class,
- PROP_CORRESPONDING_FILE,
- g_param_spec_object ("corresponding-file",
- "corresponding-file",
- "corresponding-file",
- THUNAR_TYPE_FILE,
- G_PARAM_READABLE
- | G_PARAM_WRITABLE
- | G_PARAM_CONSTRUCT_ONLY));
+ property_pspecs[PROP_CORRESPONDING_FILE] =
+ g_param_spec_object ("corresponding-file",
+ "corresponding-file",
+ "corresponding-file",
+ THUNAR_TYPE_FILE,
+ G_PARAM_READABLE
+ | G_PARAM_WRITABLE
+ | G_PARAM_CONSTRUCT_ONLY);
/**
* ThunarFolder::loading:
@@ -155,13 +156,15 @@ thunar_folder_class_init (ThunarFolderClass *klass)
* Tells whether the contents of the #ThunarFolder are
* currently being loaded.
**/
- g_object_class_install_property (gobject_class,
- PROP_LOADING,
- g_param_spec_boolean ("loading",
- "loading",
- "loading",
- FALSE,
- EXO_PARAM_READABLE));
+ property_pspecs[PROP_LOADING] =
+ g_param_spec_boolean ("loading",
+ "loading",
+ "loading",
+ FALSE,
+ EXO_PARAM_READABLE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
+
/**
* ThunarFolder::destroy:
* @folder : a #ThunarFolder.
@@ -539,7 +542,7 @@ thunar_folder_finished (GObject *source_object,
g_signal_connect (folder->monitor, "changed", G_CALLBACK (thunar_folder_monitor), folder);
/* tell the consumers that we have loaded the directory */
- g_object_notify (G_OBJECT (folder), "loading");
+ _g_object_notify_by_pspec (G_OBJECT (folder), property_pspecs[PROP_LOADING]);
}
@@ -902,5 +905,5 @@ thunar_folder_reload (ThunarFolder *folder)
thunar_tasks_list_directory (folder->task, thunar_file_get_file (folder->corresponding_file));
/* tell all consumers that we're loading */
- g_object_notify (G_OBJECT (folder), "loading");
+ _g_object_notify_by_pspec (G_OBJECT (folder), property_pspecs[PROP_LOADING]);
}
diff --git a/thunar/thunar-history.c b/thunar/thunar-history.c
index bb6012a..b5d56c3 100644
--- a/thunar/thunar-history.c
+++ b/thunar/thunar-history.c
@@ -37,6 +37,7 @@ enum
PROP_0,
PROP_ACTION_GROUP,
PROP_CURRENT_DIRECTORY,
+ N_PROPERTIES
};
@@ -102,8 +103,9 @@ G_DEFINE_TYPE_WITH_CODE (ThunarHistory, thunar_history, G_TYPE_OBJECT,
-static GQuark thunar_history_display_name_quark;
-static GQuark thunar_history_gfile_quark;
+static GQuark thunar_history_display_name_quark;
+static GQuark thunar_history_gfile_quark;
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -111,6 +113,7 @@ static void
thunar_history_class_init (ThunarHistoryClass *klass)
{
GObjectClass *gobject_class;
+ gpointer g_iface;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = thunar_history_dispose;
@@ -127,22 +130,24 @@ thunar_history_class_init (ThunarHistoryClass *klass)
* The #GtkActionGroup to which the #ThunarHistory<!---->s
* actions "back" and "forward" should be connected.
**/
- g_object_class_install_property (gobject_class,
- PROP_ACTION_GROUP,
- g_param_spec_object ("action-group",
- "action-group",
- "action-group",
- GTK_TYPE_ACTION_GROUP,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_ACTION_GROUP] =
+ g_param_spec_object ("action-group",
+ "action-group",
+ "action-group",
+ GTK_TYPE_ACTION_GROUP,
+ EXO_PARAM_READWRITE);
/**
* ThunarHistory::current-directory:
*
* Inherited from #ThunarNavigator.
**/
- g_object_class_override_property (gobject_class,
- PROP_CURRENT_DIRECTORY,
- "current-directory");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_NAVIGATOR);
+ property_pspecs[PROP_CURRENT_DIRECTORY] =
+ g_param_spec_override ("current-directory",
+ g_object_interface_find_property (g_iface, "current-directory"));
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -337,7 +342,7 @@ thunar_history_set_current_directory (ThunarNavigator *navigator,
}
/* notify listeners */
- g_object_notify (G_OBJECT (history), "current-directory");
+ _g_object_notify_by_pspec (G_OBJECT (history), property_pspecs[PROP_CURRENT_DIRECTORY]);
}
@@ -735,7 +740,7 @@ thunar_history_set_action_group (ThunarHistory *history,
}
/* notify listeners */
- g_object_notify (G_OBJECT (history), "action-group");
+ _g_object_notify_by_pspec (G_OBJECT (history), property_pspecs[PROP_ACTION_GROUP]);
}
diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c
index 62aefdd..50b2b39 100644
--- a/thunar/thunar-icon-factory.c
+++ b/thunar/thunar-icon-factory.c
@@ -49,6 +49,7 @@ enum
PROP_0,
PROP_ICON_THEME,
PROP_THUMBNAIL_MODE,
+ N_PROPERTIES
};
@@ -134,8 +135,9 @@ ThunarIconStore;
-static GQuark thunar_icon_factory_quark = 0;
-static GQuark thunar_icon_factory_store_quark = 0;
+static GQuark thunar_icon_factory_quark = 0;
+static GQuark thunar_icon_factory_store_quark = 0;
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -162,13 +164,12 @@ thunar_icon_factory_class_init (ThunarIconFactoryClass *klass)
* The #GtkIconTheme on which the given #ThunarIconFactory instance operates
* on.
**/
- g_object_class_install_property (gobject_class,
- PROP_ICON_THEME,
- g_param_spec_object ("icon-theme",
- "icon-theme",
- "icon-theme",
- GTK_TYPE_ICON_THEME,
- EXO_PARAM_READABLE));
+ property_pspecs[PROP_ICON_THEME] =
+ g_param_spec_object ("icon-theme",
+ "icon-theme",
+ "icon-theme",
+ GTK_TYPE_ICON_THEME,
+ EXO_PARAM_READABLE);
/**
* ThunarIconFactory:thumbnail-mode:
@@ -176,14 +177,15 @@ thunar_icon_factory_class_init (ThunarIconFactoryClass *klass)
* Whether this #ThunarIconFactory will try to generate and load thumbnails
* when loading icons for #ThunarFile<!---->s.
**/
- g_object_class_install_property (gobject_class,
- PROP_THUMBNAIL_MODE,
- g_param_spec_enum ("thumbnail-mode",
- "thumbnail-mode",
- "thumbnail-mode",
- THUNAR_TYPE_THUMBNAIL_MODE,
- THUNAR_THUMBNAIL_MODE_ONLY_LOCAL,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_THUMBNAIL_MODE] =
+ g_param_spec_enum ("thumbnail-mode",
+ "thumbnail-mode",
+ "thumbnail-mode",
+ THUNAR_TYPE_THUMBNAIL_MODE,
+ THUNAR_THUMBNAIL_MODE_ONLY_LOCAL,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
diff --git a/thunar/thunar-icon-renderer.c b/thunar/thunar-icon-renderer.c
index f42cdc2..29ace15 100644
--- a/thunar/thunar-icon-renderer.c
+++ b/thunar/thunar-icon-renderer.c
@@ -38,6 +38,7 @@ enum
PROP_EMBLEMS,
PROP_FOLLOW_STATE,
PROP_SIZE,
+ N_PROPERTIES
};
@@ -68,6 +69,10 @@ static void thunar_icon_renderer_render (GtkCellRenderer *rendere
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarIconRenderer, thunar_icon_renderer, GTK_TYPE_CELL_RENDERER)
@@ -93,37 +98,36 @@ thunar_icon_renderer_class_init (ThunarIconRendererClass *klass)
* The file which should be rendered in the drop
* accept state.
**/
- g_object_class_install_property (gobject_class,
- PROP_DROP_FILE,
- g_param_spec_object ("drop-file",
- "drop-file",
- "drop-file",
- THUNAR_TYPE_FILE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_DROP_FILE] =
+ g_param_spec_object ("drop-file",
+ "drop-file",
+ "drop-file",
+ THUNAR_TYPE_FILE,
+ EXO_PARAM_READWRITE);
/**
* ThunarIconRenderer:file:
*
* The file whose icon to render.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILE,
- g_param_spec_object ("file", "file", "file",
- THUNAR_TYPE_FILE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FILE] =
+ g_param_spec_object ("file",
+ "file",
+ "file",
+ THUNAR_TYPE_FILE,
+ EXO_PARAM_READWRITE);
/**
* ThunarIconRenderer:emblems:
*
* Specifies whether to render emblems in addition to the file icons.
**/
- g_object_class_install_property (gobject_class,
- PROP_EMBLEMS,
- g_param_spec_boolean ("emblems",
- "emblems",
- "emblems",
- TRUE,
- G_PARAM_CONSTRUCT | EXO_PARAM_READWRITE));
+ property_pspecs[PROP_EMBLEMS] =
+ g_param_spec_boolean ("emblems",
+ "emblems",
+ "emblems",
+ TRUE,
+ G_PARAM_CONSTRUCT | EXO_PARAM_READWRITE);
/**
* ThunarIconRenderer:follow-state:
@@ -133,13 +137,12 @@ thunar_icon_renderer_class_init (ThunarIconRendererClass *klass)
* for #ExoIconView, which doesn't draw any item state indicators
* itself.
**/
- g_object_class_install_property (gobject_class,
- PROP_FOLLOW_STATE,
- g_param_spec_boolean ("follow-state",
- "follow-state",
- "follow-state",
- FALSE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FOLLOW_STATE] =
+ g_param_spec_boolean ("follow-state",
+ "follow-state",
+ "follow-state",
+ FALSE,
+ EXO_PARAM_READWRITE);
/**
* ThunarIconRenderer:size:
@@ -147,12 +150,15 @@ thunar_icon_renderer_class_init (ThunarIconRendererClass *klass)
* The size at which icons should be rendered by this
* #ThunarIconRenderer instance.
**/
- g_object_class_install_property (gobject_class,
- PROP_SIZE,
- g_param_spec_enum ("size", "size", "size",
- THUNAR_TYPE_ICON_SIZE,
- THUNAR_ICON_SIZE_SMALL,
- G_PARAM_CONSTRUCT | EXO_PARAM_READWRITE));
+ property_pspecs[PROP_SIZE] =
+ g_param_spec_enum ("size",
+ "size",
+ "size",
+ THUNAR_TYPE_ICON_SIZE,
+ THUNAR_ICON_SIZE_SMALL,
+ G_PARAM_CONSTRUCT | EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
diff --git a/thunar/thunar-icon-view.c b/thunar/thunar-icon-view.c
index af2cc2c..5f60b88 100644
--- a/thunar/thunar-icon-view.c
+++ b/thunar/thunar-icon-view.c
@@ -31,6 +31,7 @@ enum
{
PROP_0,
PROP_TEXT_BESIDE_ICONS,
+ N_PROPERTIES
};
@@ -56,6 +57,10 @@ struct _ThunarIconView
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarIconView, thunar_icon_view, THUNAR_TYPE_ABSTRACT_ICON_VIEW)
@@ -82,13 +87,14 @@ thunar_icon_view_class_init (ThunarIconViewClass *klass)
* Write-only property to specify whether text should be
* display besides the icon rather than below.
**/
- g_object_class_install_property (gobject_class,
- PROP_TEXT_BESIDE_ICONS,
- g_param_spec_boolean ("text-beside-icons",
- "text-beside-icons",
- "text-beside-icons",
- FALSE,
- EXO_PARAM_WRITABLE));
+ property_pspecs[PROP_TEXT_BESIDE_ICONS] =
+ g_param_spec_boolean ("text-beside-icons",
+ "text-beside-icons",
+ "text-beside-icons",
+ FALSE,
+ EXO_PARAM_WRITABLE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
diff --git a/thunar/thunar-image.c b/thunar/thunar-image.c
index 650da20..687d4da 100644
--- a/thunar/thunar-image.c
+++ b/thunar/thunar-image.c
@@ -42,6 +42,7 @@ enum
{
PROP_0,
PROP_FILE,
+ N_PROPERTIES
};
@@ -81,6 +82,10 @@ struct _ThunarImagePrivate
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarImage, thunar_image, GTK_TYPE_IMAGE);
@@ -97,12 +102,14 @@ thunar_image_class_init (ThunarImageClass *klass)
gobject_class->get_property = thunar_image_get_property;
gobject_class->set_property = thunar_image_set_property;
- g_object_class_install_property (gobject_class, PROP_FILE,
- g_param_spec_object ("file",
- "file",
- "file",
- THUNAR_TYPE_FILE,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_FILE] =
+ g_param_spec_object ("file",
+ "file",
+ "file",
+ THUNAR_TYPE_FILE,
+ G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -249,5 +256,5 @@ thunar_image_set_file (ThunarImage *image,
thunar_image_update (image);
- g_object_notify (G_OBJECT (image), "file");
+ _g_object_notify_by_pspec (G_OBJECT (image), property_pspecs[PROP_FILE]);
}
diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c
index 30e43cd..2bfe8b6 100644
--- a/thunar/thunar-launcher.c
+++ b/thunar/thunar-launcher.c
@@ -187,7 +187,7 @@ static GQuark thunar_launcher_handler_quark;
-static GParamSpec *launcher_props[N_PROPERTIES] = { NULL, };
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -218,7 +218,7 @@ thunar_launcher_class_init (ThunarLauncherClass *klass)
*
* The #GtkWidget with which this launcher is associated.
**/
- launcher_props[PROP_WIDGET] =
+ property_pspecs[PROP_WIDGET] =
g_param_spec_object ("widget",
"widget",
"widget",
@@ -227,22 +227,22 @@ thunar_launcher_class_init (ThunarLauncherClass *klass)
/* Override ThunarNavigator's properties */
g_iface = g_type_default_interface_peek (THUNAR_TYPE_NAVIGATOR);
- launcher_props[PROP_CURRENT_DIRECTORY] =
+ property_pspecs[PROP_CURRENT_DIRECTORY] =
g_param_spec_override ("current-directory",
g_object_interface_find_property (g_iface, "current-directory"));
/* Override ThunarComponent's properties */
g_iface = g_type_default_interface_peek (THUNAR_TYPE_COMPONENT);
- launcher_props[PROP_SELECTED_FILES] =
+ property_pspecs[PROP_SELECTED_FILES] =
g_param_spec_override ("selected-files",
g_object_interface_find_property (g_iface, "selected-files"));
- launcher_props[PROP_UI_MANAGER] =
+ property_pspecs[PROP_UI_MANAGER] =
g_param_spec_override ("ui-manager",
g_object_interface_find_property (g_iface, "ui-manager"));
/* install properties */
- g_object_class_install_properties (gobject_class, N_PROPERTIES, launcher_props);
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -438,7 +438,7 @@ thunar_launcher_set_current_directory (ThunarNavigator *navigator,
g_object_ref (G_OBJECT (current_directory));
/* notify listeners */
- g_object_notify_by_pspec (G_OBJECT (launcher), launcher_props[PROP_CURRENT_DIRECTORY]);
+ _g_object_notify_by_pspec (G_OBJECT (launcher), property_pspecs[PROP_CURRENT_DIRECTORY]);
}
@@ -477,7 +477,7 @@ thunar_launcher_set_selected_files (ThunarComponent *component,
thunar_launcher_update (launcher);
/* notify listeners */
- g_object_notify_by_pspec (G_OBJECT (launcher), launcher_props[PROP_SELECTED_FILES]);
+ _g_object_notify_by_pspec (G_OBJECT (launcher), property_pspecs[PROP_SELECTED_FILES]);
}
}
@@ -543,7 +543,7 @@ thunar_launcher_set_ui_manager (ThunarComponent *component,
}
/* notify listeners */
- g_object_notify_by_pspec (G_OBJECT (launcher), launcher_props[PROP_UI_MANAGER]);
+ _g_object_notify_by_pspec (G_OBJECT (launcher), property_pspecs[PROP_UI_MANAGER]);
}
@@ -1886,7 +1886,7 @@ thunar_launcher_set_widget (ThunarLauncher *launcher,
}
/* notify listeners */
- g_object_notify_by_pspec (G_OBJECT (launcher), launcher_props[PROP_WIDGET]);
+ _g_object_notify_by_pspec (G_OBJECT (launcher), property_pspecs[PROP_WIDGET]);
}
diff --git a/thunar/thunar-list-model.c b/thunar/thunar-list-model.c
index be87010..713390a 100644
--- a/thunar/thunar-list-model.c
+++ b/thunar/thunar-list-model.c
@@ -1262,7 +1262,7 @@ thunar_list_model_files_added (ThunarFolder *folder,
gtk_tree_path_free (path);
/* number of visible files may have changed */
- g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_NUM_FILES]);
+ _g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_NUM_FILES]);
}
@@ -1323,7 +1323,7 @@ thunar_list_model_files_removed (ThunarFolder *folder,
}
/* this probably changed */
- g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_NUM_FILES]);
+ _g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_NUM_FILES]);
}
@@ -1662,7 +1662,7 @@ thunar_list_model_set_case_sensitive (ThunarListModel *store,
thunar_list_model_sort (store);
/* notify listeners */
- g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_CASE_SENSITIVE]);
+ _g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_CASE_SENSITIVE]);
}
}
@@ -1706,7 +1706,7 @@ thunar_list_model_set_date_style (ThunarListModel *store,
store->date_style = date_style;
/* notify listeners */
- g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_DATE_STYLE]);
+ _g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_DATE_STYLE]);
/* emit a "changed" signal for each row, so the display is reloaded with the new date style */
gtk_tree_model_foreach (GTK_TREE_MODEL (store), (GtkTreeModelForeachFunc) gtk_tree_model_row_changed, NULL);
@@ -1823,8 +1823,8 @@ thunar_list_model_set_folder (ThunarListModel *store,
}
/* notify listeners that we have a new folder */
- g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_FOLDER]);
- g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_NUM_FILES]);
+ _g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_FOLDER]);
+ _g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_NUM_FILES]);
g_object_thaw_notify (G_OBJECT (store));
}
@@ -1883,7 +1883,7 @@ thunar_list_model_set_folders_first (ThunarListModel *store,
/* apply the new setting (re-sorting the store) */
store->sort_folders_first = folders_first;
- g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_FOLDERS_FIRST]);
+ _g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_FOLDERS_FIRST]);
thunar_list_model_sort (store);
}
@@ -1985,8 +1985,8 @@ thunar_list_model_set_show_hidden (ThunarListModel *store,
/* notify listeners about the new setting */
g_object_freeze_notify (G_OBJECT (store));
- g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_NUM_FILES]);
- g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_SHOW_HIDDEN]);
+ _g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_NUM_FILES]);
+ _g_object_notify_by_pspec (G_OBJECT (store), list_model_props[PROP_SHOW_HIDDEN]);
g_object_thaw_notify (G_OBJECT (store));
}
diff --git a/thunar/thunar-location-button.c b/thunar/thunar-location-button.c
index 6c7180b..edbf193 100644
--- a/thunar/thunar-location-button.c
+++ b/thunar/thunar-location-button.c
@@ -46,6 +46,7 @@ enum
PROP_0,
PROP_ACTIVE,
PROP_FILE,
+ N_PROPERTIES
};
/* Signal identifiers */
@@ -157,7 +158,10 @@ static const GtkTargetEntry drag_targets[] =
{ "text/uri-list", 0, 0 },
};
-static guint location_button_signals[LAST_SIGNAL];
+
+
+static guint location_button_signals[LAST_SIGNAL];
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -184,26 +188,26 @@ thunar_location_button_class_init (ThunarLocationButtonClass *klass)
*
* Whether the location button is currently active.
**/
- g_object_class_install_property (gobject_class,
- PROP_ACTIVE,
- g_param_spec_boolean ("active",
- "active",
- "active",
- FALSE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_ACTIVE] =
+ g_param_spec_boolean ("active",
+ "active",
+ "active",
+ FALSE,
+ EXO_PARAM_READWRITE);
/**
* ThunarLocationButton:file:
*
* The #ThunarFile represented by this location button.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILE,
- g_param_spec_object ("file",
- "file",
- "file",
- THUNAR_TYPE_FILE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FILE] =
+ g_param_spec_object ("file",
+ "file",
+ "file",
+ THUNAR_TYPE_FILE,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarLocationButton::clicked:
@@ -917,7 +921,7 @@ thunar_location_button_set_active (ThunarLocationButton *location_button,
gtk_label_set_attributes (GTK_LABEL (location_button->label), active ? thunar_pango_attr_list_bold () : NULL);
/* notify listeners */
- g_object_notify (G_OBJECT (location_button), "active");
+ _g_object_notify_by_pspec (G_OBJECT (location_button), property_pspecs[PROP_ACTIVE]);
}
@@ -991,7 +995,7 @@ thunar_location_button_set_file (ThunarLocationButton *location_button,
}
/* notify listeners */
- g_object_notify (G_OBJECT (location_button), "file");
+ _g_object_notify_by_pspec (G_OBJECT (location_button), property_pspecs[PROP_FILE]);
}
diff --git a/thunar/thunar-location-buttons.c b/thunar/thunar-location-buttons.c
index 62325e8..f4ba127 100644
--- a/thunar/thunar-location-buttons.c
+++ b/thunar/thunar-location-buttons.c
@@ -50,6 +50,7 @@ enum
PROP_CURRENT_DIRECTORY,
PROP_SELECTED_FILES,
PROP_UI_MANAGER,
+ N_PROPERTIES
};
@@ -183,6 +184,10 @@ static const GtkActionEntry action_entries[] =
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE_WITH_CODE (ThunarLocationButtons, thunar_location_buttons, GTK_TYPE_CONTAINER,
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_location_buttons_navigator_init)
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_COMPONENT, thunar_location_buttons_component_init)
@@ -196,6 +201,7 @@ thunar_location_buttons_class_init (ThunarLocationButtonsClass *klass)
GtkContainerClass *gtkcontainer_class;
GtkWidgetClass *gtkwidget_class;
GObjectClass *gobject_class;
+ gpointer g_iface;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_location_buttons_finalize;
@@ -215,11 +221,22 @@ thunar_location_buttons_class_init (ThunarLocationButtonsClass *klass)
gtkcontainer_class->forall = thunar_location_buttons_forall;
/* Override ThunarNavigator's properties */
- g_object_class_override_property (gobject_class, PROP_CURRENT_DIRECTORY, "current-directory");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_NAVIGATOR);
+ property_pspecs[PROP_CURRENT_DIRECTORY] =
+ g_param_spec_override ("current-directory",
+ g_object_interface_find_property (g_iface, "current-directory"));
/* Override ThunarComponent's properties */
- g_object_class_override_property (gobject_class, PROP_SELECTED_FILES, "selected-files");
- g_object_class_override_property (gobject_class, PROP_UI_MANAGER, "ui-manager");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_COMPONENT);
+ property_pspecs[PROP_SELECTED_FILES] =
+ g_param_spec_override ("selected-files",
+ g_object_interface_find_property (g_iface, "selected-files"));
+
+ property_pspecs[PROP_UI_MANAGER] =
+ g_param_spec_override ("ui-manager",
+ g_object_interface_find_property (g_iface, "ui-manager"));
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarLocationButtons:spacing:
@@ -436,7 +453,7 @@ thunar_location_buttons_set_ui_manager (ThunarComponent *component,
}
/* notify listeners */
- g_object_notify (G_OBJECT (buttons), "ui-manager");
+ _g_object_notify_by_pspec (G_OBJECT (buttons), property_pspecs[PROP_UI_MANAGER]);
}
@@ -523,7 +540,7 @@ thunar_location_buttons_set_current_directory (ThunarNavigator *navigator,
}
}
- g_object_notify (G_OBJECT (buttons), "current-directory");
+ _g_object_notify_by_pspec (G_OBJECT (buttons), property_pspecs[PROP_CURRENT_DIRECTORY]);
}
diff --git a/thunar/thunar-location-entry.c b/thunar/thunar-location-entry.c
index d9f7be4..29355fd 100644
--- a/thunar/thunar-location-entry.c
+++ b/thunar/thunar-location-entry.c
@@ -45,6 +45,7 @@ enum
PROP_CURRENT_DIRECTORY,
PROP_SELECTED_FILES,
PROP_UI_MANAGER,
+ N_PROPERTIES
};
/* Signal identifiers */
@@ -104,6 +105,10 @@ struct _ThunarLocationEntry
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE_WITH_CODE (ThunarLocationEntry, thunar_location_entry, GTK_TYPE_HBOX,
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_BROWSER, NULL)
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_location_entry_navigator_init)
@@ -117,6 +122,7 @@ thunar_location_entry_class_init (ThunarLocationEntryClass *klass)
{
GtkBindingSet *binding_set;
GObjectClass *gobject_class;
+ gpointer g_iface;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_location_entry_finalize;
@@ -126,11 +132,22 @@ thunar_location_entry_class_init (ThunarLocationEntryClass *klass)
klass->reset = thunar_location_entry_reset;
/* override ThunarNavigator's properties */
- g_object_class_override_property (gobject_class, PROP_CURRENT_DIRECTORY, "current-directory");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_NAVIGATOR);
+ property_pspecs[PROP_CURRENT_DIRECTORY] =
+ g_param_spec_override ("current-directory",
+ g_object_interface_find_property (g_iface, "current-directory"));
/* override ThunarComponent's properties */
- g_object_class_override_property (gobject_class, PROP_SELECTED_FILES, "selected-files");
- g_object_class_override_property (gobject_class, PROP_UI_MANAGER, "ui-manager");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_COMPONENT);
+ property_pspecs[PROP_SELECTED_FILES] =
+ g_param_spec_override ("selected-files",
+ g_object_interface_find_property (g_iface, "selected-files"));
+
+ property_pspecs[PROP_UI_MANAGER] =
+ g_param_spec_override ("ui-manager",
+ g_object_interface_find_property (g_iface, "ui-manager"));
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarLocationEntry::reset:
@@ -307,7 +324,7 @@ thunar_location_entry_set_current_directory (ThunarNavigator *navigator,
g_object_ref (G_OBJECT (current_directory));
/* notify listeners */
- g_object_notify (G_OBJECT (location_entry), "current-directory");
+ _g_object_notify_by_pspec (G_OBJECT (location_entry), property_pspecs[PROP_CURRENT_DIRECTORY]);
}
diff --git a/thunar/thunar-path-entry.c b/thunar/thunar-path-entry.c
index 6a559de..d433955 100644
--- a/thunar/thunar-path-entry.c
+++ b/thunar/thunar-path-entry.c
@@ -56,6 +56,7 @@ enum
{
PROP_0,
PROP_CURRENT_FILE,
+ N_PROPERTIES
};
@@ -149,6 +150,7 @@ static const GtkTargetEntry drag_targets[] =
static GtkEditableClass *thunar_path_entry_editable_parent_iface;
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -184,13 +186,14 @@ thunar_path_entry_class_init (ThunarPathEntryClass *klass)
*
* The #ThunarFile currently displayed by the path entry or %NULL.
**/
- g_object_class_install_property (gobject_class,
- PROP_CURRENT_FILE,
- g_param_spec_object ("current-file",
- "current-file",
- "current-file",
- THUNAR_TYPE_FILE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_CURRENT_FILE] =
+ g_param_spec_object ("current-file",
+ "current-file",
+ "current-file",
+ THUNAR_TYPE_FILE,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarPathEntry:icon-size:
@@ -638,7 +641,7 @@ thunar_path_entry_changed (GtkEditable *editable)
g_object_ref (G_OBJECT (current_file));
g_signal_connect_swapped (G_OBJECT (current_file), "changed", G_CALLBACK (thunar_path_entry_set_current_file), path_entry);
}
- g_object_notify (G_OBJECT (path_entry), "current-file");
+ _g_object_notify_by_pspec (G_OBJECT (path_entry), property_pspecs[PROP_CURRENT_FILE]);
/* we most likely need a new icon */
update_icon = TRUE;
diff --git a/thunar/thunar-permissions-chooser.c b/thunar/thunar-permissions-chooser.c
index 027e561..a6974a4 100644
--- a/thunar/thunar-permissions-chooser.c
+++ b/thunar/thunar-permissions-chooser.c
@@ -61,6 +61,7 @@ enum
PROP_0,
PROP_FILES,
PROP_MUTABLE,
+ N_PROPERTIES
};
/* Column identifiers for the group combo box */
@@ -151,6 +152,10 @@ struct _ThunarPermissionsChooser
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarPermissionsChooser, thunar_permissions_chooser, GTK_TYPE_VBOX)
@@ -170,11 +175,12 @@ thunar_permissions_chooser_class_init (ThunarPermissionsChooserClass *klass)
*
* The #ThunarFile whose permissions will be edited/viewed.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILES,
- g_param_spec_boxed ("files", "files", "files",
- THUNARX_TYPE_FILE_INFO_LIST,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FILES] =
+ g_param_spec_boxed ("files",
+ "files",
+ "files",
+ THUNARX_TYPE_FILE_INFO_LIST,
+ EXO_PARAM_READWRITE);
/**
* ThunarPermissionsChooser:mutable:
@@ -182,13 +188,14 @@ thunar_permissions_chooser_class_init (ThunarPermissionsChooserClass *klass)
* Whether the current #ThunarFile<!---->s permissions are
* mutable.
**/
- g_object_class_install_property (gobject_class,
- PROP_MUTABLE,
- g_param_spec_boolean ("mutable",
- "mutable",
- "mutable",
- FALSE,
- EXO_PARAM_READABLE));
+ property_pspecs[PROP_MUTABLE] =
+ g_param_spec_boolean ("mutable",
+ "mutable",
+ "mutable",
+ FALSE,
+ EXO_PARAM_READABLE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -1036,7 +1043,7 @@ thunar_permissions_chooser_file_changed (ThunarPermissionsChooser *chooser)
g_object_unref (G_OBJECT (store));
/* emit notification on "mutable", so all widgets update their sensitivity */
- g_object_notify (G_OBJECT (chooser), "mutable");
+ _g_object_notify_by_pspec (G_OBJECT (chooser), property_pspecs[PROP_MUTABLE]);
}
@@ -1392,7 +1399,7 @@ thunar_permissions_chooser_set_files (ThunarPermissionsChooser *chooser,
thunar_permissions_chooser_file_changed (chooser);
/* notify listeners */
- g_object_notify (G_OBJECT (chooser), "files");
+ _g_object_notify_by_pspec (G_OBJECT (chooser), property_pspecs[PROP_FILES]);
}
diff --git a/thunar/thunar-preferences.c b/thunar/thunar-preferences.c
index 41c07d8..f4cc5f6 100644
--- a/thunar/thunar-preferences.c
+++ b/thunar/thunar-preferences.c
@@ -93,7 +93,7 @@ enum
PROP_SHORTCUTS_ICON_SIZE,
PROP_TREE_ICON_EMBLEMS,
PROP_TREE_ICON_SIZE,
- N_PROPERTIES,
+ N_PROPERTIES
};
@@ -140,7 +140,7 @@ G_DEFINE_TYPE (ThunarPreferences, thunar_preferences, G_TYPE_OBJECT)
-static GParamSpec *preferences_props[N_PROPERTIES] = { NULL, };
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -161,7 +161,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* view pane in new #ThunarWindow<!---->s or "void" to use the
* last selected view from the "last-view" preference.
**/
- preferences_props[PROP_DEFAULT_VIEW] =
+ property_pspecs[PROP_DEFAULT_VIEW] =
g_param_spec_string ("default-view",
"DefaultView",
NULL,
@@ -174,7 +174,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* List of URI's that are hidden in the bookmarks (obtained from ~/.gtk-bookmarks).
* If an URI is not in the bookmarks file it will be removed from this list.
**/
- preferences_props[PROP_HIDDEN_BOOKMARKS] =
+ property_pspecs[PROP_HIDDEN_BOOKMARKS] =
g_param_spec_boxed ("hidden-bookmarks",
NULL,
NULL,
@@ -188,7 +188,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Visibility of the device can be obtained with
* thunar_device_get_hidden().
**/
- preferences_props[PROP_HIDDEN_DEVICES] =
+ property_pspecs[PROP_HIDDEN_DEVICES] =
g_param_spec_boxed ("hidden-devices",
NULL,
NULL,
@@ -200,7 +200,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* The last selected #ThunarZoomLevel for the #ThunarCompactView.
**/
- preferences_props[PROP_LAST_COMPACT_VIEW_ZOOM_LEVEL] =
+ property_pspecs[PROP_LAST_COMPACT_VIEW_ZOOM_LEVEL] =
g_param_spec_enum ("last-compact-view-zoom-level",
"LastCompactViewZoomLevel",
NULL,
@@ -215,7 +215,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* The comma separated list of columns that specifies the order of the
* columns in the #ThunarDetailsView.
**/
- preferences_props[PROP_LAST_DETAILS_VIEW_COLUMN_ORDER] =
+ property_pspecs[PROP_LAST_DETAILS_VIEW_COLUMN_ORDER] =
g_param_spec_string ("last-details-view-column-order",
"LastDetailsViewColumnOrder",
NULL,
@@ -228,7 +228,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* The comma separated list of column widths used for fixed width
* #ThunarDetailsView<!---->s.
**/
- preferences_props[PROP_LAST_DETAILS_VIEW_COLUMN_WIDTHS] =
+ property_pspecs[PROP_LAST_DETAILS_VIEW_COLUMN_WIDTHS] =
g_param_spec_string ("last-details-view-column-widths",
"LastDetailsViewColumnWidths",
NULL,
@@ -241,7 +241,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* %TRUE to use fixed column widths in the #ThunarDetailsView. Else the
* column widths will be automatically determined from the model contents.
**/
- preferences_props[PROP_LAST_DETAILS_VIEW_FIXED_COLUMNS] =
+ property_pspecs[PROP_LAST_DETAILS_VIEW_FIXED_COLUMNS] =
g_param_spec_boolean ("last-details-view-fixed-columns",
"LastDetailsViewFixedColumns",
NULL,
@@ -253,7 +253,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* The comma separated list of visible columns in the #ThunarDetailsView.
**/
- preferences_props[PROP_LAST_DETAILS_VIEW_VISIBLE_COLUMNS] =
+ property_pspecs[PROP_LAST_DETAILS_VIEW_VISIBLE_COLUMNS] =
g_param_spec_string ("last-details-view-visible-columns",
"LastDetailsViewVisibleColumns",
NULL,
@@ -265,7 +265,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* The last selected #ThunarZoomLevel for the #ThunarDetailsView.
**/
- preferences_props[PROP_LAST_DETAILS_VIEW_ZOOM_LEVEL] =
+ property_pspecs[PROP_LAST_DETAILS_VIEW_ZOOM_LEVEL] =
g_param_spec_enum ("last-details-view-zoom-level",
"LastDetailsViewZoomLevel",
NULL,
@@ -278,7 +278,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* The last selected #ThunarZoomLevel for the #ThunarIconView.
**/
- preferences_props[PROP_LAST_ICON_VIEW_ZOOM_LEVEL] =
+ property_pspecs[PROP_LAST_ICON_VIEW_ZOOM_LEVEL] =
g_param_spec_enum ("last-icon-view-zoom-level",
"LastIconViewZoomLevel",
NULL,
@@ -293,7 +293,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* location bar in #ThunarWindow<!---->s or "void" to hide the
* location bar.
**/
- preferences_props[PROP_LAST_LOCATION_BAR] =
+ property_pspecs[PROP_LAST_LOCATION_BAR] =
g_param_spec_string ("last-location-bar",
"LastLocationBar",
NULL,
@@ -305,7 +305,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* Whether to display a menubar in new windows by default.
**/
- preferences_props[PROP_LAST_MENUBAR_VISIBLE] =
+ property_pspecs[PROP_LAST_MENUBAR_VISIBLE] =
g_param_spec_boolean ("last-menubar-visible",
"LastMenubarVisible",
NULL,
@@ -318,7 +318,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* The last position of the gutter in the main window,
* which separates the side pane from the main view.
**/
- preferences_props[PROP_LAST_SEPARATOR_POSITION] =
+ property_pspecs[PROP_LAST_SEPARATOR_POSITION] =
g_param_spec_int ("last-separator-position",
"LastSeparatorPosition",
NULL,
@@ -330,7 +330,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* Whether to show hidden files by default in new windows.
**/
- preferences_props[PROP_LAST_SHOW_HIDDEN] =
+ property_pspecs[PROP_LAST_SHOW_HIDDEN] =
g_param_spec_boolean ("last-show-hidden",
"LastShowHidden",
NULL,
@@ -344,7 +344,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* side pane in #ThunarWindow<!---->s or "void" to hide the
* side pane completely.
**/
- preferences_props[PROP_LAST_SIDE_PANE] =
+ property_pspecs[PROP_LAST_SIDE_PANE] =
g_param_spec_string ("last-side-pane",
"LastSidePane",
NULL,
@@ -356,7 +356,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* The default sort column for new views.
**/
- preferences_props[PROP_LAST_SORT_COLUMN] =
+ property_pspecs[PROP_LAST_SORT_COLUMN] =
g_param_spec_enum ("last-sort-column",
"LastSortColumn",
NULL,
@@ -369,7 +369,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* The default sort order for new views.
**/
- preferences_props[PROP_LAST_SORT_ORDER] =
+ property_pspecs[PROP_LAST_SORT_ORDER] =
g_param_spec_enum ("last-sort-order",
"LastSortOrder",
NULL,
@@ -381,7 +381,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* Whether to display a statusbar in new windows by default.
**/
- preferences_props[PROP_LAST_STATUSBAR_VISIBLE] =
+ property_pspecs[PROP_LAST_STATUSBAR_VISIBLE] =
g_param_spec_boolean ("last-statusbar-visible",
"LastStatusbarVisible",
NULL,
@@ -394,7 +394,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* The name of the widget class, which should be used for the
* main view component in #ThunarWindow<!---->s.
**/
- preferences_props[PROP_LAST_VIEW] =
+ property_pspecs[PROP_LAST_VIEW] =
g_param_spec_string ("last-view",
"LastView",
NULL,
@@ -407,7 +407,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* The last known height of a #ThunarWindow, which will be used as
* default height for newly created windows.
**/
- preferences_props[PROP_LAST_WINDOW_HEIGHT] =
+ property_pspecs[PROP_LAST_WINDOW_HEIGHT] =
g_param_spec_int ("last-window-height",
"LastWindowHeight",
NULL,
@@ -420,7 +420,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* The last known width of a #ThunarWindow, which will be used as
* default width for newly created windows.
**/
- preferences_props[PROP_LAST_WINDOW_WIDTH] =
+ property_pspecs[PROP_LAST_WINDOW_WIDTH] =
g_param_spec_int ("last-window-width",
"LastWindowWidth",
NULL,
@@ -433,7 +433,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* The last known maximized state of a #ThunarWindow, which will be used as
* default width for newly created windows.
**/
- preferences_props[PROP_LAST_WINDOW_FULLSCREEN] =
+ property_pspecs[PROP_LAST_WINDOW_FULLSCREEN] =
g_param_spec_boolean ("last-window-maximized",
"LastWindowMaximized",
NULL,
@@ -445,7 +445,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* If the view tabs should always be visible.
**/
- preferences_props[PROP_MISC_ALWAYS_SHOW_TABS] =
+ property_pspecs[PROP_MISC_ALWAYS_SHOW_TABS] =
g_param_spec_boolean ("misc-always-show-tabs",
NULL,
NULL,
@@ -458,7 +458,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Whether to enable volume management capabilities (requires HAL and the
* thunar-volman package).
**/
- preferences_props[PROP_MISC_VOLUME_MANAGEMENT] =
+ property_pspecs[PROP_MISC_VOLUME_MANAGEMENT] =
g_param_spec_boolean ("misc-volume-management",
"MiscVolumeManagement",
NULL,
@@ -470,7 +470,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* Whether to use case-sensitive sort.
**/
- preferences_props[PROP_MISC_CASE_SENSITIVE] =
+ property_pspecs[PROP_MISC_CASE_SENSITIVE] =
g_param_spec_boolean ("misc-case-sensitive",
"MiscCaseSensitive",
NULL,
@@ -482,7 +482,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* The style used to display dates in the user interface.
**/
- preferences_props[PROP_MISC_DATE_STYLE] =
+ property_pspecs[PROP_MISC_DATE_STYLE] =
g_param_spec_enum ("misc-date-style",
"MiscDateStyle",
NULL,
@@ -495,7 +495,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* Whether to sort folders before files.
**/
- preferences_props[PROP_MISC_FOLDERS_FIRST] =
+ property_pspecs[PROP_MISC_FOLDERS_FIRST] =
g_param_spec_boolean ("misc-folders-first",
"MiscFoldersFirst",
NULL,
@@ -508,7 +508,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Show the full directory path in the window title, instead of
* only the directory name.
**/
- preferences_props[PROP_MISC_FULL_PATH_IN_TITLE] =
+ property_pspecs[PROP_MISC_FULL_PATH_IN_TITLE] =
g_param_spec_boolean ("misc-full-path-in-title",
"MiscFullPathInTitle",
NULL,
@@ -521,7 +521,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Whether the horizontal mouse wheel is used to navigate
* forth and back within a Thunar view.
**/
- preferences_props[PROP_MISC_HORIZONTAL_WHEEL_NAVIGATES] =
+ property_pspecs[PROP_MISC_HORIZONTAL_WHEEL_NAVIGATES] =
g_param_spec_boolean ("misc-horizontal-wheel-navigates",
"MiscHorizontalWheelNavigates",
NULL,
@@ -535,7 +535,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* in the statusbar. This heavily increases I/O in image
* folders when moving the selection across files.
**/
- preferences_props[PROP_MISC_IMAGE_SIZE_IN_STATUSBAR] =
+ property_pspecs[PROP_MISC_IMAGE_SIZE_IN_STATUSBAR] =
g_param_spec_boolean ("misc-image-size-in-statusbar",
"MiscImageSizeInStatusbar",
NULL,
@@ -547,7 +547,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* If middle click opens a folder in a new window (FALSE) or in a new window (TRUE);
**/
- preferences_props[PROP_MISC_MIDDLE_CLICK_IN_TAB] =
+ property_pspecs[PROP_MISC_MIDDLE_CLICK_IN_TAB] =
g_param_spec_boolean ("misc-middle-click-in-tab",
NULL,
NULL,
@@ -560,7 +560,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Whether to apply permissions recursively everytime the
* permissions are altered by the user.
**/
- preferences_props[PROP_MISC_RECURSIVE_PERMISSIONS] =
+ property_pspecs[PROP_MISC_RECURSIVE_PERMISSIONS] =
g_param_spec_enum ("misc-recursive-permissions",
"MiscRecursivePermissions",
NULL,
@@ -577,7 +577,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* %FALSE the user may specify the start size in "last-window-with"
* and "last-window-height".
**/
- preferences_props[PROP_MISC_REMEMBER_GEOMETRY] =
+ property_pspecs[PROP_MISC_REMEMBER_GEOMETRY] =
g_param_spec_boolean ("misc-remember-geometry",
"MiscRememberGeometry",
NULL,
@@ -590,7 +590,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Whether to display the "About Templates" dialog, when opening the
* Templates folder from the Go menu.
**/
- preferences_props[PROP_MISC_SHOW_ABOUT_TEMPLATES] =
+ property_pspecs[PROP_MISC_SHOW_ABOUT_TEMPLATES] =
g_param_spec_boolean ("misc-show-about-templates",
"MiscShowAboutTemplates",
NULL,
@@ -602,7 +602,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* Whether to use single click navigation.
**/
- preferences_props[PROP_MISC_SINGLE_CLICK] =
+ property_pspecs[PROP_MISC_SINGLE_CLICK] =
g_param_spec_boolean ("misc-single-click",
"MiscSingleClick",
NULL,
@@ -617,7 +617,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* will be selected automatically. A value of %0 disables the
* automatic selection.
**/
- preferences_props[PROP_MISC_SINGLE_CLICK_TIMEOUT] =
+ property_pspecs[PROP_MISC_SINGLE_CLICK_TIMEOUT] =
g_param_spec_uint ("misc-single-click-timeout",
"MiscSingleClickTimeout",
NULL,
@@ -629,7 +629,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* Use small icons on the toolbar instead of the default toolbar size.
**/
- preferences_props[PROP_MISC_SMALL_TOOLBAR_ICONS] =
+ property_pspecs[PROP_MISC_SMALL_TOOLBAR_ICONS] =
g_param_spec_boolean ("misc-small-toolbar-icons",
NULL,
NULL,
@@ -642,7 +642,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Whether to close tabs when the tab label is clicked with the 2nd
* mouse button.
**/
- preferences_props[PROP_MISC_TAB_CLOSE_MIDDLE_CLICK] =
+ property_pspecs[PROP_MISC_TAB_CLOSE_MIDDLE_CLICK] =
g_param_spec_boolean ("misc-tab-close-middle-click",
NULL,
NULL,
@@ -655,7 +655,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Whether the icon view should display the file names beside the
* file icons instead of below the file icons.
**/
- preferences_props[PROP_MISC_TEXT_BESIDE_ICONS] =
+ property_pspecs[PROP_MISC_TEXT_BESIDE_ICONS] =
g_param_spec_boolean ("misc-text-beside-icons",
"MiscTextBesideIcons",
NULL,
@@ -667,7 +667,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
*
* Whether to generate and display thumbnails for previewable files.
**/
- preferences_props[PROP_MISC_THUMBNAIL_MODE] =
+ property_pspecs[PROP_MISC_THUMBNAIL_MODE] =
g_param_spec_enum ("misc-thumbnail-mode",
NULL,
NULL,
@@ -681,7 +681,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Whether to display emblems for file icons (if defined) in the
* shortcuts side pane.
**/
- preferences_props[PROP_SHORTCUTS_ICON_EMBLEMS] =
+ property_pspecs[PROP_SHORTCUTS_ICON_EMBLEMS] =
g_param_spec_boolean ("shortcuts-icon-emblems",
"ShortcutsIconEmblems",
NULL,
@@ -694,7 +694,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* The icon size to use for the icons displayed in the
* shortcuts side pane.
**/
- preferences_props[PROP_SHORTCUTS_ICON_SIZE] =
+ property_pspecs[PROP_SHORTCUTS_ICON_SIZE] =
g_param_spec_enum ("shortcuts-icon-size",
"ShortcutsIconSize",
NULL,
@@ -708,7 +708,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* Whether to display emblems for file icons (if defined) in the
* tree side pane.
**/
- preferences_props[PROP_TREE_ICON_EMBLEMS] =
+ property_pspecs[PROP_TREE_ICON_EMBLEMS] =
g_param_spec_boolean ("tree-icon-emblems",
"TreeIconEmblems",
NULL,
@@ -721,7 +721,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
* The icon size to use for the icons displayed in the
* tree side pane.
**/
- preferences_props[PROP_TREE_ICON_SIZE] =
+ property_pspecs[PROP_TREE_ICON_SIZE] =
g_param_spec_enum ("tree-icon-size",
"TreeIconSize",
NULL,
@@ -730,7 +730,7 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass)
EXO_PARAM_READWRITE);
/* install all properties */
- g_object_class_install_properties (gobject_class, N_PROPERTIES, preferences_props);
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -883,7 +883,7 @@ thunar_preferences_prop_changed (XfconfChannel *channel,
/* check if the property exists and emit change */
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (preferences), prop_name + 1);
if (G_LIKELY (pspec != NULL))
- g_object_notify_by_pspec (G_OBJECT (preferences), pspec);
+ _g_object_notify_by_pspec (G_OBJECT (preferences), pspec);
}
diff --git a/thunar/thunar-private.h b/thunar/thunar-private.h
index 6fbe31a..3e93252 100644
--- a/thunar/thunar-private.h
+++ b/thunar/thunar-private.h
@@ -60,6 +60,11 @@ G_BEGIN_DECLS;
#define g_value_get_object(v) (((const GValue *) (v))->data[0].v_pointer)
#endif
+/* bug in gobject (bug 705570) */
+#define _g_object_notify_by_pspec(object,pspec) \
+ if (g_atomic_int_get (&(object)->ref_count) > 0) \
+ g_object_notify_by_pspec (object, pspec)
+
/* support macros for the GtkTreeModel implementations */
#ifndef NDEBUG
#define GTK_TREE_ITER_INIT(iter, iter_stamp, iter_user_data) \
diff --git a/thunar/thunar-progress-view.c b/thunar/thunar-progress-view.c
index c66a9c6..da845da 100644
--- a/thunar/thunar-progress-view.c
+++ b/thunar/thunar-progress-view.c
@@ -41,6 +41,7 @@ enum
PROP_JOB,
PROP_ICON_NAME,
PROP_TITLE,
+ N_PROPERTIES
};
@@ -102,6 +103,10 @@ struct _ThunarProgressView
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarProgressView, thunar_progress_view, GTK_TYPE_VBOX)
@@ -123,27 +128,28 @@ thunar_progress_view_class_init (ThunarProgressViewClass *klass)
* The #ThunarJob, whose progress is displayed by this view, or
* %NULL if no job is set.
**/
- g_object_class_install_property (gobject_class,
- PROP_JOB,
- g_param_spec_object ("job", "job", "job",
- THUNAR_TYPE_JOB,
- EXO_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class,
- PROP_ICON_NAME,
- g_param_spec_string ("icon-name",
- "icon-name",
- "icon-name",
- NULL,
- EXO_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class,
- PROP_TITLE,
- g_param_spec_string ("title",
- "title",
- "title",
- NULL,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_JOB] =
+ g_param_spec_object ("job",
+ "job",
+ "job",
+ THUNAR_TYPE_JOB,
+ EXO_PARAM_READWRITE);
+
+ property_pspecs[PROP_ICON_NAME] =
+ g_param_spec_string ("icon-name",
+ "icon-name",
+ "icon-name",
+ NULL,
+ EXO_PARAM_READWRITE);
+
+ property_pspecs[PROP_TITLE] =
+ g_param_spec_string ("title",
+ "title",
+ "title",
+ NULL,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
g_signal_new ("need-attention",
THUNAR_TYPE_PROGRESS_VIEW,
@@ -565,7 +571,7 @@ thunar_progress_view_set_job (ThunarProgressView *view,
g_signal_connect_swapped (job, "percent", G_CALLBACK (thunar_progress_view_percent), view);
}
- g_object_notify (G_OBJECT (view), "job");
+ _g_object_notify_by_pspec (G_OBJECT (view), property_pspecs[PROP_JOB]);
}
@@ -582,7 +588,7 @@ thunar_progress_view_set_icon_name (ThunarProgressView *view,
g_free (view->icon_name);
view->icon_name = g_strdup (icon_name);
- g_object_notify (G_OBJECT (view), "icon-name");
+ _g_object_notify_by_pspec (G_OBJECT (view), property_pspecs[PROP_ICON_NAME]);
}
@@ -599,5 +605,5 @@ thunar_progress_view_set_title (ThunarProgressView *view,
g_free (view->title);
view->title = g_strdup (title);
- g_object_notify (G_OBJECT (view), "title");
+ _g_object_notify_by_pspec (G_OBJECT (view), property_pspecs[PROP_TITLE]);
}
diff --git a/thunar/thunar-properties-dialog.c b/thunar/thunar-properties-dialog.c
index 61e31a0..2d9163e 100644
--- a/thunar/thunar-properties-dialog.c
+++ b/thunar/thunar-properties-dialog.c
@@ -64,6 +64,7 @@ enum
{
PROP_0,
PROP_FILES,
+ N_PROPERTIES
};
/* Signal identifiers */
@@ -145,6 +146,10 @@ struct _ThunarPropertiesDialog
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarPropertiesDialog, thunar_properties_dialog, THUNAR_TYPE_ABSTRACT_DIALOG)
@@ -174,11 +179,14 @@ thunar_properties_dialog_class_init (ThunarPropertiesDialogClass *klass)
* this #ThunarPropertiesDialog. This property may also be %NULL
* in which case nothing is displayed.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILES,
- g_param_spec_boxed ("files", "files", "files",
- THUNARX_TYPE_FILE_INFO_LIST,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FILES] =
+ g_param_spec_boxed ("files",
+ "files",
+ "files",
+ THUNARX_TYPE_FILE_INFO_LIST,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarPropertiesDialog::reload:
@@ -1369,7 +1377,7 @@ thunar_properties_dialog_set_files (ThunarPropertiesDialog *dialog,
}
/* tell everybody that we have a new file here */
- g_object_notify (G_OBJECT (dialog), "files");
+ //_g_object_notify_by_pspec (G_OBJECT (dialog), property_pspecs[PROP_FILES]);
}
diff --git a/thunar/thunar-renamer-dialog.c b/thunar/thunar-renamer-dialog.c
index 36eafac..cf62533 100644
--- a/thunar/thunar-renamer-dialog.c
+++ b/thunar/thunar-renamer-dialog.c
@@ -53,6 +53,7 @@ enum
PROP_CURRENT_DIRECTORY,
PROP_SELECTED_FILES,
PROP_STANDALONE,
+ N_PROPERTIES
};
/* Identifiers for DnD target types */
@@ -211,6 +212,10 @@ static const GtkTargetEntry drag_targets[] = {
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarRenamerDialog, thunar_renamer_dialog, THUNAR_TYPE_ABSTRACT_DIALOG)
@@ -244,13 +249,12 @@ thunar_renamer_dialog_class_init (ThunarRenamerDialogClass *klass)
* current directory of the file manager process will
* be used.
**/
- g_object_class_install_property (gobject_class,
- PROP_CURRENT_DIRECTORY,
- g_param_spec_object ("current-directory",
- "current-directory",
- "current-directory",
- THUNAR_TYPE_FILE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_CURRENT_DIRECTORY] =
+ g_param_spec_object ("current-directory",
+ "current-directory",
+ "current-directory",
+ THUNAR_TYPE_FILE,
+ EXO_PARAM_READWRITE);
/**
* ThunarRenamerDialog:selected-files:
@@ -258,13 +262,12 @@ thunar_renamer_dialog_class_init (ThunarRenamerDialogClass *klass)
* The list of currently selected #ThunarFile<!---->s
* in this #ThunarRenamerDialog.
**/
- g_object_class_install_property (gobject_class,
- PROP_SELECTED_FILES,
- g_param_spec_boxed ("selected-files",
- "selected-files",
- "selected-files",
- THUNARX_TYPE_FILE_INFO_LIST,
- EXO_PARAM_READABLE));
+ property_pspecs[PROP_SELECTED_FILES] =
+ g_param_spec_boxed ("selected-files",
+ "selected-files",
+ "selected-files",
+ THUNARX_TYPE_FILE_INFO_LIST,
+ EXO_PARAM_READABLE);
/**
* ThunarRenamerDialog:standalone:
@@ -276,13 +279,14 @@ thunar_renamer_dialog_class_init (ThunarRenamerDialogClass *klass)
* If the #ThunarRenamerDialog is opened from within
* Thunar this property will always be %FALSE.
**/
- g_object_class_install_property (gobject_class,
- PROP_STANDALONE,
- g_param_spec_boolean ("standalone",
- "standalone",
- "standalone",
- FALSE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_STANDALONE] =
+ g_param_spec_boolean ("standalone",
+ "standalone",
+ "standalone",
+ FALSE,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -1699,7 +1703,7 @@ thunar_renamer_dialog_selection_changed (GtkTreeSelection *selection,
gtk_action_set_sensitive (action, n_selected_files > 0);
/* notify listeners */
- g_object_notify (G_OBJECT (renamer_dialog), "selected-files");
+ _g_object_notify_by_pspec (G_OBJECT (renamer_dialog), property_pspecs[PROP_SELECTED_FILES]);
}
@@ -1757,7 +1761,7 @@ thunar_renamer_dialog_set_current_directory (ThunarRenamerDialog *renamer_dialog
g_object_ref (G_OBJECT (current_directory));
/* notify listeners */
- g_object_notify (G_OBJECT (renamer_dialog), "current-directory");
+ _g_object_notify_by_pspec (G_OBJECT (renamer_dialog), property_pspecs[PROP_CURRENT_DIRECTORY]);
}
@@ -1841,7 +1845,7 @@ thunar_renamer_dialog_set_standalone (ThunarRenamerDialog *renamer_dialog,
}
/* notify listeners */
- g_object_notify (G_OBJECT (renamer_dialog), "standalone");
+ _g_object_notify_by_pspec (G_OBJECT (renamer_dialog), property_pspecs[PROP_STANDALONE]);
}
}
diff --git a/thunar/thunar-renamer-model.c b/thunar/thunar-renamer-model.c
index 3d8c209..fa9573c 100644
--- a/thunar/thunar-renamer-model.c
+++ b/thunar/thunar-renamer-model.c
@@ -49,6 +49,7 @@ enum
PROP_FROZEN,
PROP_MODE,
PROP_RENAMER,
+ N_PROPERTIES
};
typedef struct
@@ -174,6 +175,10 @@ struct _ThunarRenamerModelItem
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE_WITH_CODE (ThunarRenamerModel, thunar_renamer_model, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, thunar_renamer_model_tree_model_init))
@@ -196,13 +201,12 @@ thunar_renamer_model_class_init (ThunarRenamerModelClass *klass)
* can be renamed. This is %TRUE if atleast one file
* is in the model and no conflict is present.
**/
- g_object_class_install_property (gobject_class,
- PROP_CAN_RENAME,
- g_param_spec_boolean ("can-rename",
- "can-rename",
- "can-rename",
- FALSE,
- EXO_PARAM_READABLE));
+ property_pspecs[PROP_CAN_RENAME] =
+ g_param_spec_boolean ("can-rename",
+ "can-rename",
+ "can-rename",
+ FALSE,
+ EXO_PARAM_READABLE);
/**
* ThunarRenamerModel:frozen:
@@ -211,13 +215,12 @@ thunar_renamer_model_class_init (ThunarRenamerModelClass *klass)
* be processed for the model and the "can-rename"
* property will always be %FALSE.
**/
- g_object_class_install_property (gobject_class,
- PROP_FROZEN,
- g_param_spec_boolean ("frozen",
- "frozen",
- "frozen",
- FALSE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FROZEN] =
+ g_param_spec_boolean ("frozen",
+ "frozen",
+ "frozen",
+ FALSE,
+ EXO_PARAM_READWRITE);
/**
* ThunarRenamerModel:mode:
@@ -225,12 +228,13 @@ thunar_renamer_model_class_init (ThunarRenamerModelClass *klass)
* The #ThunarRenamerMode used by this
* #ThunarRenamerModel.
**/
- g_object_class_install_property (gobject_class,
- PROP_MODE,
- g_param_spec_enum ("mode", "mode", "mode",
- THUNAR_TYPE_RENAMER_MODE,
- THUNAR_RENAMER_MODE_NAME,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_MODE] =
+ g_param_spec_enum ("mode",
+ "mode",
+ "mode",
+ THUNAR_TYPE_RENAMER_MODE,
+ THUNAR_RENAMER_MODE_NAME,
+ EXO_PARAM_READWRITE);
/**
* ThunarRenamerModel:renamer:
@@ -238,13 +242,14 @@ thunar_renamer_model_class_init (ThunarRenamerModelClass *klass)
* The #ThunarxRenamer that should be used by this
* #ThunarRenamerModel.
**/
- g_object_class_install_property (gobject_class,
- PROP_RENAMER,
- g_param_spec_object ("renamer",
- "renamer",
- "renamer",
- THUNARX_TYPE_RENAMER,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_RENAMER] =
+ g_param_spec_object ("renamer",
+ "renamer",
+ "renamer",
+ THUNARX_TYPE_RENAMER,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -721,7 +726,7 @@ thunar_renamer_model_invalidate_item (ThunarRenamerModel *renamer_model,
renamer_model, thunar_renamer_model_update_idle_destroy);
/* notify listeners that we're updating */
- g_object_notify (G_OBJECT (renamer_model), "can-rename");
+ _g_object_notify_by_pspec (G_OBJECT (renamer_model), property_pspecs[PROP_CAN_RENAME]);
}
}
@@ -976,7 +981,7 @@ thunar_renamer_model_update_idle_destroy (gpointer user_data)
THUNAR_RENAMER_MODEL (user_data)->update_idle_id = 0;
/* ...and notify listeners */
- g_object_notify (G_OBJECT (user_data), "can-rename");
+ _g_object_notify_by_pspec (G_OBJECT (user_data), property_pspecs[PROP_CAN_RENAME]);
}
@@ -1162,8 +1167,8 @@ thunar_renamer_model_set_frozen (ThunarRenamerModel *renamer_model,
/* notify listeners */
g_object_freeze_notify (G_OBJECT (renamer_model));
- g_object_notify (G_OBJECT (renamer_model), "can-rename");
- g_object_notify (G_OBJECT (renamer_model), "frozen");
+ _g_object_notify_by_pspec (G_OBJECT (renamer_model), property_pspecs[PROP_CAN_RENAME]);
+ _g_object_notify_by_pspec (G_OBJECT (renamer_model), property_pspecs[PROP_FROZEN]);
g_object_thaw_notify (G_OBJECT (renamer_model));
}
}
@@ -1213,7 +1218,7 @@ thunar_renamer_model_set_mode (ThunarRenamerModel *renamer_model,
thunar_renamer_model_invalidate_all (renamer_model);
/* notify listeners */
- g_object_notify (G_OBJECT (renamer_model), "mode");
+ _g_object_notify_by_pspec (G_OBJECT (renamer_model), property_pspecs[PROP_MODE]);
}
@@ -1276,7 +1281,7 @@ thunar_renamer_model_set_renamer (ThunarRenamerModel *renamer_model,
thunar_renamer_model_invalidate_all (renamer_model);
/* notify listeners */
- g_object_notify (G_OBJECT (renamer_model), "renamer");
+ _g_object_notify_by_pspec (G_OBJECT (renamer_model), property_pspecs[PROP_RENAMER]);
}
diff --git a/thunar/thunar-shortcuts-icon-renderer.c b/thunar/thunar-shortcuts-icon-renderer.c
index 5f122e6..5b4b97f 100644
--- a/thunar/thunar-shortcuts-icon-renderer.c
+++ b/thunar/thunar-shortcuts-icon-renderer.c
@@ -39,6 +39,7 @@ enum
PROP_0,
PROP_DEVICE,
PROP_GICON,
+ N_PROPERTIES
};
@@ -77,6 +78,10 @@ struct _ThunarShortcutsIconRenderer
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarShortcutsIconRenderer, thunar_shortcuts_icon_renderer, THUNAR_TYPE_ICON_RENDERER)
@@ -101,11 +106,12 @@ thunar_shortcuts_icon_renderer_class_init (ThunarShortcutsIconRendererClass *kla
* The #ThunarDevice for which to render an icon or %NULL to fallback
* to the default icon renderering (see #ThunarIconRenderer).
**/
- g_object_class_install_property (gobject_class,
- PROP_DEVICE,
- g_param_spec_object ("device", "device", "device",
- THUNAR_TYPE_DEVICE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_DEVICE] =
+ g_param_spec_object ("device",
+ "device",
+ "device",
+ THUNAR_TYPE_DEVICE,
+ EXO_PARAM_READWRITE);
/**
* ThunarIconRenderer:gicon:
@@ -113,11 +119,14 @@ thunar_shortcuts_icon_renderer_class_init (ThunarShortcutsIconRendererClass *kla
* The GIcon to render, this property has preference over the the icon returned
* by the ThunarFile property.
**/
- g_object_class_install_property (gobject_class,
- PROP_GICON,
- g_param_spec_object ("gicon", "gicon", "gicon",
- G_TYPE_ICON,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_GICON] =
+ g_param_spec_object ("gicon",
+ "gicon",
+ "gicon",
+ G_TYPE_ICON,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
diff --git a/thunar/thunar-shortcuts-model.c b/thunar/thunar-shortcuts-model.c
index ab4c74d..384b56c 100644
--- a/thunar/thunar-shortcuts-model.c
+++ b/thunar/thunar-shortcuts-model.c
@@ -62,7 +62,8 @@ typedef struct _ThunarShortcut ThunarShortcut;
enum
{
PROP_0,
- PROP_HIDDEN_BOOKMARKS
+ PROP_HIDDEN_BOOKMARKS,
+ N_PROPERTIES
};
@@ -203,6 +204,10 @@ struct _ThunarShortcut
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE_WITH_CODE (ThunarShortcutsModel, thunar_shortcuts_model, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, thunar_shortcuts_model_tree_model_init)
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE, thunar_shortcuts_model_drag_source_init))
@@ -219,13 +224,14 @@ thunar_shortcuts_model_class_init (ThunarShortcutsModelClass *klass)
gobject_class->get_property = thunar_shortcuts_model_get_property;
gobject_class->set_property = thunar_shortcuts_model_set_property;
- g_object_class_install_property (gobject_class,
- PROP_HIDDEN_BOOKMARKS,
- g_param_spec_boxed ("hidden-bookmarks",
- NULL,
- NULL,
- G_TYPE_STRV,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_HIDDEN_BOOKMARKS] =
+ g_param_spec_boxed ("hidden-bookmarks",
+ NULL,
+ NULL,
+ G_TYPE_STRV,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
diff --git a/thunar/thunar-shortcuts-pane.c b/thunar/thunar-shortcuts-pane.c
index 621b9a6..e8cc2ea 100644
--- a/thunar/thunar-shortcuts-pane.c
+++ b/thunar/thunar-shortcuts-pane.c
@@ -39,6 +39,7 @@ enum
PROP_SELECTED_FILES,
PROP_SHOW_HIDDEN,
PROP_UI_MANAGER,
+ N_PROPERTIES
};
@@ -100,6 +101,10 @@ static const GtkActionEntry action_entries[] =
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE_WITH_CODE (ThunarShortcutsPane, thunar_shortcuts_pane, GTK_TYPE_SCROLLED_WINDOW,
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_shortcuts_pane_navigator_init)
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_COMPONENT, thunar_shortcuts_pane_component_init)
@@ -111,6 +116,7 @@ static void
thunar_shortcuts_pane_class_init (ThunarShortcutsPaneClass *klass)
{
GObjectClass *gobject_class;
+ gpointer g_iface;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = thunar_shortcuts_pane_dispose;
@@ -119,14 +125,28 @@ thunar_shortcuts_pane_class_init (ThunarShortcutsPaneClass *klass)
gobject_class->set_property = thunar_shortcuts_pane_set_property;
/* override ThunarNavigator's properties */
- g_object_class_override_property (gobject_class, PROP_CURRENT_DIRECTORY, "current-directory");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_NAVIGATOR);
+ property_pspecs[PROP_CURRENT_DIRECTORY] =
+ g_param_spec_override ("current-directory",
+ g_object_interface_find_property (g_iface, "current-directory"));
/* override ThunarComponent's properties */
- g_object_class_override_property (gobject_class, PROP_SELECTED_FILES, "selected-files");
- g_object_class_override_property (gobject_class, PROP_UI_MANAGER, "ui-manager");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_COMPONENT);
+ property_pspecs[PROP_SELECTED_FILES] =
+ g_param_spec_override ("selected-files",
+ g_object_interface_find_property (g_iface, "selected-files"));
+
+ property_pspecs[PROP_UI_MANAGER] =
+ g_param_spec_override ("ui-manager",
+ g_object_interface_find_property (g_iface, "ui-manager"));
/* override ThunarSidePane's properties */
- g_object_class_override_property (gobject_class, PROP_SHOW_HIDDEN, "show-hidden");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_SIDE_PANE);
+ property_pspecs[PROP_SHOW_HIDDEN] =
+ g_param_spec_override ("show-hidden",
+ g_object_interface_find_property (g_iface, "show-hidden"));
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -338,7 +358,7 @@ thunar_shortcuts_pane_set_current_directory (ThunarNavigator *navigator,
}
/* notify listeners */
- g_object_notify (G_OBJECT (shortcuts_pane), "current-directory");
+ _g_object_notify_by_pspec (G_OBJECT (shortcuts_pane), property_pspecs[PROP_CURRENT_DIRECTORY]);
}
@@ -404,7 +424,7 @@ thunar_shortcuts_pane_set_selected_files (ThunarComponent *component,
}
/* notify listeners */
- g_object_notify (G_OBJECT (shortcuts_pane), "selected-files");
+ _g_object_notify_by_pspec (G_OBJECT (shortcuts_pane), property_pspecs[PROP_SELECTED_FILES]);
}
@@ -459,7 +479,7 @@ thunar_shortcuts_pane_set_ui_manager (ThunarComponent *component,
}
/* notify listeners */
- g_object_notify (G_OBJECT (shortcuts_pane), "ui-manager");
+ _g_object_notify_by_pspec (G_OBJECT (shortcuts_pane), property_pspecs[PROP_UI_MANAGER]);
}
diff --git a/thunar/thunar-size-label.c b/thunar/thunar-size-label.c
index dbd5bc7..0226802 100644
--- a/thunar/thunar-size-label.c
+++ b/thunar/thunar-size-label.c
@@ -42,12 +42,12 @@ enum
{
PROP_0,
PROP_FILES,
+ N_PROPERTIES
};
static void thunar_size_label_dispose (GObject *object);
-static void thunar_size_label_finalize (GObject *object);
static void thunar_size_label_get_property (GObject *object,
guint prop_id,
GValue *value,
@@ -95,6 +95,10 @@ struct _ThunarSizeLabel
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarSizeLabel, thunar_size_label, GTK_TYPE_HBOX)
@@ -105,7 +109,6 @@ thunar_size_label_class_init (ThunarSizeLabelClass *klass)
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = thunar_size_label_finalize;
gobject_class->dispose = thunar_size_label_dispose;
gobject_class->get_property = thunar_size_label_get_property;
gobject_class->set_property = thunar_size_label_set_property;
@@ -116,11 +119,14 @@ thunar_size_label_class_init (ThunarSizeLabelClass *klass)
* The #ThunarFile whose size should be displayed
* by this #ThunarSizeLabel.
**/
- g_object_class_install_property (gobject_class,
- PROP_FILES,
- g_param_spec_boxed ("files", "files", "files",
- THUNARX_TYPE_FILE_INFO_LIST,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_FILES] =
+ g_param_spec_boxed ("files",
+ "files",
+ "files",
+ THUNARX_TYPE_FILE_INFO_LIST,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -169,20 +175,10 @@ thunar_size_label_dispose (GObject *object)
/* cancel the pending job (if any) */
thunar_size_label_stop_count (size_label);
- (*G_OBJECT_CLASS (thunar_size_label_parent_class)->dispose) (object);
-}
-
-
-
-static void
-thunar_size_label_finalize (GObject *object)
-{
- ThunarSizeLabel *size_label = THUNAR_SIZE_LABEL (object);
-
/* reset the file property */
thunar_size_label_set_files (size_label, NULL);
- (*G_OBJECT_CLASS (thunar_size_label_parent_class)->finalize) (object);
+ (*G_OBJECT_CLASS (thunar_size_label_parent_class)->dispose) (object);
}
@@ -244,7 +240,7 @@ thunar_size_label_button_press_event (GtkWidget *ebox,
{
/* cancel the pending job (if any) */
thunar_size_label_stop_count (size_label);
-g_message ("aborted");
+
/* tell the user that the operation was canceled */
gtk_label_set_text (GTK_LABEL (size_label->label), _("Calculation aborted"));
@@ -460,7 +456,7 @@ thunar_size_label_set_files (ThunarSizeLabel *size_label,
thunar_size_label_files_changed (size_label);
/* notify listeners */
- g_object_notify (G_OBJECT (size_label), "files");
+ _g_object_notify_by_pspec (G_OBJECT (size_label), property_pspecs[PROP_FILES]);
}
diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index 3f59a19..ec9a569 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -1273,7 +1273,7 @@ thunar_standard_view_set_ui_manager (ThunarComponent *component,
}
/* let others know that we have a new manager */
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_UI_MANAGER]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_UI_MANAGER]);
}
@@ -1483,11 +1483,11 @@ thunar_standard_view_set_current_directory (ThunarNavigator *navigator,
/* NOTE: quickly after this we always trigger a size allocate wich will handle this */
/* notify all listeners about the new/old current directory */
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_CURRENT_DIRECTORY]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_CURRENT_DIRECTORY]);
/* update tab label and tooltip */
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_DISPLAY_NAME]);
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_TOOLTIP_TEXT]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_DISPLAY_NAME]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_TOOLTIP_TEXT]);
/* restore the selection from the history */
thunar_standard_view_restore_selection_from_history (standard_view);
@@ -1608,7 +1608,7 @@ thunar_standard_view_set_loading (ThunarStandardView *standard_view,
/* notify listeners */
g_object_freeze_notify (G_OBJECT (standard_view));
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_LOADING]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_LOADING]);
thunar_standard_view_update_statusbar_text (standard_view);
g_object_thaw_notify (G_OBJECT (standard_view));
}
@@ -1679,7 +1679,7 @@ thunar_standard_view_set_zoom_level (ThunarView *view,
if (G_LIKELY (standard_view->priv->zoom_level != zoom_level))
{
standard_view->priv->zoom_level = zoom_level;
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_ZOOM_LEVEL]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_ZOOM_LEVEL]);
}
}
@@ -2118,7 +2118,7 @@ thunar_standard_view_update_statusbar_text_idle (gpointer data)
standard_view->priv->statusbar_text_idle_id = 0;
/* tell everybody that the statusbar text may have changed */
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_STATUSBAR_TEXT]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_STATUSBAR_TEXT]);
GDK_THREADS_LEAVE ();
@@ -2233,8 +2233,8 @@ thunar_standard_view_current_directory_changed (ThunarFile *current_dire
_thunar_return_if_fail (standard_view->priv->current_directory == current_directory);
/* update tab label and tooltip */
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_DISPLAY_NAME]);
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_TOOLTIP_TEXT]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_DISPLAY_NAME]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_TOOLTIP_TEXT]);
/* directory is possibly moved, schedule a thumbnail update */
thunar_standard_view_schedule_thumbnail_timeout (standard_view);
@@ -3759,7 +3759,7 @@ thunar_standard_view_loading_unbound (gpointer user_data)
{
standard_view->loading = FALSE;
g_object_freeze_notify (G_OBJECT (standard_view));
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_LOADING]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_LOADING]);
thunar_standard_view_update_statusbar_text (standard_view);
g_object_thaw_notify (G_OBJECT (standard_view));
}
@@ -4370,6 +4370,6 @@ thunar_standard_view_selection_changed (ThunarStandardView *standard_view)
thunar_standard_view_update_statusbar_text (standard_view);
/* emit notification for "selected-files" */
- g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_SELECTED_FILES]);
+ _g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_SELECTED_FILES]);
}
diff --git a/thunar/thunar-statusbar.c b/thunar/thunar-statusbar.c
index 39ea7c6..7f62b3d 100644
--- a/thunar/thunar-statusbar.c
+++ b/thunar/thunar-statusbar.c
@@ -35,6 +35,7 @@ enum
{
PROP_0,
PROP_TEXT,
+ N_PROPERTIES
};
@@ -60,6 +61,10 @@ struct _ThunarStatusbar
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarStatusbar, thunar_statusbar, GTK_TYPE_STATUSBAR)
@@ -80,13 +85,14 @@ thunar_statusbar_class_init (ThunarStatusbarClass *klass)
* The main text to be displayed in the statusbar. This property
* can only be written.
**/
- g_object_class_install_property (gobject_class,
- PROP_TEXT,
- g_param_spec_string ("text",
- "text",
- "text",
- NULL,
- EXO_PARAM_WRITABLE));
+ property_pspecs[PROP_TEXT] =
+ g_param_spec_string ("text",
+ "text",
+ "text",
+ NULL,
+ EXO_PARAM_WRITABLE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
if (!style_initialized)
{
diff --git a/thunar/thunar-tree-model.c b/thunar/thunar-tree-model.c
index 391f899..6fc7b13 100644
--- a/thunar/thunar-tree-model.c
+++ b/thunar/thunar-tree-model.c
@@ -54,6 +54,7 @@ enum
{
PROP_0,
PROP_CASE_SENSITIVE,
+ N_PROPERTIES
};
@@ -220,6 +221,10 @@ typedef struct
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE_WITH_CODE (ThunarTreeModel, thunar_tree_model, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL, thunar_tree_model_tree_model_init))
@@ -241,13 +246,14 @@ thunar_tree_model_class_init (ThunarTreeModelClass *klass)
* Whether the sorting of the folder items will be done
* in a case-sensitive manner.
**/
- g_object_class_install_property (gobject_class,
- PROP_CASE_SENSITIVE,
- g_param_spec_boolean ("case-sensitive",
- "case-sensitive",
- "case-sensitive",
- TRUE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_CASE_SENSITIVE] =
+ g_param_spec_boolean ("case-sensitive",
+ "case-sensitive",
+ "case-sensitive",
+ TRUE,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -1865,7 +1871,7 @@ thunar_tree_model_set_case_sensitive (ThunarTreeModel *model,
g_node_traverse (model->root, G_POST_ORDER, G_TRAVERSE_NON_LEAVES, -1, thunar_tree_model_node_traverse_sort, model);
/* notify listeners */
- g_object_notify (G_OBJECT (model), "case-sensitive");
+ _g_object_notify_by_pspec (G_OBJECT (model), property_pspecs[PROP_CASE_SENSITIVE]);
}
}
diff --git a/thunar/thunar-tree-pane.c b/thunar/thunar-tree-pane.c
index c28ea33..3c51fe0 100644
--- a/thunar/thunar-tree-pane.c
+++ b/thunar/thunar-tree-pane.c
@@ -23,6 +23,7 @@
#include <thunar/thunar-tree-pane.h>
#include <thunar/thunar-tree-view.h>
+#include <thunar/thunar-private.h>
@@ -34,6 +35,7 @@ enum
PROP_SELECTED_FILES,
PROP_SHOW_HIDDEN,
PROP_UI_MANAGER,
+ N_PROPERTIES
};
@@ -75,6 +77,10 @@ struct _ThunarTreePane
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE_WITH_CODE (ThunarTreePane, thunar_tree_pane, GTK_TYPE_SCROLLED_WINDOW,
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_tree_pane_navigator_init)
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_COMPONENT, thunar_tree_pane_component_init)
@@ -86,6 +92,7 @@ static void
thunar_tree_pane_class_init (ThunarTreePaneClass *klass)
{
GObjectClass *gobject_class;
+ gpointer g_iface;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = thunar_tree_pane_dispose;
@@ -93,14 +100,28 @@ thunar_tree_pane_class_init (ThunarTreePaneClass *klass)
gobject_class->set_property = thunar_tree_pane_set_property;
/* override ThunarNavigator's properties */
- g_object_class_override_property (gobject_class, PROP_CURRENT_DIRECTORY, "current-directory");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_NAVIGATOR);
+ property_pspecs[PROP_CURRENT_DIRECTORY] =
+ g_param_spec_override ("current-directory",
+ g_object_interface_find_property (g_iface, "current-directory"));
/* override ThunarComponent's properties */
- g_object_class_override_property (gobject_class, PROP_SELECTED_FILES, "selected-files");
- g_object_class_override_property (gobject_class, PROP_UI_MANAGER, "ui-manager");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_COMPONENT);
+ property_pspecs[PROP_SELECTED_FILES] =
+ g_param_spec_override ("selected-files",
+ g_object_interface_find_property (g_iface, "selected-files"));
+
+ property_pspecs[PROP_UI_MANAGER] =
+ g_param_spec_override ("ui-manager",
+ g_object_interface_find_property (g_iface, "ui-manager"));
/* override ThunarSidePane's properties */
- g_object_class_override_property (gobject_class, PROP_SHOW_HIDDEN, "show-hidden");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_SIDE_PANE);
+ property_pspecs[PROP_SHOW_HIDDEN] =
+ g_param_spec_override ("show-hidden",
+ g_object_interface_find_property (g_iface, "show-hidden"));
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -259,7 +280,7 @@ thunar_tree_pane_set_current_directory (ThunarNavigator *navigator,
g_object_ref (G_OBJECT (current_directory));
/* notify listeners */
- g_object_notify (G_OBJECT (tree_pane), "current-directory");
+ _g_object_notify_by_pspec (G_OBJECT (tree_pane), property_pspecs[PROP_CURRENT_DIRECTORY]);
}
@@ -287,7 +308,7 @@ thunar_tree_pane_set_show_hidden (ThunarSidePane *side_pane,
tree_pane->show_hidden = show_hidden;
/* notify listeners */
- g_object_notify (G_OBJECT (tree_pane), "show-hidden");
+ _g_object_notify_by_pspec (G_OBJECT (tree_pane), property_pspecs[PROP_SHOW_HIDDEN]);
}
}
diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c
index ff92fe1..817b4b4 100644
--- a/thunar/thunar-tree-view.c
+++ b/thunar/thunar-tree-view.c
@@ -61,6 +61,7 @@ enum
PROP_0,
PROP_CURRENT_DIRECTORY,
PROP_SHOW_HIDDEN,
+ N_PROPERTIES
};
/* Signal identifiers */
@@ -274,7 +275,8 @@ static const GtkTargetEntry drop_targets[] = {
-static guint tree_view_signals[LAST_SIGNAL];
+static guint tree_view_signals[LAST_SIGNAL];
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -290,6 +292,7 @@ thunar_tree_view_class_init (ThunarTreeViewClass *klass)
GtkWidgetClass *gtkwidget_class;
GtkBindingSet *binding_set;
GObjectClass *gobject_class;
+ gpointer g_iface;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_tree_view_finalize;
@@ -315,7 +318,10 @@ thunar_tree_view_class_init (ThunarTreeViewClass *klass)
klass->delete_selected_files = thunar_tree_view_delete_selected_files;
/* Override ThunarNavigator's properties */
- g_object_class_override_property (gobject_class, PROP_CURRENT_DIRECTORY, "current-directory");
+ g_iface = g_type_default_interface_peek (THUNAR_TYPE_NAVIGATOR);
+ property_pspecs[PROP_CURRENT_DIRECTORY] =
+ g_param_spec_override ("current-directory",
+ g_object_interface_find_property (g_iface, "current-directory"));
/**
* ThunarTreeView:show-hidden:
@@ -323,13 +329,14 @@ thunar_tree_view_class_init (ThunarTreeViewClass *klass)
* Whether to display hidden and backup folders
* in this #ThunarTreeView.
**/
- g_object_class_install_property (gobject_class,
- PROP_SHOW_HIDDEN,
- g_param_spec_boolean ("show-hidden",
- "show-hidden",
- "show-hidden",
- FALSE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_SHOW_HIDDEN] =
+ g_param_spec_boolean ("show-hidden",
+ "show-hidden",
+ "show-hidden",
+ FALSE,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarTreeView::delete-selected-files:
@@ -643,7 +650,7 @@ thunar_tree_view_set_current_directory (ThunarNavigator *navigator,
thunar_tree_model_refilter (view->model);
/* notify listeners */
- g_object_notify (G_OBJECT (view), "current-directory");
+ _g_object_notify_by_pspec (G_OBJECT (view), property_pspecs[PROP_CURRENT_DIRECTORY]);
}
@@ -2619,7 +2626,7 @@ thunar_tree_view_set_show_hidden (ThunarTreeView *view,
thunar_tree_model_refilter (view->model);
/* notify listeners */
- g_object_notify (G_OBJECT (view), "show-hidden");
+ _g_object_notify_by_pspec (G_OBJECT (view), property_pspecs[PROP_SHOW_HIDDEN]);
}
}
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 7db14fb..3af24b0 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -74,6 +74,7 @@ enum
PROP_SHOW_HIDDEN,
PROP_UI_MANAGER,
PROP_ZOOM_LEVEL,
+ N_PROPERTIES
};
/* Signal identifiers */
@@ -388,7 +389,8 @@ static const GtkToggleActionEntry toggle_action_entries[] =
-static guint window_signals[LAST_SIGNAL];
+static guint window_signals[LAST_SIGNAL];
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -431,26 +433,24 @@ thunar_window_class_init (ThunarWindowClass *klass)
* The directory currently displayed within this #ThunarWindow
* or %NULL.
**/
- g_object_class_install_property (gobject_class,
- PROP_CURRENT_DIRECTORY,
- g_param_spec_object ("current-directory",
- "current-directory",
- "current-directory",
- THUNAR_TYPE_FILE,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_CURRENT_DIRECTORY] =
+ g_param_spec_object ("current-directory",
+ "current-directory",
+ "current-directory",
+ THUNAR_TYPE_FILE,
+ EXO_PARAM_READWRITE);
/**
* ThunarWindow:show-hidden:
*
* Whether to show hidden files in the current window.
**/
- g_object_class_install_property (gobject_class,
- PROP_SHOW_HIDDEN,
- g_param_spec_boolean ("show-hidden",
- "show-hidden",
- "show-hidden",
- FALSE,
- EXO_PARAM_READABLE));
+ property_pspecs[PROP_SHOW_HIDDEN] =
+ g_param_spec_boolean ("show-hidden",
+ "show-hidden",
+ "show-hidden",
+ FALSE,
+ EXO_PARAM_READABLE);
/**
* ThunarWindow:ui-manager:
@@ -459,13 +459,12 @@ thunar_window_class_init (ThunarWindowClass *klass)
* can only be read and is garantied to always contain a valid
* #GtkUIManager instance (thus it's never %NULL).
**/
- g_object_class_install_property (gobject_class,
- PROP_UI_MANAGER,
- g_param_spec_object ("ui-manager",
- "ui-manager",
- "ui-manager",
- GTK_TYPE_UI_MANAGER,
- EXO_PARAM_READABLE));
+ property_pspecs[PROP_UI_MANAGER] =
+ g_param_spec_object ("ui-manager",
+ "ui-manager",
+ "ui-manager",
+ GTK_TYPE_UI_MANAGER,
+ EXO_PARAM_READABLE);
/**
* ThunarWindow:zoom-level:
@@ -473,14 +472,15 @@ thunar_window_class_init (ThunarWindowClass *klass)
* The #ThunarZoomLevel applied to the #ThunarView currently
* shown within this window.
**/
- g_object_class_install_property (gobject_class,
- PROP_ZOOM_LEVEL,
- g_param_spec_enum ("zoom-level",
- "zoom-level",
- "zoom-level",
- THUNAR_TYPE_ZOOM_LEVEL,
- THUNAR_ZOOM_LEVEL_NORMAL,
- EXO_PARAM_READWRITE));
+ property_pspecs[PROP_ZOOM_LEVEL] =
+ g_param_spec_enum ("zoom-level",
+ "zoom-level",
+ "zoom-level",
+ THUNAR_TYPE_ZOOM_LEVEL,
+ THUNAR_ZOOM_LEVEL_NORMAL,
+ EXO_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarWindow::back:
@@ -3178,7 +3178,7 @@ thunar_window_action_show_hidden (GtkToggleAction *action,
/* just emit the "notify" signal for the "show-hidden"
* signal and the view will automatically sync its state.
*/
- g_object_notify (G_OBJECT (window), "show-hidden");
+ _g_object_notify_by_pspec (G_OBJECT (window), property_pspecs[PROP_SHOW_HIDDEN]);
if (gtk_widget_get_visible (GTK_WIDGET (window)))
g_object_set (G_OBJECT (window->preferences), "last-show-hidden",
@@ -3627,7 +3627,7 @@ thunar_window_set_zoom_level (ThunarWindow *window,
window->zoom_level = zoom_level;
/* notify listeners */
- g_object_notify (G_OBJECT (window), "zoom-level");
+ _g_object_notify_by_pspec (G_OBJECT (window), property_pspecs[PROP_ZOOM_LEVEL]);
}
/* update the "Zoom In" and "Zoom Out" actions */
@@ -3729,7 +3729,7 @@ thunar_window_set_current_directory (ThunarWindow *window,
* we do this first so other widgets display the new
* state already while the folder view is loading.
*/
- g_object_notify (G_OBJECT (window), "current-directory");
+ _g_object_notify_by_pspec (G_OBJECT (window), property_pspecs[PROP_CURRENT_DIRECTORY]);
}
diff --git a/thunarx/thunarx-property-page.c b/thunarx/thunarx-property-page.c
index f2247e4..eb84250 100644
--- a/thunarx/thunarx-property-page.c
+++ b/thunarx/thunarx-property-page.c
@@ -39,6 +39,7 @@ enum
PROP_0,
PROP_LABEL,
PROP_LABEL_WIDGET,
+ N_PROPERTIES
};
@@ -66,6 +67,10 @@ struct _ThunarxPropertyPagePrivate
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE (ThunarxPropertyPage, thunarx_property_page, GTK_TYPE_BIN)
@@ -96,26 +101,26 @@ thunarx_property_page_class_init (ThunarxPropertyPageClass *klass)
*
* Text of the page's label.
**/
- g_object_class_install_property (gobject_class,
- PROP_LABEL,
- g_param_spec_string ("label",
- _("Label"),
- _("Text of the page's label"),
- NULL,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_LABEL] =
+ g_param_spec_string ("label",
+ _("Label"),
+ _("Text of the page's label"),
+ NULL,
+ G_PARAM_READWRITE);
/**
* ThunarxPropertyPage::label-widget:
*
* A widget to display in place of the usual page label.
**/
- g_object_class_install_property (gobject_class,
- PROP_LABEL_WIDGET,
- g_param_spec_object ("label-widget",
- _("Label widget"),
- _("A widget to display in place of the usual page label"),
- GTK_TYPE_WIDGET,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_LABEL_WIDGET] =
+ g_param_spec_object ("label-widget",
+ _("Label widget"),
+ _("A widget to display in place of the usual page label"),
+ GTK_TYPE_WIDGET,
+ G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -385,7 +390,7 @@ thunarx_property_page_set_label_widget (ThunarxPropertyPage *property_page,
/* notify listeners */
g_object_freeze_notify (G_OBJECT (property_page));
- g_object_notify (G_OBJECT (property_page), "label");
- g_object_notify (G_OBJECT (property_page), "label-widget");
+ g_object_notify_by_pspec (G_OBJECT (property_page), property_pspecs[PROP_LABEL]);
+ g_object_notify_by_pspec (G_OBJECT (property_page), property_pspecs[PROP_LABEL_WIDGET]);
g_object_thaw_notify (G_OBJECT (property_page));
}
diff --git a/thunarx/thunarx-provider-module.c b/thunarx/thunarx-provider-module.c
index 5f998fb..b9be2ca 100644
--- a/thunarx/thunarx-provider-module.c
+++ b/thunarx/thunarx-provider-module.c
@@ -35,6 +35,7 @@ enum
{
PROP_0,
PROP_RESIDENT,
+ N_PROPERTIES
};
@@ -76,6 +77,10 @@ struct _ThunarxProviderModule
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
+
+
+
G_DEFINE_TYPE_WITH_CODE (ThunarxProviderModule, thunarx_provider_module, G_TYPE_TYPE_MODULE,
G_IMPLEMENT_INTERFACE (THUNARX_TYPE_PROVIDER_PLUGIN, thunarx_provider_module_plugin_init))
@@ -86,6 +91,7 @@ thunarx_provider_module_class_init (ThunarxProviderModuleClass *klass)
{
GTypeModuleClass *gtype_module_class;
GObjectClass *gobject_class;
+ gpointer g_iface;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = thunarx_provider_module_get_property;
@@ -96,9 +102,12 @@ thunarx_provider_module_class_init (ThunarxProviderModuleClass *klass)
gtype_module_class->unload = thunarx_provider_module_unload;
/* overload ThunarxProviderPlugin's properties */
- g_object_class_override_property (gobject_class,
- PROP_RESIDENT,
- "resident");
+ g_iface = g_type_default_interface_peek (THUNARX_TYPE_PROVIDER_PLUGIN);
+ property_pspecs[PROP_RESIDENT] =
+ g_param_spec_override ("resident",
+ g_object_interface_find_property (g_iface, "resident"));
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
}
@@ -247,7 +256,7 @@ thunarx_provider_module_set_resident (ThunarxProviderPlugin *plugin,
if (G_LIKELY (module->resident != resident))
{
module->resident = resident;
- g_object_notify (G_OBJECT (module), "resident");
+ g_object_notify_by_pspec (G_OBJECT (module), property_pspecs[PROP_RESIDENT]);
}
}
diff --git a/thunarx/thunarx-renamer.c b/thunarx/thunarx-renamer.c
index 92f50d1..e18630d 100644
--- a/thunarx/thunarx-renamer.c
+++ b/thunarx/thunarx-renamer.c
@@ -39,6 +39,7 @@ enum
PROP_0,
PROP_HELP_URL,
PROP_NAME,
+ N_PROPERTIES
};
/* Signal identifiers */
@@ -84,7 +85,8 @@ struct _ThunarxRenamerPrivate
-static guint renamer_signals[LAST_SIGNAL];
+static guint renamer_signals[LAST_SIGNAL];
+static GParamSpec *property_pspecs[N_PROPERTIES] = { NULL, };
@@ -124,13 +126,12 @@ thunarx_renamer_class_init (ThunarxRenamerClass *klass)
* documentation will be shown when the user clicks the "Help"
* button.
**/
- g_object_class_install_property (gobject_class,
- PROP_HELP_URL,
- g_param_spec_string ("help-url",
- _("Help URL"),
- _("The URL to the documentation of the renamer"),
- NULL,
- G_PARAM_READWRITE));
+ property_pspecs[PROP_HELP_URL] =
+ g_param_spec_string ("help-url",
+ _("Help URL"),
+ _("The URL to the documentation of the renamer"),
+ NULL,
+ G_PARAM_READWRITE);
/**
* ThunarxRenamer:name:
@@ -139,13 +140,14 @@ thunarx_renamer_class_init (ThunarxRenamerClass *klass)
* in the bulk rename dialog of the file manager. Derived
* classes should set a useful name.
**/
- g_object_class_install_property (gobject_class,
- PROP_NAME,
- g_param_spec_string ("name",
- _("Name"),
- _("The user visible name of the renamer"),
- NULL,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ property_pspecs[PROP_NAME] =
+ g_param_spec_string ("name",
+ _("Name"),
+ _("The user visible name of the renamer"),
+ NULL,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
+
+ g_object_class_install_properties (gobject_class, N_PROPERTIES, property_pspecs);
/**
* ThunarxRenamer::changed:
@@ -437,7 +439,7 @@ thunarx_renamer_set_help_url (ThunarxRenamer *renamer,
renamer->priv->help_url = g_strdup (help_url);
/* notify listeners */
- g_object_notify (G_OBJECT (renamer), "help-url");
+ g_object_notify_by_pspec (G_OBJECT (renamer), property_pspecs[PROP_HELP_URL]);
}
@@ -482,7 +484,7 @@ thunarx_renamer_set_name (ThunarxRenamer *renamer,
renamer->priv->name = g_strdup (name);
/* notify listeners */
- g_object_notify (G_OBJECT (renamer), "name");
+ g_object_notify_by_pspec (G_OBJECT (renamer), property_pspecs[PROP_NAME]);
}
More information about the Xfce4-commits
mailing list