[sound-juicer/subpop/missing-build-dependency: 2/4] Fixed deprecated method calls that are causing compiler warnings



commit 00e3e9c11262d5f302eccdcc87d9113209ee2337
Author: David Meikle <david meikle io>
Date:   Fri May 10 18:43:10 2019 +0100

    Fixed deprecated method calls that are causing compiler warnings

 libjuicer/sj-extractor.c             | 4 +---
 libjuicer/sj-metadata-getter.c       | 5 +----
 libjuicer/sj-metadata-gvfs.c         | 3 +--
 libjuicer/sj-metadata-musicbrainz5.c | 3 +--
 src/egg-play-preview.c               | 4 +---
 src/sj-extracting.c                  | 6 +++---
 src/sj-main.c                        | 8 ++++----
 src/sj-play.c                        | 2 +-
 src/sj-prefs.c                       | 2 +-
 9 files changed, 14 insertions(+), 23 deletions(-)
---
diff --git a/libjuicer/sj-extractor.c b/libjuicer/sj-extractor.c
index 63d023d7..526095e8 100644
--- a/libjuicer/sj-extractor.c
+++ b/libjuicer/sj-extractor.c
@@ -78,7 +78,7 @@ struct SjExtractorPrivate {
  * GObject methods
  */
 
-G_DEFINE_TYPE (SjExtractor, sj_extractor, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (SjExtractor, sj_extractor, G_TYPE_OBJECT);
 
 #define EXTRACTOR_PRIVATE(o)                                            \
   (G_TYPE_INSTANCE_GET_PRIVATE ((o), SJ_TYPE_EXTRACTOR, SjExtractorPrivate))
@@ -177,8 +177,6 @@ sj_extractor_class_init (SjExtractorClass *klass)
   GObjectClass *object_class;
   object_class = (GObjectClass *)klass;
 
-  g_type_class_add_private (klass, sizeof (SjExtractorPrivate));
-
   /* GObject */
   object_class->set_property = sj_extractor_set_property;
   object_class->get_property = sj_extractor_get_property;
diff --git a/libjuicer/sj-metadata-getter.c b/libjuicer/sj-metadata-getter.c
index 251f1306..61dac38f 100644
--- a/libjuicer/sj-metadata-getter.c
+++ b/libjuicer/sj-metadata-getter.c
@@ -50,7 +50,7 @@ typedef struct SjMetadataGetterPrivate SjMetadataGetterPrivate;
 
 static void sj_metadata_getter_finalize (GObject *object);
 
-G_DEFINE_TYPE(SjMetadataGetter, sj_metadata_getter, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE(SjMetadataGetter, sj_metadata_getter, G_TYPE_OBJECT);
 
 #define GETTER_PRIVATE(o)                                            \
   (G_TYPE_INSTANCE_GET_PRIVATE ((o), SJ_TYPE_METADATA_GETTER, SjMetadataGetterPrivate))
@@ -60,9 +60,6 @@ sj_metadata_getter_class_init (SjMetadataGetterClass *klass)
 {
   GObjectClass *object_class;
   object_class = (GObjectClass *)klass;
-
-  g_type_class_add_private (klass, sizeof (SjMetadataGetterPrivate));
-
   object_class->finalize = sj_metadata_getter_finalize;
 }
 
diff --git a/libjuicer/sj-metadata-gvfs.c b/libjuicer/sj-metadata-gvfs.c
index 787ece75..2263cdd0 100644
--- a/libjuicer/sj-metadata-gvfs.c
+++ b/libjuicer/sj-metadata-gvfs.c
@@ -57,6 +57,7 @@ static void metadata_iface_init (gpointer g_iface, gpointer iface_data);
 
 G_DEFINE_TYPE_WITH_CODE (SjMetadataGvfs, sj_metadata_gvfs,
                          G_TYPE_OBJECT,
+                         G_ADD_PRIVATE(SjMetadataGvfs)
                          G_IMPLEMENT_INTERFACE (SJ_TYPE_METADATA, metadata_iface_init));
 
 
@@ -271,8 +272,6 @@ sj_metadata_gvfs_class_init (SjMetadataGvfsClass *class)
 {
   GObjectClass *object_class = (GObjectClass*) class;
 
-  g_type_class_add_private (class, sizeof (SjMetadataGvfsPrivate));
-
   object_class->get_property = sj_metadata_gvfs_get_property;
   object_class->set_property = sj_metadata_gvfs_set_property;
   object_class->finalize = sj_metadata_gvfs_finalize;
diff --git a/libjuicer/sj-metadata-musicbrainz5.c b/libjuicer/sj-metadata-musicbrainz5.c
index b8bc68fa..8846ab53 100644
--- a/libjuicer/sj-metadata-musicbrainz5.c
+++ b/libjuicer/sj-metadata-musicbrainz5.c
@@ -97,6 +97,7 @@ static void metadata_interface_init (gpointer g_iface, gpointer iface_data);
 G_DEFINE_TYPE_WITH_CODE (SjMetadataMusicbrainz5,
                          sj_metadata_musicbrainz5,
                          G_TYPE_OBJECT,
+                         G_ADD_PRIVATE (SjMetadataMusicbrainz5)
                          G_IMPLEMENT_INTERFACE (SJ_TYPE_METADATA,
                                                 metadata_interface_init));
 
@@ -1369,8 +1370,6 @@ sj_metadata_musicbrainz5_class_init (SjMetadataMusicbrainz5Class *class)
   const gchar * const * l;
   GObjectClass *object_class = (GObjectClass*)class;
 
-  g_type_class_add_private (class, sizeof (SjMetadataMusicbrainz5Private));
-
   object_class->get_property = sj_metadata_musicbrainz5_get_property;
   object_class->set_property = sj_metadata_musicbrainz5_set_property;
   object_class->finalize = sj_metadata_musicbrainz5_finalize;
diff --git a/src/egg-play-preview.c b/src/egg-play-preview.c
index 0cecffb8..aacb49e0 100644
--- a/src/egg-play-preview.c
+++ b/src/egg-play-preview.c
@@ -128,15 +128,13 @@ static void _stop                            (EggPlayPreview *play_preview);
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE (EggPlayPreview, egg_play_preview, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (EggPlayPreview, egg_play_preview, GTK_TYPE_BOX)
 
 static void
 egg_play_preview_class_init (EggPlayPreviewClass *klass)
 {
        GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (klass, sizeof (EggPlayPreviewPrivate));
-
        gobject_class->finalize = egg_play_preview_finalize;
        gobject_class->dispose = egg_play_preview_dispose;
        gobject_class->set_property = egg_play_preview_set_property;
diff --git a/src/sj-extracting.c b/src/sj-extracting.c
index 431ab29c..9a3b9093 100644
--- a/src/sj-extracting.c
+++ b/src/sj-extracting.c
@@ -459,7 +459,7 @@ pop_and_extract (int *overwrite_mode)
 
     /* Update the progress bars */
     gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar),
-                                   CLAMP ((float)current_duration / (float)total_duration, 0.0, 1.0));
+                                   CLAMP (current_duration / total_duration, 0.0, 1.0));
 
     /* Set the Treelist focus to the item to be extracted */
     path = gtk_tree_model_get_path(GTK_TREE_MODEL (track_store), &current);
@@ -513,7 +513,7 @@ update_speed_progress (SjExtractor *extractor, float speed, int eta)
   char *eta_str;
 
   if (eta >= 0) {
-    eta_str = g_strdup_printf (_("Estimated time left: %d:%02d (at %0.1f\303\227)"), eta / 60, eta % 60, 
speed);
+    eta_str = g_strdup_printf (_("Estimated time left: %d:%02d (at %0.1f\303\227)"), eta / 60, eta % 60, 
(double) speed);
   } else {
     eta_str = g_strdup (_("Estimated time left: unknown"));
   }
@@ -625,7 +625,7 @@ finished_actions (void)
     /* Find the deepest common directory. */
     g_list_foreach (paths, (GFunc)base_finder, &base);
 
-    gtk_show_uri (NULL, base, GDK_CURRENT_TIME, NULL);
+    gtk_show_uri_on_window (NULL, base, GDK_CURRENT_TIME, NULL);
 
     g_free (base);
   }
diff --git a/src/sj-main.c b/src/sj-main.c
index b27d731a..4293d599 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -404,7 +404,7 @@ static void on_submit_activate (GSimpleAction *action, GVariant *parameter, gpoi
   GError *error = NULL;
 
   if (current_submit_url) {
-      if (!gtk_show_uri (NULL, current_submit_url, GDK_CURRENT_TIME, &error)) {
+      if (!gtk_show_uri_on_window (NULL, current_submit_url, GDK_CURRENT_TIME, &error)) {
       GtkWidget *dialog;
 
       dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (main_window),
@@ -847,7 +847,7 @@ metadata_cb (GObject      *source,
   }
 
   /* Free old album details */
-  g_clear_pointer (&current_album, (GDestroyNotify) album_details_free);
+  g_clear_pointer (&current_album, album_details_free);
   /* Set the new current album pointer */
   if (albums != NULL) {
     if (albums->next != NULL) {
@@ -860,7 +860,7 @@ metadata_cb (GObject      *source,
     } else {
       current_album = albums->data;
       /* current_album now owns ->data, so just free the list */
-      g_clear_pointer (&albums, (GDestroyNotify) g_list_free);
+      g_clear_pointer (&albums, g_list_free);
     }
   }
   update_ui_for_album (current_album);
@@ -1637,7 +1637,7 @@ G_MODULE_EXPORT void on_disc_number_edit_changed(GtkEditable *widget, gpointer u
 static void on_contents_activate(GSimpleAction *action, GVariant *parameter, gpointer data) {
   GError *error = NULL;
 
-  gtk_show_uri (NULL, "help:sound-juicer", GDK_CURRENT_TIME, &error);
+  gtk_show_uri_on_window (NULL, "help:sound-juicer", GDK_CURRENT_TIME, &error);
   if (error) {
     GtkWidget *dialog;
 
diff --git a/src/sj-play.c b/src/sj-play.c
index 6b0255f9..121b2939 100644
--- a/src/sj-play.c
+++ b/src/sj-play.c
@@ -546,7 +546,7 @@ on_volume_changed (GtkWidget * volb, gdouble value, gpointer data)
 {
   vol = value;
   if (pipeline)
-    g_object_set (G_OBJECT (pipeline), "volume", vol, NULL);
+    g_object_set (G_OBJECT (pipeline), "volume", (double) vol, NULL);
   g_settings_set_double (sj_settings, SJ_SETTINGS_AUDIO_VOLUME, vol);
 }
 
diff --git a/src/sj-prefs.c b/src/sj-prefs.c
index 3441e7dd..50ae57be 100644
--- a/src/sj-prefs.c
+++ b/src/sj-prefs.c
@@ -106,7 +106,7 @@ void show_help (GtkWindow *parent)
 {
   GError *error = NULL;
 
-  gtk_show_uri (NULL, "help:sound-juicer/preferences", GDK_CURRENT_TIME, &error);
+  gtk_show_uri_on_window (NULL, "help:sound-juicer/preferences", GDK_CURRENT_TIME, &error);
   if (error) {
     GtkWidget *dialog;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]