[Xfce4-commits] [apps/xfburn] 13/42: clean up more deprecation warnings

noreply at xfce.org noreply at xfce.org
Tue Oct 15 02:21:56 CEST 2019


This is an automated email from the git hooks/post-receive script.

k   a   t   a   n   a   s   t   e   e   l       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfburn.

commit 574499ff7322deb762e8f2f45b1afd3d5500e6d1
Author: Rene Kjellerup <rk.katana.steel at gmail.com>
Date:   Fri Oct 26 19:21:38 2018 -0700

    clean up more deprecation warnings
    
    made reading audio header safer
    
    fixed busy cursor
---
 xfburn/xfburn-audio-composition.c                 |  6 ++++--
 xfburn/xfburn-burn-audio-cd-composition-dialog.c  |  2 +-
 xfburn/xfburn-burn-data-composition-base-dialog.c |  2 +-
 xfburn/xfburn-copy-cd-dialog.c                    |  2 +-
 xfburn/xfburn-copy-dvd-dialog.c                   |  2 +-
 xfburn/xfburn-data-composition.c                  |  5 +++--
 xfburn/xfburn-device-box.c                        |  2 +-
 xfburn/xfburn-directory-browser.c                 |  2 +-
 xfburn/xfburn-fs-browser.c                        |  2 +-
 xfburn/xfburn-main-window.c                       |  6 +++++-
 xfburn/xfburn-preferences-dialog.c                | 21 +++++++++++++++++----
 xfburn/xfburn-transcoder-basic.c                  | 20 ++++++++++++++++----
 xfburn/xfburn-utils.c                             |  6 +++---
 13 files changed, 55 insertions(+), 23 deletions(-)

diff --git a/xfburn/xfburn-audio-composition.c b/xfburn/xfburn-audio-composition.c
index f51a978..f43a4ec 100644
--- a/xfburn/xfburn-audio-composition.c
+++ b/xfburn/xfburn-audio-composition.c
@@ -373,9 +373,11 @@ xfburn_audio_composition_init (XfburnAudioComposition * composition)
   //exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "import-session", EXO_TOOLBARS_ITEM_TYPE);
 
   priv->toolbar = exo_toolbars_view_new_with_model (priv->ui_manager, model_toolbar);
+*/
+  priv->toolbar = gtk_label_new ("placeholder for Gtk3Toolbar");
   gtk_box_pack_start (GTK_BOX (hbox_toolbar), priv->toolbar, TRUE, TRUE, 0);
   gtk_widget_show (priv->toolbar);
-*/
+
     
   /* content treeview */
   scrolled_window = gtk_scrolled_window_new (NULL, NULL);
@@ -395,7 +397,7 @@ xfburn_audio_composition_init (XfburnAudioComposition * composition)
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), AUDIO_COMPOSITION_COLUMN_CONTENT, GTK_SORT_ASCENDING);
   */
   gtk_tree_view_set_model (GTK_TREE_VIEW (priv->content), GTK_TREE_MODEL (model));
-  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->content), TRUE);
+  // gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->content), TRUE);
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
   gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
   gtk_widget_show (priv->content);
