gcmd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gcmd-dev] prevent editing of dirs


From: Koos Jan Niesink
Subject: [gcmd-dev] prevent editing of dirs
Date: Sun, 17 Dec 2006 20:51:46 +0000 (GMT)

Hello Piotr, 

I was looking at the changelog in cvs and discovered that the bug was fixed 
that made it possible to view directories in the internal viewer. There is 
still a similar bug present in gnome-commander; select a directory and press 
F4. This opens the editor (gedit in my case). The attached patch prevents that 
and it adds an extra warning that there aren't any files selected to edit. I am 
not sure if this warning is really necessary. Just see if you like it.

koos

                
---------------------------------
 All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease 
of use." - PC Magazine
--- gnome-cmd-file-list.c.bak   2006-12-15 13:19:39.000000000 +0100
+++ gnome-cmd-file-list.c       2006-12-15 20:20:14.000000000 +0100
@@ -2306,9 +2306,14 @@
     finfo = gnome_cmd_file_list_get_selected_file (fl);
 
     if (finfo)
-        if (finfo->info->type != GNOME_VFS_FILE_TYPE_DIRECTORY)
-            gnome_cmd_file_view (finfo, internal_viewer!=-1 ? internal_viewer 
: 
-                                                              
gnome_cmd_data_get_use_internal_viewer ());
+               {
+                   if (finfo->info->type == GNOME_VFS_FILE_TYPE_DIRECTORY){
+                               create_error_dialog(_("There are no files 
selected.\n"));
+                       }else{
+                   gnome_cmd_file_view (finfo, internal_viewer!=-1 ? 
internal_viewer : 
+                                                                 
gnome_cmd_data_get_use_internal_viewer ());
+                       }
+               }
 }
 
 
@@ -2322,7 +2327,13 @@
     finfo = gnome_cmd_file_list_get_selected_file (fl);
 
     if (finfo)
-        gnome_cmd_file_edit (finfo);
+               {
+                       if (finfo->info->type == GNOME_VFS_FILE_TYPE_DIRECTORY){
+                               create_error_dialog(_("There are no files 
selected.\n"));
+                       }else{
+                       gnome_cmd_file_edit (finfo);
+                       }
+               }
 }
 
 gboolean

reply via email to

[Prev in Thread] Current Thread [Next in Thread]