brasero r744 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r744 - in trunk: . src
- Date: Mon, 21 Apr 2008 14:48:55 +0100 (BST)
Author: philippr
Date: Mon Apr 21 13:48:55 2008
New Revision: 744
URL: http://svn.gnome.org/viewvc/brasero?rev=744&view=rev
Log:
Fixed some warnings and icon retrieving in search pane and audio project
Also added possibility to retrieve GIcon through brasero-io (but still unused)
* src/brasero-audio-disc.c
(brasero_audio_disc_set_row_from_metadata):
* src/brasero-io.c (brasero_io_get_file_info_thread),
(brasero_io_load_directory_thread):
* src/brasero-io.h:
* src/brasero-mime-filter.c (brasero_mime_filter_add_mime):
Modified:
trunk/ChangeLog
trunk/src/brasero-audio-disc.c
trunk/src/brasero-io.c
trunk/src/brasero-io.h
trunk/src/brasero-mime-filter.c
Modified: trunk/src/brasero-audio-disc.c
==============================================================================
--- trunk/src/brasero-audio-disc.c (original)
+++ trunk/src/brasero-audio-disc.c Mon Apr 21 13:48:55 2008
@@ -1153,7 +1153,7 @@
GtkTreeIter *iter,
GFileInfo *info)
{
- const gchar * const *icon_string = NULL;
+ const gchar *icon_string = NULL;
gint64 current_length;
GtkTreeIter gap_iter;
gchar *size_string;
@@ -1162,9 +1162,26 @@
GIcon *icon;
gint64 end;
+ /* NOTE: implemented in glib 2.15.6 (not for windows though) */
icon = g_content_type_get_icon (g_file_info_get_content_type (info));
- if (G_IS_THEMED_ICON (icon))
- icon_string = g_themed_icon_get_names (G_THEMED_ICON (icon));
+ if (G_IS_THEMED_ICON (icon)) {
+ const gchar * const *names = NULL;
+
+ names = g_themed_icon_get_names (G_THEMED_ICON (icon));
+ if (names) {
+ gint i;
+ GtkIconTheme *theme;
+
+ theme = gtk_icon_theme_get_default ();
+ for (i = 0; names [i]; i++) {
+ if (gtk_icon_theme_has_icon (theme, names [i])) {
+ icon_string = names [i];
+ break;
+ }
+ }
+ g_object_unref (theme);
+ }
+ }
gtk_tree_model_get (model, iter,
START_COL, &start,
@@ -1232,7 +1249,7 @@
size_string = brasero_utils_get_time_string (length, TRUE, FALSE);
gtk_list_store_set (GTK_LIST_STORE (model), iter,
SIZE_COL, size_string,
- ICON_COL, icon_string?icon_string [0]:NULL,
+ ICON_COL, icon_string,
LENGTH_COL, g_file_info_get_attribute_uint64 (info, BRASERO_IO_LEN),
ARTIST_COL, g_file_info_get_attribute_string (info, BRASERO_IO_ARTIST),
COMPOSER_COL, g_file_info_get_attribute_string (info, BRASERO_IO_COMPOSER),
Modified: trunk/src/brasero-io.c
==============================================================================
--- trunk/src/brasero-io.c (original)
+++ trunk/src/brasero-io.c Mon Apr 21 13:48:55 2008
@@ -721,6 +721,8 @@
strcat (attributes, "," G_FILE_ATTRIBUTE_ACCESS_CAN_READ);
if (job->options & BRASERO_IO_INFO_MIME)
strcat (attributes, "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
+ if (job->options & BRASERO_IO_INFO_ICON)
+ strcat (attributes, "," G_FILE_ATTRIBUTE_STANDARD_ICON);
file = g_file_new_for_uri (file_uri?file_uri:job->uri);
info = g_file_query_info (file,
@@ -1450,6 +1452,9 @@
&& (data->job.options & BRASERO_IO_INFO_RECURSIVE))
strcat (attributes, "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE);
+ if (data->job.options & BRASERO_IO_INFO_ICON)
+ strcat (attributes, "," G_FILE_ATTRIBUTE_STANDARD_ICON);
+
if (data->children) {
file = data->children->data;
data->children = g_slist_remove (data->children, file);
Modified: trunk/src/brasero-io.h
==============================================================================
--- trunk/src/brasero-io.h (original)
+++ trunk/src/brasero-io.h Mon Apr 21 13:48:55 2008
@@ -56,6 +56,7 @@
typedef enum {
BRASERO_IO_INFO_NONE = 0,
BRASERO_IO_INFO_MIME = 1,
+ BRASERO_IO_INFO_ICON = 1,
BRASERO_IO_INFO_PERM = 1 << 1,
BRASERO_IO_INFO_METADATA = 1 << 2,
BRASERO_IO_INFO_RECURSIVE = 1 << 3,
Modified: trunk/src/brasero-mime-filter.c
==============================================================================
--- trunk/src/brasero-mime-filter.c (original)
+++ trunk/src/brasero-mime-filter.c Mon Apr 21 13:48:55 2008
@@ -236,14 +236,30 @@
GtkTreeIter row;
GtkTreeModel *model;
const gchar *description;
- const gchar * const *icon_string = NULL;
+ const gchar *icon_string = NULL;
description = g_content_type_get_description (mime);
display = g_strdup_printf (_("%s only"), description);
icon = g_content_type_get_icon (mime);
- if (G_IS_THEMED_ICON (icon))
- icon_string = g_themed_icon_get_names (G_THEMED_ICON (icon));
+ if (G_IS_THEMED_ICON (icon)) {
+ const gchar * const *names = NULL;
+
+ names = g_themed_icon_get_names (G_THEMED_ICON (icon));
+ if (names) {
+ gint i;
+ GtkIconTheme *theme;
+
+ theme = gtk_icon_theme_get_default ();
+ for (i = 0; names [i]; i++) {
+ if (gtk_icon_theme_has_icon (theme, names [i])) {
+ icon_string = names [i];
+ break;
+ }
+ }
+ g_object_unref (theme);
+ }
+ }
/* create the GtkFileFilter */
item = gtk_file_filter_new ();
@@ -263,10 +279,11 @@
g_object_ref (item);
gtk_list_store_set (GTK_LIST_STORE (model), &row,
BRASERO_MIME_FILTER_DISPLAY_COL, display,
- BRASERO_MIME_FILTER_ICON_COL, icon_string?icon_string [0]:NULL,
+ BRASERO_MIME_FILTER_ICON_COL, icon_string,
BRASERO_MIME_FILTER_FILTER_COL, item,
-1);
g_object_ref_sink (GTK_OBJECT (item));
+ g_object_unref (icon);
g_free (display);
/* we check that the first entry at least is visible */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]