diff --git a/xfburn/xfburn-burn-audio-cd-composition-dialog.c b/xfburn/xfburn-burn-audio-cd-composition-dialog.c
index 5baf823..202d1d8 100644
--- a/xfburn/xfburn-burn-audio-cd-composition-dialog.c
+++ b/xfburn/xfburn-burn-audio-cd-composition-dialog.c
@@ -166,7 +166,7 @@ xfburn_burn_audio_cd_composition_dialog_constructor (GType type, guint n_constru
   comp_name = iso_image_get_volume_id (priv->image);
   if (strcmp (comp_name, _(DATA_COMPOSITION_DEFAULT_NAME)) == 0) {
     GtkWidget *label;
-    vbox = gtk_vbox_new (FALSE, 0);
+    vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
     gtk_widget_show (vbox);
 
     frame = xfce_gtk_frame_box_new_with_content (_("Composition name"), vbox);
diff --git a/xfburn/xfburn-burn-data-composition-base-dialog.c b/xfburn/xfburn-burn-data-composition-base-dialog.c
index 06f03f1..f9b6716 100644
--- a/xfburn/xfburn-burn-data-composition-base-dialog.c
+++ b/xfburn/xfburn-burn-data-composition-base-dialog.c
@@ -369,7 +369,7 @@ create_proceed_button (XfburnBurnDataCompositionBaseDialog * dialog, const gchar
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
 
   priv->image_proceed = image = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
-  hbox = gtk_hbox_new (FALSE, 2);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
 
   align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
 
diff --git a/xfburn/xfburn-copy-cd-dialog.c b/xfburn/xfburn-copy-cd-dialog.c
index 5156653..a0d2957 100644
--- a/xfburn/xfburn-copy-cd-dialog.c
+++ b/xfburn/xfburn-copy-cd-dialog.c
@@ -188,7 +188,7 @@ xfburn_copy_cd_dialog_init (XfburnCopyCdDialog * obj)
   g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_browse_iso), obj);
 
   /* action buttons */
-  button = gtk_button_new_from_stock ("_Cancel");
+  button = gtk_button_new_with_mnemonic (_("_Cancel"));
   gtk_widget_show (button);
   gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
 
diff --git a/xfburn/xfburn-copy-dvd-dialog.c b/xfburn/xfburn-copy-dvd-dialog.c
index 232c2b5..21f5713 100644
--- a/xfburn/xfburn-copy-dvd-dialog.c
+++ b/xfburn/xfburn-copy-dvd-dialog.c
@@ -188,7 +188,7 @@ xfburn_copy_dvd_dialog_init (XfburnCopyDvdDialog * obj)
   g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_browse_iso), obj);
 
   /* action buttons */
-  button = gtk_button_new_from_stock ("_Cancel");
+  button = gtk_button_new_with_mnemonic (_("_Cancel"));
   gtk_widget_show (button);
   gtk_dialog_add_action_widget (GTK_DIALOG (obj), button, GTK_RESPONSE_CANCEL);
 
diff --git a/xfburn/xfburn-data-composition.c b/xfburn/xfburn-data-composition.c
index 3421185..55ebf15 100644
--- a/xfburn/xfburn-data-composition.c
+++ b/xfburn/xfburn-data-composition.c
@@ -345,9 +345,10 @@ xfburn_data_composition_init (XfburnDataComposition * composition)
   //exo_toolbars_model_add_item (model_toolbar, toolbar_position, -1, "import-session", EXO_TOOLBARS_ITEM_TYPE);
 
   priv->toolbar = exo_toolbars_view_new_with_model (priv->ui_manager, model_toolbar);
+*/
+  priv->toolbar = gtk_label_new ("placeholder for Gtk3Toolbar");
   gtk_box_pack_start (GTK_BOX (hbox_toolbar), priv->toolbar, TRUE, TRUE, 0);
   gtk_widget_show (priv->toolbar);
-*/
     
   /* volume name */
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
@@ -382,7 +383,7 @@ xfburn_data_composition_init (XfburnDataComposition * composition)
                                    directory_tree_sortfunc, NULL, NULL);
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), DATA_COMPOSITION_COLUMN_CONTENT, GTK_SORT_ASCENDING);
   gtk_tree_view_set_model (GTK_TREE_VIEW (priv->content), GTK_TREE_MODEL (model));
-  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->content), TRUE);
+  // gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->content), TRUE);
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->content));
   gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
   gtk_widget_show (priv->content);
diff --git a/xfburn/xfburn-device-box.c b/xfburn/xfburn-device-box.c
index c1c5beb..38c9382 100644
--- a/xfburn/xfburn-device-box.c
+++ b/xfburn/xfburn-device-box.c
@@ -216,7 +216,7 @@ xfburn_device_box_constructor (GType type, guint n_construct_properties, GObject
   gtk_box_pack_start (GTK_BOX (box), priv->combo_device, FALSE, FALSE, BORDER);
   
   /*
-  hbox = gtk_hbox_new (FALSE, 0);
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
   gtk_widget_show (hbox);
   gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, BORDER);
   */
diff --git a/xfburn/xfburn-directory-browser.c b/xfburn/xfburn-directory-browser.c
index 5870c93..9eff62a 100644
--- a/xfburn/xfburn-directory-browser.c
+++ b/xfburn/xfburn-directory-browser.c
@@ -121,7 +121,7 @@ xfburn_directory_browser_init (XfburnDirectoryBrowser * browser)
                                    directory_tree_sortfunc, NULL, NULL);
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), DIRECTORY_BROWSER_COLUMN_FILE, GTK_SORT_ASCENDING);
   gtk_tree_view_set_model (GTK_TREE_VIEW (browser), GTK_TREE_MODEL (model));
