diff options
author | Benjamin Otte <otte@redhat.com> | 2015-07-16 06:25:46 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-07-16 06:37:32 +0200 |
commit | 974c60a0d50523fa8e09d13e2d6d9ba535b2ace8 (patch) | |
tree | 3e18274791feb5de831d05b26fd49c28747cc21d | |
parent | 3d2ead0fce07d571b56d0118a3419d658457afde (diff) | |
download | gtk+-974c60a0d50523fa8e09d13e2d6d9ba535b2ace8.tar.gz |
tests: Fix gcc complaints about testfilechooser
-rw-r--r-- | tests/testfilechooser.c | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c index 72c0c5b337..7aeb6e3649 100644 --- a/tests/testfilechooser.c +++ b/tests/testfilechooser.c @@ -35,8 +35,10 @@ # endif #endif +#if 0 static GtkWidget *preview_label; static GtkWidget *preview_image; +#endif static GtkFileChooserAction action; static void @@ -117,39 +119,6 @@ filter_changed (GtkFileChooserDialog *dialog, g_print ("file filter changed\n"); } -static char * -format_time (time_t t) -{ - gchar buf[128]; - struct tm tm_buf; - time_t now = time (NULL); - const char *format; - - if (abs (now - t) < 24*60*60) - format = "%X"; - else - format = "%x"; - - localtime_r (&t, &tm_buf); - if (strftime (buf, sizeof (buf), format, &tm_buf) == 0) - return g_strdup ("<unknown>"); - else - return g_strdup (buf); -} - -static char * -format_size (gint64 size) -{ - if (size < (gint64)1024) - return g_strdup_printf ("%d bytes", (gint)size); - else if (size < (gint64)1024*1024) - return g_strdup_printf ("%.1f K", size / (1024.)); - else if (size < (gint64)1024*1024*1024) - return g_strdup_printf ("%.1f M", size / (1024.*1024.)); - else - return g_strdup_printf ("%.1f G", size / (1024.*1024.*1024.)); -} - #include <stdio.h> #include <errno.h> #define _(s) (s) @@ -272,6 +241,40 @@ my_new_from_file_at_size (const char *filename, return pixbuf; } +#if 0 +static char * +format_time (time_t t) +{ + gchar buf[128]; + struct tm tm_buf; + time_t now = time (NULL); + const char *format; + + if (abs (now - t) < 24*60*60) + format = "%X"; + else + format = "%x"; + + localtime_r (&t, &tm_buf); + if (strftime (buf, sizeof (buf), format, &tm_buf) == 0) + return g_strdup ("<unknown>"); + else + return g_strdup (buf); +} + +static char * +format_size (gint64 size) +{ + if (size < (gint64)1024) + return g_strdup_printf ("%d bytes", (gint)size); + else if (size < (gint64)1024*1024) + return g_strdup_printf ("%.1f K", size / (1024.)); + else if (size < (gint64)1024*1024*1024) + return g_strdup_printf ("%.1f M", size / (1024.*1024.)); + else + return g_strdup_printf ("%.1f G", size / (1024.*1024.*1024.)); +} + static void update_preview_cb (GtkFileChooser *chooser) { @@ -327,6 +330,7 @@ update_preview_cb (GtkFileChooser *chooser) gtk_file_chooser_set_preview_widget_active (chooser, have_preview); } +#endif static void set_current_folder (GtkFileChooser *chooser, @@ -520,7 +524,6 @@ main (int argc, char **argv) GtkWidget *dialog; GtkWidget *extra; GtkFileFilter *filter; - GtkWidget *preview_vbox; gboolean force_rtl = FALSE; gboolean multiple = FALSE; gboolean local_only = FALSE; |