[Xfce4-commits] <thunar:master> Drop some deprecated API.

Nick Schermer nick at xfce.org
Sun Aug 23 22:12:01 CEST 2009


Updating branch refs/heads/master
         to d19261c304f66af4318e8a533715b7597fbf3bb7 (commit)
       from 1e2096fcb6bacaadc134d1d99d085532c3df819e (commit)

commit d19261c304f66af4318e8a533715b7597fbf3bb7
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Aug 23 22:10:26 2009 +0200

    Drop some deprecated API.
    
    Most of them are the new tooltip api in plugins and
    GtkEntry -> GtkEditable functions.

 examples/tex-open-terminal/tex-open-terminal.c  |    2 -
 plugins/thunar-apr/thunar-apr-desktop-page.c    |   39 ++++++----------
 plugins/thunar-sbr/thunar-sbr-date-renamer.c    |   20 ++------
 plugins/thunar-sbr/thunar-sbr-replace-renamer.c |   26 ++++-------
 plugins/thunar-tpa/thunar-tpa-icon.c            |   13 +----
 plugins/thunar-uca/thunar-uca-chooser.c         |   35 ++------------
 plugins/thunar-uca/thunar-uca-editor.c          |   57 ++++++----------------
 thunar/thunar-list-model.c                      |    8 ++--
 thunar/thunar-properties-dialog.c               |    4 +-
 thunar/thunar-shortcuts-view.c                  |    2 +-
 thunar/thunar-text-renderer.c                   |    2 +-
 thunarx/thunarx-property-page-provider.c        |    3 +-
 thunarx/thunarx-property-page.c                 |    5 +--
 thunarx/thunarx-renamer-provider.c              |    5 +--
 14 files changed, 64 insertions(+), 157 deletions(-)

diff --git a/examples/tex-open-terminal/tex-open-terminal.c b/examples/tex-open-terminal/tex-open-terminal.c
index 950614b..331b70f 100644
--- a/examples/tex-open-terminal/tex-open-terminal.c
+++ b/examples/tex-open-terminal/tex-open-terminal.c
@@ -33,9 +33,7 @@
 
 
 
-static void   tex_open_terminal_class_init         (TexOpenTerminalClass     *klass);
 static void   tex_open_terminal_menu_provider_init (ThunarxMenuProviderIface *iface);
-static void   tex_open_terminal_init               (TexOpenTerminal          *open_terminal);
 static GList *tex_open_terminal_get_file_actions   (ThunarxMenuProvider      *provider,
                                                     GtkWidget                *window,
                                                     GList                    *files);