-  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (browser), TRUE);
+  // gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (browser), TRUE);
 
   column_file = gtk_tree_view_column_new ();
   gtk_tree_view_column_set_title (column_file, _("File"));
diff --git a/xfburn/xfburn-fs-browser.c b/xfburn/xfburn-fs-browser.c
index fdcd97d..0ef4a6f 100644
--- a/xfburn/xfburn-fs-browser.c
+++ b/xfburn/xfburn-fs-browser.c
@@ -90,7 +90,7 @@ xfburn_fs_browser_init (XfburnFsBrowser * browser)
   model = gtk_tree_store_new (FS_BROWSER_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model), FS_BROWSER_COLUMN_DIRECTORY, GTK_SORT_ASCENDING);
   gtk_tree_view_set_model (GTK_TREE_VIEW (browser), GTK_TREE_MODEL (model));
-  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (browser), TRUE);
+  // gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (browser), TRUE);
 
   column_directory = gtk_tree_view_column_new ();
   gtk_tree_view_column_set_title (column_directory, _("Filesystem"));
diff --git a/xfburn/xfburn-main-window.c b/xfburn/xfburn-main-window.c
index 03789ac..a03f156 100644
--- a/xfburn/xfburn-main-window.c
+++ b/xfburn/xfburn-main-window.c
@@ -298,8 +298,12 @@ xfburn_main_window_init (XfburnMainWindow * mainwin)
     g_warning ("Unable to locate xfburn/xfburn-toolbars.ui !");
   }
 */
+  priv->toolbars = gtk_label_new ("placeholder for Gtk3Toolbar");
+  gtk_box_pack_start (GTK_BOX (vbox), priv->toolbars, FALSE, FALSE, 0);
+  gtk_widget_show (priv->toolbars);
+
   /* vpaned */
-  priv->vpaned = gtk_vpaned_new ();
+  priv->vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
   gtk_box_pack_start (GTK_BOX (vbox), priv->vpaned, TRUE, TRUE, 0);
   gtk_widget_show (priv->vpaned);
 
diff --git a/xfburn/xfburn-preferences-dialog.c b/xfburn/xfburn-preferences-dialog.c
index 2ebd567..4c7dd3d 100644
--- a/xfburn/xfburn-preferences-dialog.c
+++ b/xfburn/xfburn-preferences-dialog.c
@@ -161,8 +161,8 @@ xfburn_preferences_dialog_init (XfburnPreferencesDialog * obj)
   gtk_widget_show (scrolled_window);
 
   /* icon bar */
-/*
   icon_store = gtk_list_store_new (SETTINGS_LIST_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
+/*
   priv->icon_bar = exo_icon_bar_new_with_model (GTK_TREE_MODEL (icon_store));
   exo_icon_bar_set_pixbuf_column (EXO_ICON_BAR (priv->icon_bar), SETTINGS_LIST_PIXBUF_COLUMN);
   exo_icon_bar_set_text_column (EXO_ICON_BAR (priv->icon_bar), SETTINGS_LIST_TEXT_COLUMN);
@@ -258,7 +258,7 @@ xfburn_preferences_dialog_init (XfburnPreferencesDialog * obj)
                               G_TYPE_BOOLEAN);
   priv->treeview_devices = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), DEVICE_LIST_COLUMN_NAME, GTK_SORT_ASCENDING);
-  gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->treeview_devices), TRUE);
+  // gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (priv->treeview_devices), TRUE);
   gtk_widget_show (priv->treeview_devices);
   gtk_container_add (GTK_CONTAINER (scrolled_window), priv->treeview_devices);
   g_object_unref (store);
@@ -339,7 +339,7 @@ xfburn_preferences_dialog_init (XfburnPreferencesDialog * obj)
   gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, BORDER);
   gtk_widget_show (frame);
 
-  priv->scale_fifo = gtk_hscale_new_with_range (0.0, FIFO_MAX_SIZE, 32.0);
+  priv->scale_fifo = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0.0, FIFO_MAX_SIZE, 32.0);
   gtk_scale_set_value_pos (GTK_SCALE (priv->scale_fifo), GTK_POS_LEFT);
   gtk_range_set_value (GTK_RANGE (priv->scale_fifo), 0);
   gtk_box_pack_start (GTK_BOX (vbox3), priv->scale_fifo, FALSE, FALSE, BORDER/2);
@@ -347,8 +347,21 @@ xfburn_preferences_dialog_init (XfburnPreferencesDialog * obj)
 
   
   /* action buttons */
