commit 3d4412ad8c02d3f23706261d2710a35d3f90d62a Author: phantomjinx <p.g.richard...@phantomjinx.co.uk> Date: Tue Apr 17 20:45:32 2012 +0100
Fix deprecations in sjcd plugin * Deprecated code causing compile errors in rpm compilations plugins/sjcd/egg-play-preview.c | 8 ++++---- plugins/sjcd/egg-play-preview.h | 6 +++--- plugins/sjcd/sj-extracting.c | 14 ++++++++++---- plugins/sjcd/sj-main.c | 4 ++-- 4 files changed, 19 insertions(+), 13 deletions(-) --- diff --git a/plugins/sjcd/egg-play-preview.c b/plugins/sjcd/egg-play-preview.c index b8fb50a..5b08c85 100644 --- a/plugins/sjcd/egg-play-preview.c +++ b/plugins/sjcd/egg-play-preview.c @@ -122,7 +122,7 @@ static void _stop (EggPlayPreview *play_preview); static guint signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (EggPlayPreview, egg_play_preview, GTK_TYPE_VBOX) +G_DEFINE_TYPE (EggPlayPreview, egg_play_preview, GTK_TYPE_BOX) static void egg_play_preview_class_init (EggPlayPreviewClass *klass) @@ -255,7 +255,7 @@ egg_play_preview_init (EggPlayPreview *play_preview) gtk_box_set_spacing (GTK_BOX (play_preview), 6); /* track info */ - vbox = gtk_vbox_new (TRUE, 0); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); priv->title_label = gtk_label_new (NULL); gtk_label_set_justify (GTK_LABEL (priv->title_label), GTK_JUSTIFY_LEFT); @@ -274,7 +274,7 @@ egg_play_preview_init (EggPlayPreview *play_preview) gtk_misc_set_alignment (GTK_MISC (priv->artist_album_label), 0.0, 0.5); gtk_box_pack_start (GTK_BOX (vbox), priv->artist_album_label, TRUE, TRUE, 0); - hbox = gtk_hbox_new (FALSE, 12); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); /* play button */ priv->play_button = gtk_button_new (); @@ -284,7 +284,7 @@ egg_play_preview_init (EggPlayPreview *play_preview) gtk_container_add (GTK_CONTAINER (align), priv->play_button); /* time scale */ - priv->time_scale = gtk_hscale_new_with_range (0.0, 100.0, 1.0); + priv->time_scale = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0.0, 100.0, 1.0); gtk_scale_set_draw_value (GTK_SCALE (priv->time_scale), FALSE); gtk_widget_set_size_request (priv->time_scale, EGG_PLAYER_PREVIEW_WIDTH, -1); priv->time_label = gtk_label_new ("0:00"); diff --git a/plugins/sjcd/egg-play-preview.h b/plugins/sjcd/egg-play-preview.h index f62eb57..efb4753 100644 --- a/plugins/sjcd/egg-play-preview.h +++ b/plugins/sjcd/egg-play-preview.h @@ -2,7 +2,7 @@ /* * EggPlayPreview GTK+ Widget - egg-play-preview.h - * + * * Copyright (C) 2008 Luca Cavalli <luca.cava...@gmail.com> * * This program is free software; you can redistribute it and/or @@ -43,7 +43,7 @@ typedef struct _EggPlayPreviewClass EggPlayPreviewClass; typedef struct _EggPlayPreviewPrivate EggPlayPreviewPrivate; struct _EggPlayPreview { - GtkHBox parent; + GtkBox parent; gchar *file; @@ -52,7 +52,7 @@ struct _EggPlayPreview { }; struct _EggPlayPreviewClass { - GtkHBoxClass parent_class; + GtkBoxClass parent_class; /* signals */ void (* play) (EggPlayPreview *play_preview); diff --git a/plugins/sjcd/sj-extracting.c b/plugins/sjcd/sj-extracting.c index 792c032..be1d6fa 100644 --- a/plugins/sjcd/sj-extracting.c +++ b/plugins/sjcd/sj-extracting.c @@ -272,7 +272,7 @@ cleanup (void) * Check if a file exists, can be written to, etc. * Return true on continue, false on skip. */ -static goffset +static guint64 check_file_size (GFile *uri) { GFileInfo *gfile_info; @@ -303,7 +303,7 @@ check_file_size (GFile *uri) } static gboolean -confirm_overwrite_existing_file (GFile *uri, int *overwrite_mode, goffset info_size) +confirm_overwrite_existing_file (GFile *uri, int *overwrite_mode, guint64 info_size) { OverwriteDialogResponse ret; GtkWidget *dialog; @@ -311,7 +311,13 @@ confirm_overwrite_existing_file (GFile *uri, int *overwrite_mode, goffset info_s char *display_name, *filename, *size; display_name = g_file_get_parse_name (uri); - size = g_format_size_for_display (info_size); + +#if GLIB_CHECK_VERSION(2,30,0) + size = g_format_size (info_size); +#else + size = g_format_size_for_display(info_size); +#endif + dialog = gtk_message_dialog_new (GTK_WINDOW (gtkpod_app), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, @@ -437,7 +443,7 @@ pop_and_extract (int *overwrite_mode) /* Save the file name for later */ files = g_list_append(files, g_file_get_path(file)); - goffset file_size; + guint64 file_size; file_size = check_file_size (file); /* Skip if destination file can't be accessed (unexpected error). */ diff --git a/plugins/sjcd/sj-main.c b/plugins/sjcd/sj-main.c index 5ac4330..7458331 100644 --- a/plugins/sjcd/sj-main.c +++ b/plugins/sjcd/sj-main.c @@ -237,7 +237,7 @@ set_info_bar_text_and_icon (GtkInfoBar *infobar, ally_target = gtk_widget_get_accessible (button); - hbox_content = gtk_hbox_new (FALSE, 8); + hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_widget_show (hbox_content); image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG); @@ -245,7 +245,7 @@ set_info_bar_text_and_icon (GtkInfoBar *infobar, gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0); - vbox = gtk_vbox_new (FALSE, 6); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_widget_show (vbox); gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 _______________________________________________ gtkpod-cvs2 mailing list gtkpod-cvs2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2