diff --git a/plugins/thunar-apr/thunar-apr-desktop-page.c b/plugins/thunar-apr/thunar-apr-desktop-page.c
index b99bad8..fed01fc 100644
--- a/plugins/thunar-apr/thunar-apr-desktop-page.c
+++ b/plugins/thunar-apr/thunar-apr-desktop-page.c
@@ -75,8 +75,6 @@ struct _ThunarAprDesktopPageClass
 struct _ThunarAprDesktopPage
 {
   ThunarAprAbstractPage __parent__;
-  
-  GtkTooltips          *tooltips;
 
   GtkWidget            *description_entry;
   GtkWidget            *command_entry;
@@ -136,10 +134,6 @@ thunar_apr_desktop_page_init (ThunarAprDesktopPage *desktop_page)
 
   gtk_container_set_border_width (GTK_CONTAINER (desktop_page), 12);
 
-  /* allocate the shared tooltips */
-  desktop_page->tooltips = gtk_tooltips_new ();
-  g_object_ref_sink (G_OBJECT (desktop_page->tooltips));
-
   /* allocate shared bold Pango attributes */
   attr_list = pango_attr_list_new ();
   attribute = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
@@ -160,8 +154,8 @@ thunar_apr_desktop_page_init (ThunarAprDesktopPage *desktop_page)
   gtk_widget_show (label);
 
   desktop_page->description_entry = gtk_entry_new ();
-  gtk_tooltips_set_tip (desktop_page->tooltips, desktop_page->description_entry, _("The generic name of the entry, for example \"Web Browser\" "
-                                                                                   "in case of Firefox."), NULL);
+  gtk_widget_set_tooltip_text (desktop_page->description_entry, _("The generic name of the entry, for example \"Web Browser\" "
+                                                                  "in case of Firefox."));
   g_signal_connect (G_OBJECT (desktop_page->description_entry), "activate", G_CALLBACK (thunar_apr_desktop_page_activated), desktop_page);
   g_signal_connect (G_OBJECT (desktop_page->description_entry), "focus-out-event", G_CALLBACK (thunar_apr_desktop_page_focus_out_event), desktop_page);
   gtk_table_attach (GTK_TABLE (table), desktop_page->description_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
@@ -183,7 +177,7 @@ thunar_apr_desktop_page_init (ThunarAprDesktopPage *desktop_page)
   gtk_widget_show (label);
 
   desktop_page->command_entry = gtk_entry_new ();
-  gtk_tooltips_set_tip (desktop_page->tooltips, desktop_page->command_entry, _("The program to execute, possibly with arguments."), NULL);
+  gtk_widget_set_tooltip_text (desktop_page->command_entry, _("The program to execute, possibly with arguments."));
   g_signal_connect (G_OBJECT (desktop_page->command_entry), "activate", G_CALLBACK (thunar_apr_desktop_page_activated), desktop_page);
   g_signal_connect (G_OBJECT (desktop_page->command_entry), "focus-out-event", G_CALLBACK (thunar_apr_desktop_page_focus_out_event), desktop_page);
   gtk_table_attach (GTK_TABLE (table), desktop_page->command_entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
@@ -205,7 +199,7 @@ thunar_apr_desktop_page_init (ThunarAprDesktopPage *desktop_page)
   gtk_widget_show (label);
 
   desktop_page->url_entry = gtk_entry_new ();
-  gtk_tooltips_set_tip (desktop_page->tooltips, desktop_page->url_entry, _("The URL to access."), NULL);
+  gtk_widget_set_tooltip_text (desktop_page->url_entry, _("The URL to access."));
   g_signal_connect (G_OBJECT (desktop_page->url_entry), "activate", G_CALLBACK (thunar_apr_desktop_page_activated), desktop_page);
   g_signal_connect (G_OBJECT (desktop_page->url_entry), "focus-out-event", G_CALLBACK (thunar_apr_desktop_page_focus_out_event), desktop_page);
   gtk_table_attach (GTK_TABLE (table), desktop_page->url_entry, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
@@ -227,9 +221,9 @@ thunar_apr_desktop_page_init (ThunarAprDesktopPage *desktop_page)
   gtk_widget_show (label);
 
   desktop_page->comment_entry = gtk_entry_new ();
-  gtk_tooltips_set_tip (desktop_page->tooltips, desktop_page->comment_entry, _("Tooltip for the entry, for example \"View sites on the Internet\" "
-                                                                               "in case of Firefox. Should not be redundant with the name or the "
-                                                                               "description."), NULL);
+  gtk_widget_set_tooltip_text (desktop_page->comment_entry, _("Tooltip for the entry, for example \"View sites on the Internet\" "
+                                                              "in case of Firefox. Should not be redundant with the name or the "
+                                                              "description."));
   g_signal_connect (G_OBJECT (desktop_page->comment_entry), "activate", G_CALLBACK (thunar_apr_desktop_page_activated), desktop_page);
   g_signal_connect (G_OBJECT (desktop_page->comment_entry), "focus-out-event", G_CALLBACK (thunar_apr_desktop_page_focus_out_event), desktop_page);
   gtk_table_attach (GTK_TABLE (table), desktop_page->comment_entry, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
@@ -254,15 +248,15 @@ thunar_apr_desktop_page_init (ThunarAprDesktopPage *desktop_page)
   gtk_widget_show (label);
 
   desktop_page->snotify_button = gtk_check_button_new_with_mnemonic (_("Use _startup notification"));
-  gtk_tooltips_set_tip (desktop_page->tooltips, desktop_page->snotify_button, _("Select this option to enable startup notification when the command "
-                                                                                "is run from the file manager or the menu. Not every application supports "
-                                                                                "startup notification."), NULL);
+  gtk_widget_set_tooltip_text (desktop_page->snotify_button, _("Select this option to enable startup notification when the command "
+                                                               "is run from the file manager or the menu. Not every application supports "
+                                                               "startup notification."));
   g_signal_connect (G_OBJECT (desktop_page->snotify_button), "toggled", G_CALLBACK (thunar_apr_desktop_page_toggled), desktop_page);
   gtk_table_attach (GTK_TABLE (table), desktop_page->snotify_button, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
   gtk_widget_show (desktop_page->snotify_button);
 
   desktop_page->terminal_button = gtk_check_button_new_with_mnemonic (_("Run in _terminal"));
-  gtk_tooltips_set_tip (desktop_page->tooltips, desktop_page->terminal_button, _("Select this option to run the command in a terminal window."), NULL);
+  gtk_widget_set_tooltip_text (desktop_page->terminal_button, _("Select this option to run the command in a terminal window."));
   g_signal_connect (G_OBJECT (desktop_page->terminal_button), "toggled", G_CALLBACK (thunar_apr_desktop_page_toggled), desktop_page);
   gtk_table_attach (GTK_TABLE (table), desktop_page->terminal_button, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
   gtk_widget_show (desktop_page->terminal_button);
@@ -291,9 +285,6 @@ thunar_apr_desktop_page_finalize (GObject *object)
 {
   ThunarAprDesktopPage *desktop_page = THUNAR_APR_DESKTOP_PAGE (object);
 
-  /* release the shared tooltips */
-  g_object_unref (G_OBJECT (desktop_page->tooltips));
-
   /* release the saved texts */
   g_free (desktop_page->description_text);
   g_free (desktop_page->command_text);
@@ -451,10 +442,10 @@ thunar_apr_desktop_page_file_changed (ThunarAprAbstractPage *abstract_page,
       writable = (g_access (filename, W_OK) == 0);
 
       /* ...and update the editability of the entries */
-      gtk_entry_set_editable (GTK_ENTRY (desktop_page->description_entry), writable);
-      gtk_entry_set_editable (GTK_ENTRY (desktop_page->command_entry), writable);
-      gtk_entry_set_editable (GTK_ENTRY (desktop_page->url_entry), writable);
-      gtk_entry_set_editable (GTK_ENTRY (desktop_page->comment_entry), writable);
+      gtk_editable_set_editable (GTK_EDITABLE (desktop_page->description_entry), writable);
+      gtk_editable_set_editable (GTK_EDITABLE (desktop_page->command_entry), writable);
+      gtk_editable_set_editable (GTK_EDITABLE (desktop_page->url_entry), writable);
+      gtk_editable_set_editable (GTK_EDITABLE (desktop_page->comment_entry), writable);
       gtk_widget_set_sensitive (desktop_page->snotify_button, writable);
       gtk_widget_set_sensitive (desktop_page->terminal_button, writable);
 
diff --git a/plugins/thunar-sbr/thunar-sbr-date-renamer.c b/plugins/thunar-sbr/thunar-sbr-date-renamer.c
index 8f0deaa..6f3afcb 100644
--- a/plugins/thunar-sbr/thunar-sbr-date-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-date-renamer.c
@@ -87,7 +87,6 @@ struct _ThunarSbrDateRenamerClass
 struct _ThunarSbrDateRenamer
 {
   ThunarxRenamer      __parent__;
-  GtkTooltips        *tooltips;
   ThunarSbrDateMode   mode;
   guint               offset;
   ThunarSbrOffsetMode offset_mode;
@@ -185,10 +184,6 @@ thunar_sbr_date_renamer_init (ThunarSbrDateRenamer *date_renamer)
   GtkAdjustment  *adjustment;
   guint           n;
 
-  /* allocate tooltips for the renamer */
-  date_renamer->tooltips = gtk_tooltips_new ();
-  g_object_ref_sink (G_OBJECT (date_renamer->tooltips));
-
   vbox = gtk_vbox_new (FALSE, 6);
   gtk_box_pack_start (GTK_BOX (date_renamer), vbox, TRUE, TRUE, 0);
   gtk_widget_show (vbox);
@@ -225,12 +220,12 @@ thunar_sbr_date_renamer_init (ThunarSbrDateRenamer *date_renamer)
   entry = gtk_entry_new ();
   exo_mutual_binding_new (G_OBJECT (entry), "text", G_OBJECT (date_renamer), "format");
   gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
-  gtk_tooltips_set_tip (date_renamer->tooltips, entry,
-                        _("The format describes the date and time parts to insert "
-                          "into the file name. For example, %Y will be substituted "
-                          "with the year, %m with the month and %d with the day. "
-                          "See the documentation of the date utility for additional "
-                          "information."), NULL);
+  gtk_widget_set_tooltip_text (entry,
+                               _("The format describes the date and time parts to insert "
+                                "into the file name. For example, %Y will be substituted "
+                                "with the year, %m with the month and %d with the day. "
+                                "See the documentation of the date utility for additional "
+                                "information."));
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
   gtk_widget_show (entry);
 
@@ -280,9 +275,6 @@ thunar_sbr_date_renamer_finalize (GObject *object)
 {
   ThunarSbrDateRenamer *date_renamer = THUNAR_SBR_DATE_RENAMER (object);
 
-  /* release the tooltips */
-  g_object_unref (G_OBJECT (date_renamer->tooltips));
-
   /* release the format */
   g_free (date_renamer->format);
 
diff --git a/plugins/thunar-sbr/thunar-sbr-replace-renamer.c b/plugins/thunar-sbr/thunar-sbr-replace-renamer.c
index 8774fbd..ef51512 100644
--- a/plugins/thunar-sbr/thunar-sbr-replace-renamer.c
+++ b/plugins/thunar-sbr/thunar-sbr-replace-renamer.c
@@ -81,7 +81,6 @@ struct _ThunarSbrReplaceRenamerClass
 struct _ThunarSbrReplaceRenamer
 {
   ThunarxRenamer __parent__;
-  GtkTooltips   *tooltips;
   GtkWidget     *pattern_entry;
   gboolean       case_sensitive;
   gboolean       regexp;
@@ -194,10 +193,6 @@ thunar_sbr_replace_renamer_init (ThunarSbrReplaceRenamer *replace_renamer)
     replace_renamer->regexp_supported = FALSE;
 #endif
 
-  /* allocate the shared tooltips */
-  replace_renamer->tooltips = gtk_tooltips_new ();
-  g_object_ref_sink (G_OBJECT (replace_renamer->tooltips));
-
   table = gtk_table_new (2, 3, FALSE);
   gtk_table_set_row_spacings (GTK_TABLE (table), 6);
   gtk_table_set_col_spacings (GTK_TABLE (table), 12);
@@ -212,7 +207,7 @@ thunar_sbr_replace_renamer_init (ThunarSbrReplaceRenamer *replace_renamer)
   replace_renamer->pattern_entry = gtk_entry_new ();
   gtk_entry_set_activates_default (GTK_ENTRY (replace_renamer->pattern_entry), TRUE);
   exo_mutual_binding_new (G_OBJECT (replace_renamer->pattern_entry), "text", G_OBJECT (replace_renamer), "pattern");
-  gtk_tooltips_set_tip (replace_renamer->tooltips, replace_renamer->pattern_entry, _("Enter the text to search for in the file names."), NULL);
+  gtk_widget_set_tooltip_text (replace_renamer->pattern_entry, _("Enter the text to search for in the file names."));
   gtk_table_attach (GTK_TABLE (table), replace_renamer->pattern_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), replace_renamer->pattern_entry);
   gtk_widget_show (replace_renamer->pattern_entry);
@@ -226,9 +221,9 @@ thunar_sbr_replace_renamer_init (ThunarSbrReplaceRenamer *replace_renamer)
 
   button = gtk_check_button_new_with_mnemonic (_("Regular _Expression"));
   exo_mutual_binding_new (G_OBJECT (button), "active", G_OBJECT (replace_renamer), "regexp");
-  gtk_tooltips_set_tip (replace_renamer->tooltips, button, _("If you enable this option, the pattern will be treated as a regular expression and "
-                                                             "matched using the Perl-compatible regular expressions (PCRE). Check the documentation "
-                                                             "for details about the regular expression syntax."), NULL);
+  gtk_widget_set_tooltip_text (button, _("If you enable this option, the pattern will be treated as a regular expression and "
+                                         "matched using the Perl-compatible regular expressions (PCRE). Check the documentation "
+                                         "for details about the regular expression syntax."));
   gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1, GTK_FILL, 0, 0, 0);
   gtk_widget_set_sensitive (button, replace_renamer->regexp_supported);
   gtk_widget_show (button);
@@ -241,7 +236,7 @@ thunar_sbr_replace_renamer_init (ThunarSbrReplaceRenamer *replace_renamer)
   entry = gtk_entry_new ();
   gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
   exo_mutual_binding_new (G_OBJECT (entry), "text", G_OBJECT (replace_renamer), "replacement");
-  gtk_tooltips_set_tip (replace_renamer->tooltips, entry, _("Enter the text that should be used as replacement for the pattern above."), NULL);
+  gtk_widget_set_tooltip_text (entry, _("Enter the text that should be used as replacement for the pattern above."));
   gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 0, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
   gtk_widget_show (entry);
@@ -255,8 +250,8 @@ thunar_sbr_replace_renamer_init (ThunarSbrReplaceRenamer *replace_renamer)
 
   button = gtk_check_button_new_with_mnemonic (_("C_ase Sensitive Search"));
   exo_mutual_binding_new (G_OBJECT (button), "active", G_OBJECT (replace_renamer), "case-sensitive");
-  gtk_tooltips_set_tip (replace_renamer->tooltips, button, _("If you enable this option, the pattern will be searched in a case-sensitive manner. "
-                                                             "The default is to use a case-insensitive search."), NULL);
+  gtk_widget_set_tooltip_text (button, _("If you enable this option, the pattern will be searched in a case-sensitive manner. "
+                                         "The default is to use a case-insensitive search."));
   gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2, GTK_FILL, 0, 0, 0);
   gtk_widget_show (button);
 }
@@ -274,9 +269,6 @@ thunar_sbr_replace_renamer_finalize (GObject *object)
     pcre_free (replace_renamer->pcre_pattern);
 #endif
 
-  /* release the tooltips */
-  g_object_unref (G_OBJECT (replace_renamer->tooltips));
-
   /* release the strings */
   g_free (replace_renamer->replacement);
   g_free (replace_renamer->pattern);
@@ -616,7 +608,7 @@ thunar_sbr_replace_renamer_pcre_update (ThunarSbrReplaceRenamer *replace_renamer
 
           /* setup a tooltip with the error message */
           tooltip = g_strdup_printf (_("Invalid regular expression, at character position %ld: %s"), offset, message);
-          gtk_tooltips_set_tip (replace_renamer->tooltips, replace_renamer->pattern_entry, tooltip, NULL);
+          gtk_widget_set_tooltip_text (replace_renamer->pattern_entry, tooltip);
           g_free (tooltip);
         }
       g_free (message);
@@ -647,7 +639,7 @@ thunar_sbr_replace_renamer_pcre_update (ThunarSbrReplaceRenamer *replace_renamer
         }
 
       /* reset to default tooltip */
-      gtk_tooltips_set_tip (replace_renamer->tooltips, replace_renamer->pattern_entry, _("Enter the text to search for in the file names."), NULL);
+      gtk_widget_set_tooltip_text (replace_renamer->pattern_entry, _("Enter the text to search for in the file names."));
     }
 }
 #endif
diff --git a/plugins/thunar-tpa/thunar-tpa-icon.c b/plugins/thunar-tpa/thunar-tpa-icon.c
index da38304..b6cf309 100644
--- a/plugins/thunar-tpa/thunar-tpa-icon.c
+++ b/plugins/thunar-tpa/thunar-tpa-icon.c
@@ -100,7 +100,6 @@ struct _ThunarTpaIcon
 
   gboolean full;
 
-  GtkTooltips *tooltips;
   GtkWidget   *button;
   GtkWidget   *image;
 
@@ -158,11 +157,6 @@ thunar_tpa_icon_init (ThunarTpaIcon *icon)
 
   gtk_alignment_set (GTK_ALIGNMENT (icon), 0.5f, 0.5f, 1.0f, 1.0f);
 
-  /* allocate the shared tooltips */
-  icon->tooltips = gtk_tooltips_new ();
-  g_object_ref (G_OBJECT (icon->tooltips));
-  gtk_object_sink (GTK_OBJECT (icon->tooltips));
-
   /* setup the button for the trash icon */
   icon->button = xfce_create_panel_button ();
   GTK_WIDGET_UNSET_FLAGS (icon->button, GTK_CAN_DEFAULT);
@@ -226,9 +220,6 @@ thunar_tpa_icon_finalize (GObject *object)
       g_object_unref (G_OBJECT (icon->proxy));
     }
 
-  /* release the shared tooltips */
-  g_object_unref (G_OBJECT (icon->tooltips));
-
   (*G_OBJECT_CLASS (thunar_tpa_icon_parent_class)->finalize) (object);
 }
 
@@ -270,7 +261,7 @@ thunar_tpa_icon_error (ThunarTpaIcon *icon,
 
   /* tell the user that we failed to connect to the trash */
   tooltip = g_strdup_printf ("%s: %s.", _("Failed to connect to the Trash"), error->message);
-  gtk_tooltips_set_tip (icon->tooltips, icon->button, tooltip, NULL);
+  gtk_widget_set_tooltip_text (icon->button, tooltip);
   g_free (tooltip);
 
   /* setup an error icon */
@@ -284,7 +275,7 @@ thunar_tpa_icon_state (ThunarTpaIcon *icon,
                        gboolean       full)
 {
   /* tell the user whether the trash is full or empty */
-  gtk_tooltips_set_tip (icon->tooltips, icon->button, full ? _("Trash contains files") : _("Trash is empty"), NULL);
+  gtk_widget_set_tooltip_text (icon->button, full ? _("Trash contains files") : _("Trash is empty"));
 
   /* setup the appropriate icon */
   gtk_image_set_from_icon_name (GTK_IMAGE (icon->image), full ? "gnome-fs-trash-full" : "gnome-fs-trash-empty", GTK_ICON_SIZE_BUTTON);
diff --git a/plugins/thunar-uca/thunar-uca-chooser.c b/plugins/thunar-uca/thunar-uca-chooser.c
index 1aa9c6b..f9f40f8 100644
--- a/plugins/thunar-uca/thunar-uca-chooser.c
+++ b/plugins/thunar-uca/thunar-uca-chooser.c
@@ -32,7 +32,6 @@
 
 
 
-static void     thunar_uca_chooser_finalize           (GObject                *object);
 static gboolean thunar_uca_chooser_key_press_event    (GtkWidget              *widget,
                                                        GdkEventKey            *event);
 static void     thunar_uca_chooser_response           (GtkDialog              *dialog,
@@ -65,8 +64,6 @@ struct _ThunarUcaChooser
 {
   GtkDialog __parent__;
 
-  GtkTooltips *tooltips;
-
   GtkWidget   *treeview;
   GtkWidget   *add_button;
   GtkWidget   *edit_button;
@@ -86,10 +83,6 @@ thunar_uca_chooser_class_init (ThunarUcaChooserClass *klass)
 {
   GtkDialogClass *gtkdialog_class;
   GtkWidgetClass *gtkwidget_class;
-  GObjectClass   *gobject_class;
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = thunar_uca_chooser_finalize;
 
   gtkwidget_class = GTK_WIDGET_CLASS (klass);
   gtkwidget_class->key_press_event = thunar_uca_chooser_key_press_event;
@@ -122,11 +115,6 @@ thunar_uca_chooser_init (ThunarUcaChooser *uca_chooser)
   gtk_window_set_destroy_with_parent (GTK_WINDOW (uca_chooser), TRUE);
   gtk_window_set_title (GTK_WINDOW (uca_chooser), _("Custom Actions"));
 
-  /* allocate shared tooltips object */
-  uca_chooser->tooltips = gtk_tooltips_new ();
-  g_object_ref (G_OBJECT (uca_chooser->tooltips));
-  gtk_object_sink (GTK_OBJECT (uca_chooser->tooltips));
-
   hbox = gtk_hbox_new (FALSE, 3);
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (uca_chooser)->vbox), hbox, FALSE, TRUE, 0);
@@ -182,7 +170,7 @@ thunar_uca_chooser_init (ThunarUcaChooser *uca_chooser)
   gtk_widget_show (vbox);
 
   uca_chooser->add_button = gtk_button_new ();
-  gtk_tooltips_set_tip (uca_chooser->tooltips, uca_chooser->add_button, _("Add a new custom action."), NULL);
+  gtk_widget_set_tooltip_text (uca_chooser->add_button, _("Add a new custom action."));
   gtk_box_pack_start (GTK_BOX (vbox), uca_chooser->add_button, FALSE, FALSE, 0);
   g_signal_connect_swapped (G_OBJECT (uca_chooser->add_button), "clicked", G_CALLBACK (thunar_uca_chooser_add_clicked), uca_chooser);
   gtk_widget_show (uca_chooser->add_button);
@@ -192,7 +180,7 @@ thunar_uca_chooser_init (ThunarUcaChooser *uca_chooser)
   gtk_widget_show (image);
 
   uca_chooser->edit_button = gtk_button_new ();
-  gtk_tooltips_set_tip (uca_chooser->tooltips, uca_chooser->edit_button, _("Edit the currently selected action."), NULL);
+  gtk_widget_set_tooltip_text (uca_chooser->edit_button, _("Edit the currently selected action."));
   gtk_box_pack_start (GTK_BOX (vbox), uca_chooser->edit_button, FALSE, FALSE, 0);
   g_signal_connect_swapped (G_OBJECT (uca_chooser->edit_button), "clicked", G_CALLBACK (thunar_uca_chooser_edit_clicked), uca_chooser);
   gtk_widget_show (uca_chooser->edit_button);
@@ -202,7 +190,7 @@ thunar_uca_chooser_init (ThunarUcaChooser *uca_chooser)
   gtk_widget_show (image);
 
   uca_chooser->delete_button = gtk_button_new ();
-  gtk_tooltips_set_tip (uca_chooser->tooltips, uca_chooser->delete_button, _("Delete the currently selected action."), NULL);
+  gtk_widget_set_tooltip_text (uca_chooser->delete_button, _("Delete the currently selected action."));
   gtk_box_pack_start (GTK_BOX (vbox), uca_chooser->delete_button, FALSE, FALSE, 0);
   g_signal_connect_swapped (G_OBJECT (uca_chooser->delete_button), "clicked", G_CALLBACK (thunar_uca_chooser_delete_clicked), uca_chooser);
   gtk_widget_show (uca_chooser->delete_button);
@@ -212,7 +200,7 @@ thunar_uca_chooser_init (ThunarUcaChooser *uca_chooser)
   gtk_widget_show (image);
 
   uca_chooser->up_button = gtk_button_new ();
-  gtk_tooltips_set_tip (uca_chooser->tooltips, uca_chooser->up_button, _("Move the currently selected action up by one row."), NULL);
+  gtk_widget_set_tooltip_text (uca_chooser->up_button, _("Move the currently selected action up by one row."));
   gtk_box_pack_start (GTK_BOX (vbox), uca_chooser->up_button, FALSE, FALSE, 0);
   g_signal_connect_swapped (G_OBJECT (uca_chooser->up_button), "clicked", G_CALLBACK (thunar_uca_chooser_up_clicked), uca_chooser);
   gtk_widget_show (uca_chooser->up_button);
@@ -222,7 +210,7 @@ thunar_uca_chooser_init (ThunarUcaChooser *uca_chooser)
   gtk_widget_show (image);
 
   uca_chooser->down_button = gtk_button_new ();
-  gtk_tooltips_set_tip (uca_chooser->tooltips, uca_chooser->down_button, _("Move the currently selected action down by one row."), NULL);
+  gtk_widget_set_tooltip_text (uca_chooser->down_button, _("Move the currently selected action down by one row."));
   gtk_box_pack_start (GTK_BOX (vbox), uca_chooser->down_button, FALSE, FALSE, 0);
   g_signal_connect_swapped (G_OBJECT (uca_chooser->down_button), "clicked", G_CALLBACK (thunar_uca_chooser_down_clicked), uca_chooser);
   gtk_widget_show (uca_chooser->down_button);
@@ -240,19 +228,6 @@ thunar_uca_chooser_init (ThunarUcaChooser *uca_chooser)
 
 
 
-static void
-thunar_uca_chooser_finalize (GObject *object)
-{
-  ThunarUcaChooser *uca_chooser = THUNAR_UCA_CHOOSER (object);
-
-  /* release the tooltips */
-  g_object_unref (G_OBJECT (uca_chooser->tooltips));
-
-  (*G_OBJECT_CLASS (thunar_uca_chooser_parent_class)->finalize) (object);
-}
-
-
-
 static gboolean
 thunar_uca_chooser_key_press_event (GtkWidget   *widget,
                                     GdkEventKey *event)
diff --git a/plugins/thunar-uca/thunar-uca-editor.c b/plugins/thunar-uca/thunar-uca-editor.c
index aaa0617..e513fbd 100644
--- a/plugins/thunar-uca/thunar-uca-editor.c
+++ b/plugins/thunar-uca/thunar-uca-editor.c
@@ -35,7 +35,6 @@
 
 
 
-static void           thunar_uca_editor_finalize        (GObject                *object);
 static const gchar   *thunar_uca_editor_get_icon_name   (const ThunarUcaEditor  *uca_editor);
 static void           thunar_uca_editor_set_icon_name   (ThunarUcaEditor        *uca_editor,
                                                          const gchar            *icon_name);
@@ -56,8 +55,6 @@ struct _ThunarUcaEditor
 {
   GtkDialog __parent__;
 
-  GtkTooltips *tooltips;
-
   GtkWidget   *name_entry;
   GtkWidget   *description_entry;
   GtkWidget   *icon_button;
@@ -81,10 +78,6 @@ THUNARX_DEFINE_TYPE (ThunarUcaEditor, thunar_uca_editor, GTK_TYPE_DIALOG);
 static void
 thunar_uca_editor_class_init (ThunarUcaEditorClass *klass)
 {
-  GObjectClass *gobject_class;
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = thunar_uca_editor_finalize;
 }
 
 
@@ -117,11 +110,6 @@ thunar_uca_editor_init (ThunarUcaEditor *uca_editor)
   gtk_window_set_destroy_with_parent (GTK_WINDOW (uca_editor), TRUE);
   gtk_window_set_resizable (GTK_WINDOW (uca_editor), FALSE);
 
-  /* allocate shared tooltips object */
-  uca_editor->tooltips = gtk_tooltips_new ();
-  g_object_ref (G_OBJECT (uca_editor->tooltips));
-  gtk_object_sink (GTK_OBJECT (uca_editor->tooltips));
-
   notebook = gtk_notebook_new ();
   gtk_container_set_border_width (GTK_CONTAINER (notebook), 6);
   gtk_box_pack_start (GTK_BOX (GTK_DIALOG (uca_editor)->vbox), notebook, TRUE, TRUE, 0);
@@ -144,7 +132,7 @@ thunar_uca_editor_init (ThunarUcaEditor *uca_editor)
   gtk_widget_show (label);
 
   uca_editor->name_entry = g_object_new (GTK_TYPE_ENTRY, "activates-default", TRUE, NULL);
-  gtk_tooltips_set_tip (uca_editor->tooltips, uca_editor->name_entry, _("The name of the action that will be displayed in the context menu."), NULL);
+  gtk_widget_set_tooltip_text (uca_editor->name_entry, _("The name of the action that will be displayed in the context menu."));
   gtk_table_attach (GTK_TABLE (table), uca_editor->name_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), uca_editor->name_entry);
   gtk_widget_grab_focus (uca_editor->name_entry);
@@ -162,8 +150,8 @@ thunar_uca_editor_init (ThunarUcaEditor *uca_editor)
   gtk_widget_show (label);
 
   uca_editor->description_entry = g_object_new (GTK_TYPE_ENTRY, "activates-default", TRUE, NULL);
-  gtk_tooltips_set_tip (uca_editor->tooltips, uca_editor->description_entry, _("The description of the action that will be displayed as tooltip "
-                                                                               "in the statusbar when selecting the item from the context menu."), NULL);
+  gtk_widget_set_tooltip_text (uca_editor->description_entry, _("The description of the action that will be displayed as tooltip "
+                                                                "in the statusbar when selecting the item from the context menu."));
   gtk_table_attach (GTK_TABLE (table), uca_editor->description_entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), uca_editor->description_entry);
   gtk_widget_show (uca_editor->description_entry);
@@ -184,18 +172,18 @@ thunar_uca_editor_init (ThunarUcaEditor *uca_editor)
   gtk_widget_show (hbox);
 
   uca_editor->command_entry = g_object_new (GTK_TYPE_ENTRY, "activates-default", TRUE, NULL);
-  gtk_tooltips_set_tip (uca_editor->tooltips, uca_editor->command_entry, _("The command (including the necessary parameters) to perform the action. "
-                                                                           "See the command parameter legend below for a list of supported parameter "
-                                                                           "variables, which will be substituted when launching the command. When "
-                                                                           "upper-case letters (e.g. %F, %D, %N) are used, the action will be applicable "
-                                                                           "even if more than one item is selected. Else the action will only be "
-                                                                           "applicable if exactly one item is selected."), NULL);
+  gtk_widget_set_tooltip_text (uca_editor->command_entry, _("The command (including the necessary parameters) to perform the action. "
+                                                            "See the command parameter legend below for a list of supported parameter "
+                                                            "variables, which will be substituted when launching the command. When "
+                                                            "upper-case letters (e.g. %F, %D, %N) are used, the action will be applicable "
+                                                            "even if more than one item is selected. Else the action will only be "
+                                                            "applicable if exactly one item is selected."));
   gtk_box_pack_start (GTK_BOX (hbox), uca_editor->command_entry, TRUE, TRUE, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), uca_editor->command_entry);
   gtk_widget_show (uca_editor->command_entry);
 
   button = gtk_button_new ();
-  gtk_tooltips_set_tip (uca_editor->tooltips, button, _("Browse the file system to select an application to use for this action."), NULL);
+  gtk_widget_set_tooltip_text (button, _("Browse the file system to select an application to use for this action."));
   gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
   g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (thunar_uca_editor_command_clicked), uca_editor);
   gtk_widget_show (button);
@@ -220,8 +208,8 @@ thunar_uca_editor_init (ThunarUcaEditor *uca_editor)
   gtk_widget_show (align);
 
   uca_editor->icon_button = gtk_button_new_with_label (_("No icon"));
-  gtk_tooltips_set_tip (uca_editor->tooltips, uca_editor->icon_button, _("Click this button to select an icon file that will be displayed "
-                                                                         "in the context menu in addition to the action name chosen above."), NULL);
+  gtk_widget_set_tooltip_text (uca_editor->icon_button, _("Click this button to select an icon file that will be displayed "
+                                                          "in the context menu in addition to the action name chosen above."));
   gtk_container_add (GTK_CONTAINER (align), uca_editor->icon_button);
   g_signal_connect_swapped (G_OBJECT (uca_editor->icon_button), "clicked", G_CALLBACK (thunar_uca_editor_icon_clicked), uca_editor);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), uca_editor->icon_button);
@@ -376,10 +364,10 @@ thunar_uca_editor_init (ThunarUcaEditor *uca_editor)
   gtk_widget_show (label);
 
   uca_editor->patterns_entry = g_object_new (GTK_TYPE_ENTRY, "activates-default", TRUE, "text", "*", NULL);
-  gtk_tooltips_set_tip (uca_editor->tooltips, uca_editor->patterns_entry, _("Enter a list of patterns that will be used to determine "
-                                                                            "whether this action should be displayed for a selected "
-                                                                            "file. If you specify more than one pattern here, the list "
-                                                                            "items must be separated with semicolons (e.g. *.txt;*.doc)."), NULL);
+  gtk_widget_set_tooltip_text (uca_editor->patterns_entry, _("Enter a list of patterns that will be used to determine "
+                                                             "whether this action should be displayed for a selected "
+                                                             "file. If you specify more than one pattern here, the list "
+                                                             "items must be separated with semicolons (e.g. *.txt;*.doc)."));
   gtk_table_attach (GTK_TABLE (table), uca_editor->patterns_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), uca_editor->patterns_entry);
   gtk_widget_show (uca_editor->patterns_entry);
@@ -463,19 +451,6 @@ thunar_uca_editor_init (ThunarUcaEditor *uca_editor)
 
 
 static void
-thunar_uca_editor_finalize (GObject *object)
-{
-  ThunarUcaEditor *uca_editor = THUNAR_UCA_EDITOR (object);
-
-  /* release the tooltips */
-  g_object_unref (G_OBJECT (uca_editor->tooltips));
-
-  (*G_OBJECT_CLASS (thunar_uca_editor_parent_class)->finalize) (object);
-}
-
-
-
-static void
 thunar_uca_editor_command_clicked (ThunarUcaEditor *uca_editor)
 {
   GtkFileFilter *filter;
diff --git a/thunar/thunar-list-model.c b/thunar/thunar-list-model.c
index c6e4f80..1c10f91 100644
--- a/thunar/thunar-list-model.c
+++ b/thunar/thunar-list-model.c
@@ -124,12 +124,12 @@ static void               thunar_list_model_set_sort_column_id    (GtkTreeSortab
 static void               thunar_list_model_set_default_sort_func (GtkTreeSortable        *sortable,
                                                                    GtkTreeIterCompareFunc  func,
                                                                    gpointer                data,
-                                                                   GtkDestroyNotify        destroy);
+                                                                   GDestroyNotify          destroy);
 static void               thunar_list_model_set_sort_func         (GtkTreeSortable        *sortable,
                                                                    gint                    sort_column_id,
                                                                    GtkTreeIterCompareFunc  func,
                                                                    gpointer                data,
-                                                                   GtkDestroyNotify        destroy);
+                                                                   GDestroyNotify          destroy);
 static gboolean           thunar_list_model_has_default_sort_func (GtkTreeSortable        *sortable);
 static gint               thunar_list_model_cmp                   (ThunarListModel        *store,
                                                                    ThunarFile             *a,
@@ -972,7 +972,7 @@ static void
 thunar_list_model_set_default_sort_func (GtkTreeSortable       *sortable,
                                          GtkTreeIterCompareFunc func,
                                          gpointer               data,
-                                         GtkDestroyNotify       destroy)
+                                         GDestroyNotify         destroy)
 {
   g_critical ("ThunarListModel has sorting facilities built-in!");
 }
@@ -984,7 +984,7 @@ thunar_list_model_set_sort_func (GtkTreeSortable       *sortable,
                                  gint                   sort_column_id,
                                  GtkTreeIterCompareFunc func,
                                  gpointer               data,
-                                 GtkDestroyNotify       destroy)
+                                 GDestroyNotify         destroy)
 {
   g_critical ("ThunarListModel has sorting facilities built-in!");
 }
