[gthumb/ext] do not allow dropping files in a ready only location
- From: Paolo Bacchilega <paobac src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gthumb/ext] do not allow dropping files in a ready only location
- Date: Sun, 30 Aug 2009 18:25:14 +0000 (UTC)
commit 3cf237cd475bf3d56c7e2ddafe4545710ca167b4
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Aug 30 20:24:34 2009 +0200
do not allow dropping files in a ready only location
extensions/catalogs/callbacks.c | 5 +----
extensions/file_manager/callbacks.c | 13 ++++++++-----
extensions/rename_series/callbacks.c | 5 +----
extensions/search/callbacks.c | 7 ++-----
gthumb/gth-browser.c | 2 +-
gthumb/gth-main-default-hooks.c | 2 +-
6 files changed, 14 insertions(+), 20 deletions(-)
---
diff --git a/extensions/catalogs/callbacks.c b/extensions/catalogs/callbacks.c
index 2daec52..6a501ca 100644
--- a/extensions/catalogs/callbacks.c
+++ b/extensions/catalogs/callbacks.c
@@ -239,14 +239,11 @@ catalogs__gth_catalog_load_from_data_cb (const void *buffer)
void
catalogs__gth_browser_load_location_after_cb (GthBrowser *browser,
- GFile *location,
+ GthFileData *location_data,
const GError *error)
{
BrowserData *data;
- if (location == NULL)
- return;
-
data = g_object_get_data (G_OBJECT (browser), BROWSER_DATA_KEY);
if (GTH_IS_FILE_SOURCE_CATALOGS (gth_browser_get_location_source (browser))) {
diff --git a/extensions/file_manager/callbacks.c b/extensions/file_manager/callbacks.c
index 7a1a50d..adfd7a8 100644
--- a/extensions/file_manager/callbacks.c
+++ b/extensions/file_manager/callbacks.c
@@ -573,19 +573,22 @@ fm__gth_browser_set_current_page_cb (GthBrowser *browser)
void
fm__gth_browser_load_location_after_cb (GthBrowser *browser,
- GFile *location,
+ GthFileData *location_data,
const GError *error)
{
BrowserData *data;
GtkWidget *file_view;
- if (location == NULL)
- return;
-
data = g_object_get_data (G_OBJECT (browser), BROWSER_DATA_KEY);
file_manager_update_ui (data, browser);
- if (gth_file_source_is_reorderable (gth_browser_get_location_source (browser))) {
+ if (! g_file_info_get_attribute_boolean (location_data->info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) {
+ file_view = gth_file_list_get_view (GTH_FILE_LIST (gth_browser_get_file_list (browser)));
+ gth_file_view_unset_drag_dest (GTH_FILE_VIEW (file_view));
+ file_view = gth_file_list_get_empty_view (GTH_FILE_LIST (gth_browser_get_file_list (browser)));
+ gtk_drag_dest_unset (file_view);
+ }
+ else if (gth_file_source_is_reorderable (gth_browser_get_location_source (browser))) {
file_view = gth_file_list_get_view (GTH_FILE_LIST (gth_browser_get_file_list (browser)));
gth_file_view_enable_drag_dest (GTH_FILE_VIEW (file_view),
reorderable_drag_dest_targets,
diff --git a/extensions/rename_series/callbacks.c b/extensions/rename_series/callbacks.c
index 46cb978..cd0b30f 100644
--- a/extensions/rename_series/callbacks.c
+++ b/extensions/rename_series/callbacks.c
@@ -131,14 +131,11 @@ rs__gth_browser_set_current_page_cb (GthBrowser *browser)
void
rs__gth_browser_load_location_after_cb (GthBrowser *browser,
- GFile *location,
+ GthFileData *location_data,
const GError *error)
{
BrowserData *data;
- if (location == NULL)
- return;
-
data = g_object_get_data (G_OBJECT (browser), BROWSER_DATA_KEY);
file_manager_update_ui (data, browser);
}
diff --git a/extensions/search/callbacks.c b/extensions/search/callbacks.c
index ee6c29e..b30e04d 100644
--- a/extensions/search/callbacks.c
+++ b/extensions/search/callbacks.c
@@ -144,17 +144,14 @@ search__gth_browser_construct_cb (GthBrowser *browser)
void
search__gth_browser_load_location_after_cb (GthBrowser *browser,
- GFile *location,
+ GthFileData *location_data,
const GError *error)
{
BrowserData *data;
char *uri;
- if (location == NULL)
- return;
-
data = g_object_get_data (G_OBJECT (browser), BROWSER_DATA_KEY);
- uri = g_file_get_uri (location);
+ uri = g_file_get_uri (location_data->file);
if (g_str_has_suffix (uri, ".search") && (error == NULL)) {
if (data->find_merge_id != 0) {
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 8059b21..32918cd 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -985,7 +985,7 @@ load_data_done (LoadData *load_data,
|| (load_data->action == GTH_ACTION_GO_UP)
|| (load_data->action == GTH_ACTION_VIEW))
{
- gth_hook_invoke ("gth-browser-load-location-after", browser, load_data->requested_folder->file, error);
+ gth_hook_invoke ("gth-browser-load-location-after", browser, browser->priv->location, error);
}
if (error == NULL)
diff --git a/gthumb/gth-main-default-hooks.c b/gthumb/gth-main-default-hooks.c
index 8478c85..a531586 100644
--- a/gthumb/gth-main-default-hooks.c
+++ b/gthumb/gth-main-default-hooks.c
@@ -102,7 +102,7 @@ gth_main_register_default_hooks (void)
* Called after the folder has been loaded.
*
* @browser (GthBrowser*): the window
- * @folder (GFile*): the loaded folder
+ * @folder (GthFileData*): the loaded folder data
* @error (GError*): the error or NULL if the folder was loaded
* correctly.
**/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]