]> Pileus Git - ~andy/gtk/commitdiff
gtk-demo: Remove file lists from demo data
authorBenjamin Otte <otte@redhat.com>
Fri, 1 Feb 2013 17:56:10 +0000 (18:56 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 1 Feb 2013 20:57:40 +0000 (21:57 +0100)
We can get it from parsing resources now, so no need to manually add
them.

demos/gtk-demo/application.c
demos/gtk-demo/builder.c
demos/gtk-demo/css_accordion.c
demos/gtk-demo/css_basics.c
demos/gtk-demo/css_multiplebgs.c
demos/gtk-demo/main.c
demos/gtk-demo/theming_custom_css.c
demos/gtk-demo/theming_style_classes.c

index 412fc01164b58bb19d378aaf7eec59348e360ed5..31b1da09c602ceaa384bd31e84bfe46ac947b70f 100644 (file)
@@ -1,4 +1,4 @@
-/* Application class :: menus.ui application.ui
+/* Application class
  *
  * Demonstrates a simple application.
  *
index 7aeff37c5d979585b734015b53fa87acd9753b04..e7c31ccab00fd1c66bfcd17397c19583340bb7e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Builder :: demo.ui
+/* Builder
  *
  * Demonstrates an interface loaded from a XML description.
  */
index 73e4376668887275a87ab30429405302568ab5ec..df5e14b9a325acbcb7a63fd3d1ebee47d60cbd37 100644 (file)
@@ -1,4 +1,4 @@
-/* CSS Theming/CSS Accordion :: css_accordion.css
+/* CSS Theming/CSS Accordion
  *
  * A simple accordion demo written using CSS transitions and multiple backgrounds
  *
index ad030721af447980e67b687e21e69dfad5f97a60..04c4ee3b90a0cd2c53a5edc58d2d694f845b5574 100644 (file)
@@ -1,4 +1,4 @@
-/* CSS Theming/CSS Basics :: css_basics.css
+/* CSS Theming/CSS Basics
  *
  * Gtk themes are written using CSS. Every widget is build of multiple items
  * that you can style very similarly to a regular website.
index 580decba4c52ee0e74aae7915a0df94808d14daa..bb12a236c35b78bb8a57b308b5eed6af03a83f2c 100644 (file)
@@ -1,4 +1,4 @@
-/* CSS Theming/Multiple Backgrounds :: css_multiplebgs.css
+/* CSS Theming/Multiple Backgrounds
  *
  * Gtk themes are written using CSS. Every widget is build of multiple items
  * that you can style very similarly to a regular website.
index ff5489150d9203f0535b7c17834e3db3ce882270..fe0260b6060460c106f66728265018886cd7a2fe 100644 (file)
@@ -481,21 +481,19 @@ load_file (const gchar *demoname,
   GError *err = NULL;
   int state = 0;
   gboolean in_para = 0;
-  gchar **names, **lines;
+  gchar **lines;
   GBytes *bytes;
   gint i;
 
-  remove_data_tabs ();
+  if (!g_strcmp0 (current_file, filename))
+    return;
 
-  names = g_strsplit (filename, " ", -1);
+  remove_data_tabs ();
 
   add_data_tab (demoname);
 
-  if (current_file && !strcmp (current_file, names[0]))
-    goto out;
-
   g_free (current_file);
-  current_file = g_strdup (names[0]);
+  current_file = g_strdup (filename);
 
   gtk_text_buffer_get_bounds (info_buffer, &start, &end);
   gtk_text_buffer_delete (info_buffer, &start, &end);
@@ -503,15 +501,15 @@ load_file (const gchar *demoname,
   gtk_text_buffer_get_bounds (source_buffer, &start, &end);
   gtk_text_buffer_delete (source_buffer, &start, &end);
 
-  resource_filename = g_strconcat ("/sources/", names[0], NULL);
+  resource_filename = g_strconcat ("/sources/", filename, NULL);
   bytes = g_resources_lookup_data (resource_filename, 0, &err);
   g_free (resource_filename);
 
   if (bytes == NULL)
     {
-      g_warning ("Cannot open source for %s: %s\n", names[0], err->message);
+      g_warning ("Cannot open source for %s: %s\n", filename, err->message);
       g_error_free (err);
-      goto out;
+      return;
     }
 
   lines = g_strsplit (g_bytes_get_data (bytes, NULL), "\n", -1);
@@ -634,9 +632,6 @@ load_file (const gchar *demoname,
   fontify ();
 
   g_strfreev (lines);
-
-out:
-  g_strfreev (names);
 }
 
 void
index fb557eb12bc56e1ec11e48946f259383b5c8511a..8a8e25ed5815c25c916cc2c0404ada3877321098 100644 (file)
@@ -1,4 +1,4 @@
-/* CSS Theming/Custom CSS :: fancy.css
+/* CSS Theming/Custom CSS
  *
  * GTK+ uses CSS for theming. If required, applications can
  * install their own custom CSS style provider to achieve
index 0dc2dda00a76299663d9f4600aaaa1d3812c0b92..fa9cded39a32d9c2996b700348559541facc4de3 100644 (file)
@@ -1,4 +1,4 @@
-/* CSS Theming/Style Classes :: theming.ui
+/* CSS Theming/Style Classes
  *
  * GTK+ uses CSS for theming. Style classes can be associated
  * with widgets to inform the theme about intended rendering.