brasero r943 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r943 - in trunk: . src
- Date: Wed, 2 Jul 2008 13:18:15 +0000 (UTC)
Author: philippr
Date: Wed Jul 2 13:18:15 2008
New Revision: 943
URL: http://svn.gnome.org/viewvc/brasero?rev=943&view=rev
Log:
Fix problems with exotic names in data projects
* src/brasero-data-disc.c (brasero_data_disc_init):
* src/brasero-data-project.c (brasero_data_project_node_to_uri):
* src/brasero-data-tree-model.c
(brasero_data_tree_model_get_value),
(brasero_data_tree_model_get_column_type):
* src/brasero-data-tree-model.h:
* src/brasero-data-vfs.c (brasero_data_vfs_directory_load_result):
* src/brasero-file-monitor.c
(brasero_file_monitor_start_monitoring_real),
(brasero_file_monitor_directory_contents):
* src/brasero-io.c (brasero_io_load_directory_thread):
* src/burn-mkisofs-base.c (brasero_mkisofs_base_write_excluded):
Modified:
trunk/ChangeLog
trunk/src/brasero-data-disc.c
trunk/src/brasero-data-project.c
trunk/src/brasero-data-tree-model.c
trunk/src/brasero-data-tree-model.h
trunk/src/brasero-data-vfs.c
trunk/src/brasero-file-monitor.c
trunk/src/brasero-io.c
trunk/src/burn-mkisofs-base.c
Modified: trunk/src/brasero-data-disc.c
==============================================================================
--- trunk/src/brasero-data-disc.c (original)
+++ trunk/src/brasero-data-disc.c Wed Jul 2 13:18:15 2008
@@ -2108,10 +2108,12 @@
gtk_tree_view_column_pack_end (column, renderer, TRUE);
gtk_tree_view_column_add_attribute (column, renderer,
- "markup", BRASERO_DATA_TREE_MODEL_NAME);
+ "text", BRASERO_DATA_TREE_MODEL_NAME);
gtk_tree_view_column_add_attribute (column, renderer,
"style", BRASERO_DATA_TREE_MODEL_STYLE);
gtk_tree_view_column_add_attribute (column, renderer,
+ "foreground", BRASERO_DATA_TREE_MODEL_COLOR);
+ gtk_tree_view_column_add_attribute (column, renderer,
"editable", BRASERO_DATA_TREE_MODEL_EDITABLE);
g_object_set (G_OBJECT (renderer),
Modified: trunk/src/brasero-data-project.c
==============================================================================
--- trunk/src/brasero-data-project.c (original)
+++ trunk/src/brasero-data-project.c Wed Jul 2 13:18:15 2008
@@ -414,9 +414,9 @@
BraseroFileNode *node)
{
BraseroDataProjectPrivate *priv;
+ GSList *list = NULL;
gchar *retval;
guint uri_len;
- GSList *list;
GSList *iter;
gchar *ptr;
guint len;
@@ -433,20 +433,26 @@
uri_len = 0;
list = NULL;
for (; node; node = node->parent) {
+ gchar *escaped_name;
+
if (node->is_grafted)
break;
if (node == priv->root)
break;
- list = g_slist_prepend (list, node);
-
/* the + 1 is for the separator */
- uri_len += strlen (BRASERO_FILE_NODE_NAME (node)) + 1;
+ escaped_name = g_uri_escape_string (BRASERO_FILE_NODE_NAME (node), NULL, TRUE);
+ uri_len += strlen (escaped_name) + 1;
+ list = g_slist_prepend (list, escaped_name);
}
- if (!node || node->is_root)
+ /* The node here is the first grafted parent */
+ if (!node || node->is_root) {
+ g_slist_foreach (list, (GFunc) g_free, NULL);
+ g_slist_free (list);
return NULL;
+ }
/* NOTE: directories URIs shouldn't have a separator at end */
len = strlen (BRASERO_FILE_NODE_GRAFT (node)->node->uri);
@@ -458,19 +464,21 @@
ptr = retval + len;
for (iter = list; iter; iter = iter->next) {
- node = iter->data;
+ gchar *escaped_name;
+
+ escaped_name = iter->data;
ptr [0] = G_DIR_SEPARATOR;
ptr ++;
- len = strlen (BRASERO_FILE_NODE_NAME (node));
- memcpy (ptr, BRASERO_FILE_NODE_NAME (node), len);
+ len = strlen (escaped_name);
+ memcpy (ptr, escaped_name, len);
ptr += len;
}
+ g_slist_foreach (list, (GFunc) g_free, NULL);
g_slist_free (list);
ptr [0] = '\0';
-
return retval;
}
Modified: trunk/src/brasero-data-tree-model.c
==============================================================================
--- trunk/src/brasero-data-tree-model.c (original)
+++ trunk/src/brasero-data-tree-model.c Wed Jul 2 13:18:15 2008
@@ -460,21 +460,7 @@
case BRASERO_DATA_TREE_MODEL_NAME:
g_value_init (value, G_TYPE_STRING);
-
- /* we may have to set some markup on it */
- if (node->is_imported) {
- gchar *markup;
-
- /* italics and small difference in colour */
- markup = g_strdup_printf ("<span foreground='grey50'>%s</span>",
- BRASERO_FILE_NODE_NAME (node));
-
- g_value_set_string (value, markup);
- g_free (markup);
- }
- else
- g_value_set_string (value, BRASERO_FILE_NODE_NAME (node));
-
+ g_value_set_string (value, BRASERO_FILE_NODE_NAME (node));
return;
case BRASERO_DATA_TREE_MODEL_MIME_DESC:
@@ -622,6 +608,13 @@
return;
+ case BRASERO_DATA_TREE_MODEL_COLOR:
+ g_value_init (value, G_TYPE_STRING);
+ if (node->is_imported)
+ g_value_set_string (value, "grey50");
+
+ return;
+
default:
return;
}
@@ -811,6 +804,9 @@
case BRASERO_DATA_TREE_MODEL_STYLE:
return PANGO_TYPE_STYLE;
+ case BRASERO_DATA_TREE_MODEL_COLOR:
+ return G_TYPE_STRING;
+
case BRASERO_DATA_TREE_MODEL_EDITABLE:
return G_TYPE_BOOLEAN;
Modified: trunk/src/brasero-data-tree-model.h
==============================================================================
--- trunk/src/brasero-data-tree-model.h (original)
+++ trunk/src/brasero-data-tree-model.h Wed Jul 2 13:18:15 2008
@@ -49,6 +49,7 @@
BRASERO_DATA_TREE_MODEL_SHOW_PERCENT,
BRASERO_DATA_TREE_MODEL_PERCENT,
BRASERO_DATA_TREE_MODEL_STYLE,
+ BRASERO_DATA_TREE_MODEL_COLOR,
BRASERO_DATA_TREE_MODEL_EDITABLE,
BRASERO_DATA_TREE_MODEL_COL_NUM
} BraseroDataProjectColumn;
Modified: trunk/src/brasero-data-vfs.c
==============================================================================
--- trunk/src/brasero-data-vfs.c (original)
+++ trunk/src/brasero-data-vfs.c Wed Jul 2 13:18:15 2008
@@ -422,7 +422,6 @@
return;
/* Filtering part */
-
name = g_file_info_get_name (info);
/* See if it's a broken symlink */
Modified: trunk/src/brasero-file-monitor.c
==============================================================================
--- trunk/src/brasero-file-monitor.c (original)
+++ trunk/src/brasero-file-monitor.c Wed Jul 2 13:18:15 2008
@@ -574,6 +574,7 @@
const gchar *uri)
{
BraseroFileMonitorPrivate *priv;
+ gchar *unescaped_uri;
gchar *path;
gint dev_fd;
uint32_t mask;
@@ -581,7 +582,9 @@
priv = BRASERO_FILE_MONITOR_PRIVATE (self);
- path = g_filename_from_uri (uri, NULL, NULL);
+ unescaped_uri = g_uri_unescape_string (uri, NULL);
+ path = g_filename_from_uri (unescaped_uri, NULL, NULL);
+ g_free (unescaped_uri);
dev_fd = g_io_channel_unix_get_fd (priv->notify);
mask = IN_MODIFY |
@@ -670,6 +673,7 @@
* parent directory. We give them the same handle as their parent
* directory to find it more easily and mark it as being watched */
wd = brasero_file_monitor_start_monitoring_real (self, uri);
+
if (!wd)
return FALSE;
Modified: trunk/src/brasero-io.c
==============================================================================
--- trunk/src/brasero-io.c (original)
+++ trunk/src/brasero-io.c Wed Jul 2 13:18:15 2008
@@ -1586,6 +1586,9 @@
}
child = g_file_get_child (file, name);
+ if (!child)
+ continue;
+
child_uri = g_file_get_uri (child);
/* special case for symlinks */
Modified: trunk/src/burn-mkisofs-base.c
==============================================================================
--- trunk/src/burn-mkisofs-base.c (original)
+++ trunk/src/burn-mkisofs-base.c Wed Jul 2 13:18:15 2008
@@ -131,6 +131,14 @@
}
localpath = g_filename_from_uri (uri, NULL, NULL);
+ if (localpath) {
+ /* FIXME! change this */
+ g_set_error (error,
+ BRASERO_BURN_ERROR,
+ BRASERO_BURN_ERROR_GENERAL,
+ _("the file is not stored locally"));
+ return BRASERO_BURN_ERR;
+ }
/* we need to escape some characters like []\? since in this file we
* can use glob like expressions. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]