-  button_close = gtk_button_new_from_stock ("gtk-close");
+  button_close = gtk_button_new ();
+  hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL,0);
+  
+  label = gtk_image_new_from_icon_name ("gtk-close", GTK_ICON_SIZE_BUTTON);
+  gtk_widget_show (label);
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+
+  label = gtk_label_new("close");
+  gtk_widget_show (label);
+  gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+  gtk_widget_show (hbox);
+
+  gtk_container_add (GTK_CONTAINER(button_close), hbox);
   gtk_widget_show (button_close);
+  
   gtk_dialog_add_action_widget (GTK_DIALOG (obj), button_close, GTK_RESPONSE_CLOSE);
   gtk_widget_set_can_default (button_close, TRUE);
   gtk_widget_grab_focus (button_close);
diff --git a/xfburn/xfburn-transcoder-basic.c b/xfburn/xfburn-transcoder-basic.c
index 2cc8b58..b91f3e8 100644
--- a/xfburn/xfburn-transcoder-basic.c
+++ b/xfburn/xfburn-transcoder-basic.c
@@ -229,6 +229,7 @@ static gboolean
 is_valid_wav (const gchar *path)
 {
   int fd;
+  int hread;
   guchar header[44];
   gboolean ret;
 
@@ -239,9 +240,11 @@ is_valid_wav (const gchar *path)
     return FALSE;
   }
 
-  read (fd, header, 44);
-
-  ret = valid_wav_headers (header);
+  ret = FALSE;
+  hread = read (fd, header, 44);
+  if (hread == 44) {
+    ret = valid_wav_headers (header);
+  }
 
   close (fd);
 
@@ -311,6 +314,7 @@ create_burn_track (XfburnTranscoder *trans, XfburnAudioTrack *atrack, GError **e
   */
   
   char header[44];
+  int thead=0;
   struct burn_track *track;
 
   atrack->fd = open (atrack->inputfile, 0);
@@ -322,7 +326,15 @@ create_burn_track (XfburnTranscoder *trans, XfburnAudioTrack *atrack, GError **e
 
   /* advance the fd so that libburn skips the header,
    * also allows us to check for byte swapping */
-  read (atrack->fd, header, 44);
+  thead = read (atrack->fd, header, 44);
+  if( thead < 44 ) {
+    g_warning ("Could not read header from %s!", atrack->inputfile);
+    g_set_error (error, XFBURN_ERROR, XFBURN_ERROR_BURN_SOURCE,
+		 "%s",
+                 _(errormsg_libburn_setup));
+    return NULL;
+  }
+
 
   atrack->src = burn_fd_source_new (atrack->fd, -1 , 0);
   if (atrack->src == NULL) {
diff --git a/xfburn/xfburn-utils.c b/xfburn/xfburn-utils.c
index 591db25..e3e70e7 100644
--- a/xfburn/xfburn-utils.c
+++ b/xfburn/xfburn-utils.c
@@ -46,9 +46,9 @@ xfburn_busy_cursor (GtkWidget * widget)
   GdkCursor *cursor;
 
   g_return_if_fail (widget != NULL);
-  cursor = gdk_cursor_new (GDK_WATCH);
+  cursor = gdk_cursor_new_for_display( gtk_widget_get_display(widget), GDK_WATCH);
   gdk_window_set_cursor (gtk_widget_get_parent_window (widget), cursor);
-  gdk_cursor_unref (cursor);
+  g_object_unref (cursor);
   gdk_flush ();
 }
 
@@ -196,7 +196,7 @@ xfburn_gtk_button_new_mixed (const gchar *stock_id, const gchar *label)
         }
     } else {
         /* fall back to a stock button */
-        button = gtk_button_new_from_stock (stock_id);
+        button = gtk_button_new_with_label (stock_id);
     }
     return button;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list