summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiscomfitor <michael.blumenkrantz@gmail.com>2013-09-19 16:29:55 +0100
committerdiscomfitor <michael.blumenkrantz@gmail.com>2013-09-19 20:09:40 +0100
commit3fb3b3520b0b0070d22196f2800962e89c457c97 (patch)
treeec2ec233164e823855c2f1c7debc89b36a2e4c0a
parent65a9f8d02af0a384626a0c79d44e90e4e5d84b4b (diff)
bugfix: efm now allows repeated creation of new files from menus
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_fm.c40
3 files changed, 37 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 96b20259c..f5f6c9004 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-09-19 Mike Blumenkrantz
2
3 * Fix bug where new files could not be created repeatedly
4
12013-08-30 Mike Blumenkrantz 52013-08-30 Mike Blumenkrantz
2 6
3 * Navigate menu item now opens $HOME 7 * Navigate menu item now opens $HOME
diff --git a/NEWS b/NEWS
index 7dd663992..0a26fe4a6 100644
--- a/NEWS
+++ b/NEWS
@@ -229,3 +229,4 @@ Fixes:
229 * fixed crash when multiple windows shared a remember 229 * fixed crash when multiple windows shared a remember
230 * fixed bug where double clicking filemanager windows would not correctly autosize 230 * fixed bug where double clicking filemanager windows would not correctly autosize
231 * fixed bug where setting min size on a gadget would not be passed to desktop gadgets 231 * fixed bug where setting min size on a gadget would not be passed to desktop gadgets
232 * fixed bug where new files could not be created repeatedly
diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c
index 67bce15ca..8544402a8 100644
--- a/src/bin/e_fm.c
+++ b/src/bin/e_fm.c
@@ -84,6 +84,7 @@ struct _E_Fm2_Smart_Data
84 { 84 {
85 Ecore_Thread *thread; 85 Ecore_Thread *thread;
86 const char *filename; 86 const char *filename;
87 Eina_Bool done : 1;
87 } new_file; 88 } new_file;
88 89
89 E_Fm2_Icon *last_selected; 90 E_Fm2_Icon *last_selected;
@@ -4892,6 +4893,19 @@ _e_fm2_icon_realize(E_Fm2_Icon *ic)
4892 4893
4893 if (ic->info.removable) 4894 if (ic->info.removable)
4894 _e_fm2_icon_removable_update(ic); 4895 _e_fm2_icon_removable_update(ic);
4896 if (ic->sd->new_file.thread && (!ic->sd->new_file.filename))
4897 {
4898 /* we got the file through the scanner :/ */
4899 const char *file = ecore_thread_global_data_find("efm_pending_filename");
4900
4901 if (!e_util_strcmp(ic->info.file, file))
4902 {
4903 _e_fm2_file_rename(ic, NULL, NULL);
4904 ic->sd->new_file.done = 1;
4905 }
4906 if (file)
4907 ecore_thread_global_data_del("efm_pending_filename");
4908 }
4895 if (ic->sd->new_file.filename) 4909 if (ic->sd->new_file.filename)
4896 { 4910 {
4897 if (ic->info.file == ic->sd->new_file.filename) 4911 if (ic->info.file == ic->sd->new_file.filename)
@@ -9658,10 +9672,13 @@ _e_fm2_new_dir_notify(void *data, Ecore_Thread *eth __UNUSED__, char *filename)
9658{ 9672{
9659 E_Fm2_Smart_Data *sd = data; 9673 E_Fm2_Smart_Data *sd = data;
9660 9674
9661 if (filename) 9675 if (!sd->new_file.done)
9662 sd->new_file.filename = eina_stringshare_add(ecore_file_file_get(filename)); 9676 {
9663 else 9677 if (filename)
9664 e_util_dialog_internal(_("Error"), _("Could not create a directory!")); 9678 sd->new_file.filename = eina_stringshare_add(ecore_file_file_get(filename));
9679 else
9680 e_util_dialog_internal(_("Error"), _("Could not create a directory!"));
9681 }
9665 free(filename); 9682 free(filename);
9666} 9683}
9667 9684
@@ -9670,10 +9687,13 @@ _e_fm2_new_file_notify(void *data, Ecore_Thread *eth __UNUSED__, char *filename)
9670{ 9687{
9671 E_Fm2_Smart_Data *sd = data; 9688 E_Fm2_Smart_Data *sd = data;
9672 9689
9673 if (filename) 9690 if (!sd->new_file.done)
9674 sd->new_file.filename = eina_stringshare_add(ecore_file_file_get(filename)); 9691 {
9675 else 9692 if (filename)
9676 e_util_dialog_internal(_("Error"), _("Could not create a file!")); 9693 sd->new_file.filename = eina_stringshare_add(ecore_file_file_get(filename));
9694 else
9695 e_util_dialog_internal(_("Error"), _("Could not create a file!"));
9696 }
9677 free(filename); 9697 free(filename);
9678} 9698}
9679 9699
@@ -9696,6 +9716,7 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool dir)
9696 { 9716 {
9697 if (ecore_file_mkdir(buf)) 9717 if (ecore_file_mkdir(buf))
9698 { 9718 {
9719 ecore_thread_global_data_set("efm_pending_filename", strdup(buf), free);
9699 ecore_thread_feedback(eth, strdup(buf)); 9720 ecore_thread_feedback(eth, strdup(buf));
9700 return; 9721 return;
9701 } 9722 }
@@ -9714,6 +9735,7 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool dir)
9714 perror("write"); 9735 perror("write");
9715 } 9736 }
9716 close(fd); 9737 close(fd);
9738 ecore_thread_global_data_set("efm_pending_filename", strdup(buf), free);
9717 ecore_thread_feedback(eth, strdup(buf)); 9739 ecore_thread_feedback(eth, strdup(buf));
9718 return; 9740 return;
9719 } 9741 }
@@ -9732,6 +9754,7 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool dir)
9732 { 9754 {
9733 if (ecore_file_mkdir(buf)) 9755 if (ecore_file_mkdir(buf))
9734 { 9756 {
9757 ecore_thread_global_data_set("efm_pending_filename", strdup(buf), free);
9735 ecore_thread_feedback(eth, strdup(buf)); 9758 ecore_thread_feedback(eth, strdup(buf));
9736 return; 9759 return;
9737 } 9760 }
@@ -9750,6 +9773,7 @@ _e_fm2_new_thread_helper(Ecore_Thread *eth, Eina_Bool dir)
9750 perror("write"); 9773 perror("write");
9751 } 9774 }
9752 close(fd); 9775 close(fd);
9776 ecore_thread_global_data_set("efm_pending_filename", strdup(buf), free);
9753 ecore_thread_feedback(eth, strdup(buf)); 9777 ecore_thread_feedback(eth, strdup(buf));
9754 return; 9778 return;
9755 } 9779 }