[gtk+] tests: Fix gcc complaints about testfilechooser
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tests: Fix gcc complaints about testfilechooser
- Date: Thu, 16 Jul 2015 04:40:44 +0000 (UTC)
commit 974c60a0d50523fa8e09d13e2d6d9ba535b2ace8
Author: Benjamin Otte <otte redhat com>
Date: Thu Jul 16 06:25:46 2015 +0200
tests: Fix gcc complaints about testfilechooser
tests/testfilechooser.c | 71 ++++++++++++++++++++++++----------------------
1 files changed, 37 insertions(+), 34 deletions(-)
---
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c
index 72c0c5b..7aeb6e3 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]