diff --git a/thunar/thunar-properties-dialog.c b/thunar/thunar-properties-dialog.c
index fc13742..51da9bd 100644
--- a/thunar/thunar-properties-dialog.c
+++ b/thunar/thunar-properties-dialog.c
@@ -843,7 +843,7 @@ thunar_properties_dialog_update (ThunarPropertiesDialog *dialog)
   g_object_unref (G_OBJECT (dialog->icon_image));
 
   /* update the name (if it differs) */
-  gtk_entry_set_editable (GTK_ENTRY (dialog->name_entry), thunar_file_is_renameable (dialog->file));
+  gtk_editable_set_editable (GTK_EDITABLE (dialog->name_entry), thunar_file_is_renameable (dialog->file));
   name = thunar_file_get_display_name (dialog->file);
   if (G_LIKELY (strcmp (name, gtk_entry_get_text (GTK_ENTRY (dialog->name_entry))) != 0))
     {
@@ -861,7 +861,7 @@ thunar_properties_dialog_update (ThunarPropertiesDialog *dialog)
 
           /* select the region */
           if (G_LIKELY (offset > 0))
-            gtk_entry_select_region (GTK_ENTRY (dialog->name_entry), 0, offset);
+            gtk_editable_select_region (GTK_EDITABLE (dialog->name_entry), 0, offset);
         }
     }
 
diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c
index 40c41b8..a7da72a 100644
--- a/thunar/thunar-shortcuts-view.c
+++ b/thunar/thunar-shortcuts-view.c
@@ -962,7 +962,7 @@ thunar_shortcuts_view_rename_activated (GtkWidget           *item,
     {
       /* determine the text renderer */
       column = gtk_tree_view_get_column (GTK_TREE_VIEW (view), 0);
-      renderers = gtk_tree_view_column_get_cell_renderers (column);
+      renderers = gtk_cell_layout_get_cells  (GTK_CELL_LAYOUT (column));
       renderer = g_list_nth_data (renderers, 1);
 
       /* make sure the text renderer is editable */
diff --git a/thunar/thunar-text-renderer.c b/thunar/thunar-text-renderer.c
index e12476e..f40f424 100644
--- a/thunar/thunar-text-renderer.c
+++ b/thunar/thunar-text-renderer.c
@@ -740,7 +740,7 @@ thunar_text_renderer_grab_focus (GtkWidget          *entry,
 
       /* select the text prior to the dot */
       if (G_LIKELY (offset > 0))
-        gtk_entry_select_region (GTK_ENTRY (entry), 0, offset);
+        gtk_editable_select_region (GTK_EDITABLE (entry), 0, offset);
     }
 
   /* disconnect the grab-focus handler, so we change the selection only once */
diff --git a/thunarx/thunarx-property-page-provider.c b/thunarx/thunarx-property-page-provider.c
index 2a97dd4..b56b7e8 100644
--- a/thunarx/thunarx-property-page-provider.c
+++ b/thunarx/thunarx-property-page-provider.c
@@ -94,8 +94,7 @@ thunarx_property_page_provider_get_type (void)
  * The caller is responsible to free the returned list of pages using
  * something like this when no longer needed:
  * <informalexample><programlisting>
- * g_list_foreach (list, (GFunc) g_object_ref, NULL);
- * g_list_foreach (list, (GFunc) gtk_object_sink, NULL);
+ * g_list_foreach (list, (GFunc) g_object_ref_sink, NULL);
  * g_list_foreach (list, (GFunc) g_object_unref, NULL);
  * g_list_free (list);
  * </programlisting></informalexample>
diff --git a/thunarx/thunarx-property-page.c b/thunarx/thunarx-property-page.c
index f521a22..7d59299 100644
--- a/thunarx/thunarx-property-page.c
+++ b/thunarx/thunarx-property-page.c
@@ -382,10 +382,7 @@ thunarx_property_page_set_label_widget (ThunarxPropertyPage *property_page,
 
   /* connect to the new label widget */
   if (G_LIKELY (label_widget != NULL))
-    {
-      g_object_ref (G_OBJECT (label_widget));
-      gtk_object_sink (GTK_OBJECT (label_widget));
-    }
+    g_object_ref_sink (G_OBJECT (label_widget));
 
   /* notify listeners */
   g_object_freeze_notify (G_OBJECT (property_page));
diff --git a/thunarx/thunarx-renamer-provider.c b/thunarx/thunarx-renamer-provider.c
index ebcf2e5..78c1019 100644
--- a/thunarx/thunarx-renamer-provider.c
+++ b/thunarx/thunarx-renamer-provider.c
@@ -99,10 +99,7 @@ thunarx_renamer_provider_get_renamers (ThunarxRenamerProvider *provider)
 
   /* ref&sink all returned renamers */
   for (lp = renamers; lp != NULL; lp = lp->next)
-    {
-      g_object_ref (G_OBJECT (lp->data));
-      gtk_object_sink (GTK_OBJECT (lp->data));
-    }
+    g_object_ref_sink (G_OBJECT (lp->data));
 
   /* take a reference for all renamers on the provider */
   thunarx_object_list_take_reference (renamers, provider);



More information about the Xfce4-commits mailing list