summaryrefslogtreecommitdiff
path: root/plugins/gtkui/actionhandlers.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-14 21:15:28 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-11-14 21:15:28 +0100
commit0d57b5fb0323f4292d20ee4f1571d540d966e107 (patch)
tree43ca112e38156844fb6616dc06ecfafaacffe02c /plugins/gtkui/actionhandlers.c
parentd8d888f26a89c6dfa376ebbf0c7af83df16a6d5b (diff)
fixed is_local_file documentation, fixed few places which use it
Diffstat (limited to 'plugins/gtkui/actionhandlers.c')
-rw-r--r--plugins/gtkui/actionhandlers.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/plugins/gtkui/actionhandlers.c b/plugins/gtkui/actionhandlers.c
index 879f8f09..88214a1c 100644
--- a/plugins/gtkui/actionhandlers.c
+++ b/plugins/gtkui/actionhandlers.c
@@ -508,8 +508,9 @@ action_delete_from_disk_handler_cb (void *data) {
while (it) {
const char *uri = deadbeef->pl_find_meta (it, ":URI");
if (deadbeef->pl_is_selected (it) && deadbeef->is_local_file (uri)) {
- unlink (uri);
- deadbeef->plt_remove_item (plt, it);
+ if (!unlink (uri)) {
+ deadbeef->plt_remove_item (plt, it);
+ }
}
DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN);
deadbeef->pl_item_unref (it);
@@ -523,8 +524,19 @@ action_delete_from_disk_handler_cb (void *data) {
while (it) {
const char *uri = deadbeef->pl_find_meta (it, ":URI");
if (deadbeef->is_local_file (uri)) {
- unlink (uri);
- deadbeef->plt_remove_item (plt, it);
+ if (!unlink (uri)) {
+ deadbeef->plt_remove_item (plt, it);
+ }
+// FIXME: this dialog should allow something like "cancel" and "ignore all", then
+// it will be usable
+// else {
+// GtkWidget *dlg = gtk_message_dialog_new (GTK_WINDOW (mainwin), GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, _("Can't delete the file. Perhaps it doesn't exist, read-only, or part of read-only VFS, or all of the above."));
+// gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dlg), uri);
+// gtk_window_set_title (GTK_WINDOW (dlg), _("Warning"));
+//
+// int response = gtk_dialog_run (GTK_DIALOG (dlg));
+// gtk_widget_destroy (dlg);
+// }
}
DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN);
deadbeef->pl_item_unref (it);
@@ -540,8 +552,9 @@ action_delete_from_disk_handler_cb (void *data) {
if (deadbeef->is_local_file (uri)) {
int idx = deadbeef->plt_get_item_idx (plt, it, PL_MAIN);
if (idx != -1) {
- unlink (uri);
- deadbeef->plt_remove_item (plt, it);
+ if (!unlink (uri)) {
+ deadbeef->plt_remove_item (plt, it);
+ }
}
}
deadbeef->pl_item_unref (it);