brasero r1670 - in trunk: . data src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1670 - in trunk: . data src
- Date: Wed, 31 Dec 2008 13:57:30 +0000 (UTC)
Author: philippr
Date: Wed Dec 31 13:57:30 2008
New Revision: 1670
URL: http://svn.gnome.org/viewvc/brasero?rev=1670&view=rev
Log:
2008-12-31 Philippe Rouquier <ykw localhost localdomain>
Fix #564680 â Symlinks are written as files.
and #526263 â Allow adding symlinks too projects
* data/brasero.schemas.in:
* src/brasero-data-project.c (brasero_data_project_add_node_real),
(brasero_data_project_node_loaded),
(brasero_data_project_add_node_from_info):
* src/brasero-data-project.h:
* src/brasero-data-vfs.c (brasero_data_vfs_load_directory),
(brasero_data_vfs_load_node), (brasero_data_vfs_load_mime),
(brasero_data_vfs_replace_sym_changed), (brasero_data_vfs_init):
* src/brasero-data-vfs.h:
* src/brasero-filter-option.c
(brasero_file_filtered_replace_sym_cb),
(brasero_filter_option_init):
* src/brasero-io.c (brasero_io_get_file_info_thread_real),
(brasero_io_get_file_count_process_directory),
(brasero_io_get_file_count_start),
(brasero_io_load_directory_thread),
(brasero_io_xfer_recursive_thread), (brasero_io_xfer_start):
* src/brasero-io.h:
Modified:
trunk/ChangeLog
trunk/data/brasero.schemas.in
trunk/src/brasero-data-project.c
trunk/src/brasero-data-project.h
trunk/src/brasero-data-vfs.c
trunk/src/brasero-data-vfs.h
trunk/src/brasero-filter-option.c
trunk/src/brasero-io.c
trunk/src/brasero-io.h
Modified: trunk/data/brasero.schemas.in
==============================================================================
--- trunk/data/brasero.schemas.in (original)
+++ trunk/data/brasero.schemas.in Wed Dec 31 13:57:30 2008
@@ -187,6 +187,18 @@
</schema>
<schema>
+ <key>/schemas/apps/brasero/filter/replace_sym</key>
+ <applyto>/apps/brasero/filter/replace_sym</applyto>
+ <owner>brasero</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Replace symlinks files by their targets</short>
+ <long>Should brasero replace symlinks by their target files in the project. Set to true, brasero will replace symlinks.</long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/brasero/filter/broken_sym</key>
<applyto>/apps/brasero/filter/broken_sym</applyto>
<owner>brasero</owner>
Modified: trunk/src/brasero-data-project.c
==============================================================================
--- trunk/src/brasero-data-project.c (original)
+++ trunk/src/brasero-data-project.c Wed Dec 31 13:57:30 2008
@@ -34,6 +34,8 @@
#include <gio/gio.h>
+#include <gconf/gconf-client.h>
+
#include "brasero-data-project.h"
#include "brasero-marshal.h"
@@ -1509,13 +1511,6 @@
/* If there is already a graft for this URI, then add node */
brasero_file_node_graft (node, graft);
}
- else if (node->is_symlink) {
- /* NOTE: info has the uri for the target of the symlink; graft
- * it as well as all the nodes already in the tree with the same
- * URI */
- graft = brasero_data_project_uri_graft_nodes (self, uri);
- brasero_file_node_graft (node, graft);
- }
else if (node->parent == priv->root) {
/* The node is at the root of the project; graft it as well as
* all the nodes already in the tree with the same URI */
@@ -1819,6 +1814,7 @@
BraseroDataProjectPrivate *priv;
priv = BRASERO_DATA_PROJECT_PRIVATE (self);
+
type = g_file_info_get_file_type (info);
if (node->is_tmp_parent) {
/* we must make sure that this is really a directory */
@@ -1887,7 +1883,7 @@
/* Check it that needs a graft: this node has not been moved so we don't
* need to check these cases yet it could turn out that it was a symlink
* then we need a graft. */
- if (node->is_symlink) {
+ if (node->is_symlink && g_file_info_get_file_type (info) != G_FILE_TYPE_SYMBOLIC_LINK) {
BraseroURINode *graft;
gchar *uri;
@@ -2142,7 +2138,7 @@
}
node = brasero_file_node_new_from_info (info, parent, priv->sort_func);
- if (node->is_symlink) {
+ if (node->is_symlink && g_file_info_get_file_type (info) != G_FILE_TYPE_SYMBOLIC_LINK) {
/* first we exclude the symlink, then we graft its target */
brasero_data_project_exclude_uri (self, uri);
Modified: trunk/src/brasero-data-project.h
==============================================================================
--- trunk/src/brasero-data-project.h (original)
+++ trunk/src/brasero-data-project.h Wed Dec 31 13:57:30 2008
@@ -41,6 +41,7 @@
G_BEGIN_DECLS
+
#define BRASERO_TYPE_DATA_PROJECT (brasero_data_project_get_type ())
#define BRASERO_DATA_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_DATA_PROJECT, BraseroDataProject))
#define BRASERO_DATA_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_DATA_PROJECT, BraseroDataProjectClass))
Modified: trunk/src/brasero-data-vfs.c
==============================================================================
--- trunk/src/brasero-data-vfs.c (original)
+++ trunk/src/brasero-data-vfs.c Wed Dec 31 13:57:30 2008
@@ -59,6 +59,7 @@
BraseroIOJobBase *load_uri;
BraseroIOJobBase *load_contents;
+ guint replace_sym:1;
guint filter_hidden:1;
guint filter_broken_sym:1;
};
@@ -562,7 +563,8 @@
brasero_io_load_directory (priv->io,
uri,
priv->load_contents,
- BRASERO_IO_INFO_PERM,
+ BRASERO_IO_INFO_PERM|
+ (priv->replace_sym ? BRASERO_IO_INFO_FOLLOW_SYMLINK:BRASERO_IO_INFO_NONE),
registered);
/* Only emit a signal if state changed. Some widgets need to know if
@@ -783,7 +785,8 @@
brasero_io_get_file_info (priv->io,
uri,
priv->load_uri,
- flags,
+ flags|
+ (priv->replace_sym ? BRASERO_IO_INFO_FOLLOW_SYMLINK:BRASERO_IO_INFO_NONE),
registered);
/* Only emit a signal if state changed. Some widgets need to know if
@@ -967,7 +970,8 @@
reference = brasero_data_project_reference_new (BRASERO_DATA_PROJECT (self), node);
result = brasero_data_vfs_load_node (self,
BRASERO_IO_INFO_MIME|
- BRASERO_IO_INFO_URGENT,
+ BRASERO_IO_INFO_URGENT|
+ (priv->replace_sym ? BRASERO_IO_INFO_FOLLOW_SYMLINK:BRASERO_IO_INFO_NONE),
reference,
uri);
g_free (uri);
@@ -1170,6 +1174,24 @@
}
static void
+brasero_data_vfs_replace_sym_changed (GConfClient *client,
+ guint cxn,
+ GConfEntry *entry,
+ gpointer data)
+{
+ BraseroDataVFSPrivate *priv;
+ GConfValue *value;
+
+ priv = BRASERO_DATA_VFS_PRIVATE (data);
+
+ value = gconf_entry_get_value (entry);
+ if (value->type != GCONF_VALUE_BOOL)
+ return;
+
+ priv->replace_sym = gconf_value_get_bool (value);
+}
+
+static void
brasero_data_vfs_init (BraseroDataVFS *object)
{
GConfClient *client;
@@ -1179,12 +1201,16 @@
/* load the fitering rules */
client = gconf_client_get_default ();
+ priv->replace_sym = gconf_client_get_bool (client,
+ BRASERO_REPLACE_SYMLINK_KEY,
+ NULL);
priv->filter_hidden = gconf_client_get_bool (client,
BRASERO_FILTER_HIDDEN_KEY,
NULL);
priv->filter_broken_sym = gconf_client_get_bool (client,
BRASERO_FILTER_BROKEN_SYM_KEY,
NULL);
+
gconf_client_notify_add (client,
BRASERO_FILTER_HIDDEN_KEY,
brasero_data_vfs_filter_hidden_changed,
@@ -1197,6 +1223,12 @@
object,
NULL,
NULL);
+ gconf_client_notify_add (client,
+ BRASERO_REPLACE_SYMLINK_KEY,
+ brasero_data_vfs_replace_sym_changed,
+ object,
+ NULL,
+ NULL);
g_object_unref (client);
/* create the hash tables */
Modified: trunk/src/brasero-data-vfs.h
==============================================================================
--- trunk/src/brasero-data-vfs.h (original)
+++ trunk/src/brasero-data-vfs.h Wed Dec 31 13:57:30 2008
@@ -31,6 +31,7 @@
#define BRASERO_FILTER_HIDDEN_KEY "/apps/brasero/filter/hidden"
#define BRASERO_FILTER_BROKEN_SYM_KEY "/apps/brasero/filter/broken_sym"
+#define BRASERO_REPLACE_SYMLINK_KEY "/apps/brasero/filter/replace_sym"
typedef enum {
/* Following means it has been removed */
Modified: trunk/src/brasero-filter-option.c
==============================================================================
--- trunk/src/brasero-filter-option.c (original)
+++ trunk/src/brasero-filter-option.c Wed Dec 31 13:57:30 2008
@@ -33,6 +33,7 @@
#include <gconf/gconf-client.h>
#include "brasero-filter-option.h"
+#include "brasero-data-project.h"
#include "brasero-data-vfs.h"
#include "brasero-utils.h"
@@ -41,6 +42,7 @@
{
GConfClient *client;
guint broken_sym_notify;
+ guint sym_notify;
guint hidden_notify;
};
@@ -75,6 +77,19 @@
}
static void
+brasero_file_filtered_replace_sym_cb (GtkToggleButton *button,
+ BraseroFilterOption *self)
+{
+ BraseroFilterOptionPrivate *priv;
+
+ priv = BRASERO_FILTER_OPTION_PRIVATE (self);
+ gconf_client_set_bool (priv->client,
+ BRASERO_REPLACE_SYMLINK_KEY,
+ gtk_toggle_button_get_active (button),
+ NULL);
+}
+
+static void
brasero_file_filtered_gconf_notify_cb (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
@@ -95,6 +110,7 @@
GtkWidget *frame;
GError *error = NULL;
GtkWidget *button_sym;
+ GtkWidget *button_broken;
GtkWidget *button_hidden;
BraseroFilterOptionPrivate *priv;
@@ -102,6 +118,7 @@
priv->client = gconf_client_get_default ();
+ /* filter hidden files */
active = gconf_client_get_bool (priv->client,
BRASERO_FILTER_HIDDEN_KEY,
NULL);
@@ -124,22 +141,46 @@
error = NULL;
}
+ /* replace symlink */
active = gconf_client_get_bool (priv->client,
BRASERO_FILTER_BROKEN_SYM_KEY,
NULL);
- button_sym = gtk_check_button_new_with_mnemonic (_("Filter _broken symlinks"));
+ button_sym = gtk_check_button_new_with_mnemonic (_("Re_place symlinks"));
gtk_widget_show (button_sym);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_sym), active);
g_signal_connect (button_sym,
"toggled",
+ G_CALLBACK (brasero_file_filtered_replace_sym_cb),
+ object);
+
+ priv->sym_notify = gconf_client_notify_add (priv->client,
+ BRASERO_REPLACE_SYMLINK_KEY,
+ brasero_file_filtered_gconf_notify_cb,
+ button_sym, NULL, &error);
+ if (error) {
+ g_warning ("GConf : %s\n", error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+
+ /* filter broken symlink button */
+ active = gconf_client_get_bool (priv->client,
+ BRASERO_FILTER_BROKEN_SYM_KEY,
+ NULL);
+
+ button_broken = gtk_check_button_new_with_mnemonic (_("Filter _broken symlinks"));
+ gtk_widget_show (button_broken);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_broken), active);
+ g_signal_connect (button_broken,
+ "toggled",
G_CALLBACK (brasero_file_filtered_filter_broken_sym_cb),
object);
priv->broken_sym_notify = gconf_client_notify_add (priv->client,
BRASERO_FILTER_BROKEN_SYM_KEY,
brasero_file_filtered_gconf_notify_cb,
- button_sym, NULL, &error);
+ button_broken, NULL, &error);
if (error) {
g_warning ("GConf : %s\n", error->message);
g_error_free (error);
@@ -149,6 +190,7 @@
string = g_strdup_printf ("<b>%s</b>", _("Filtering options"));
frame = brasero_utils_pack_properties (string,
button_sym,
+ button_broken,
button_hidden,
NULL);
g_free (string);
Modified: trunk/src/brasero-io.c
==============================================================================
--- trunk/src/brasero-io.c (original)
+++ trunk/src/brasero-io.c Wed Dec 31 13:57:30 2008
@@ -44,6 +44,7 @@
#include "burn-debug.h"
#include "burn-volume.h"
+#include "brasero-app.h"
#include "brasero-utils.h"
#include "brasero-io.h"
#include "brasero-metadata.h"
@@ -1028,7 +1029,7 @@
info = g_file_query_info (file,
attributes,
- G_FILE_QUERY_INFO_NONE, /* follow symlinks */
+ (options & BRASERO_IO_INFO_FOLLOW_SYMLINK)?G_FILE_QUERY_INFO_NONE:G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, /* follow symlinks by default*/
cancel,
&local_error);
if (!info) {
@@ -1584,7 +1585,7 @@
enumerator = g_file_enumerate_children (file,
attributes,
- G_FILE_QUERY_INFO_NONE, /* follow symlinks */
+ (data->job.options & BRASERO_IO_INFO_FOLLOW_SYMLINK)?G_FILE_QUERY_INFO_NONE:G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, /* follow symlinks by default*/
cancel,
NULL);
if (!enumerator) {
@@ -1649,7 +1650,7 @@
file = g_file_new_for_uri (uri);
info = g_file_query_info (file,
attributes,
- G_FILE_QUERY_INFO_NONE, /* follow symlinks */
+ (data->job.options & BRASERO_IO_INFO_FOLLOW_SYMLINK)?G_FILE_QUERY_INFO_NONE:G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, /* follow symlinks by default*/
cancel,
NULL);
@@ -1898,7 +1899,7 @@
enumerator = g_file_enumerate_children (file,
attributes,
- G_FILE_QUERY_INFO_NONE, /* follow symlinks */
+ (data->job.options & BRASERO_IO_INFO_FOLLOW_SYMLINK)?G_FILE_QUERY_INFO_NONE:G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, /* follow symlinks by default*/
cancel,
&error);
@@ -2309,7 +2310,7 @@
enumerator = g_file_enumerate_children (src,
G_FILE_ATTRIBUTE_STANDARD_TYPE ","
G_FILE_ATTRIBUTE_STANDARD_NAME,
- G_FILE_QUERY_INFO_NONE, /* follow symlinks */
+ G_FILE_QUERY_INFO_NONE, /* follow symlinks by default */
cancel,
error);
if (!enumerator)
@@ -2381,7 +2382,7 @@
data->info = g_file_query_info (file,
G_FILE_ATTRIBUTE_STANDARD_TYPE","
G_FILE_ATTRIBUTE_STANDARD_SIZE,
- G_FILE_QUERY_INFO_NONE, /* follow symlinks */
+ G_FILE_QUERY_INFO_NONE, /* follow symlinks by default*/
cancel,
error);
if (!data->info || error) {
Modified: trunk/src/brasero-io.h
==============================================================================
--- trunk/src/brasero-io.h (original)
+++ trunk/src/brasero-io.h Wed Dec 31 13:57:30 2008
@@ -62,6 +62,8 @@
BRASERO_IO_INFO_CHECK_PARENT_SYMLINK = 1 << 5,
BRASERO_IO_INFO_METADATA_MISSING_CODEC = 1 << 6,
+ BRASERO_IO_INFO_FOLLOW_SYMLINK = 1 << 7,
+
BRASERO_IO_INFO_URGENT = 1 << 9,
BRASERO_IO_INFO_IDLE = 1 << 10
} BraseroIOFlags;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]