gtk-demo: Remove file lists from demo data

We can get it from parsing resources now, so no need to manually add
them.
This commit is contained in:
Benjamin Otte
2013-02-01 18:56:10 +01:00
parent 4e41577b46
commit 80fc684dd8
8 changed files with 15 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* Application class :: menus.ui application.ui
/* Application class
*
* Demonstrates a simple application.
*

View File

@ -1,4 +1,4 @@
/* Builder :: demo.ui
/* Builder
*
* Demonstrates an interface loaded from a XML description.
*/

View 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
*

View 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.

View 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.

View 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

View 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

View 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.