[patch #6200] delete in history lists

2007-09-16 Thread me

URL:
  

 Summary: delete in history lists
 Project: GNU Midnight Commander
Submitted by: me4mc
Submitted on: Sunday 09/16/2007 at 15:50
Category: None
Priority: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

adds a callback key handler and uses the
message-value B_USER + 1 on delete key

the show hist function now handles the keys in a loop. this checks for cancel
or the delete-key.
on delete the g_list 'history' is modified
the data of the lisbox_get_current and the g_list->entry->data are compared
and decide if the item gets dropped

when the g_list is in the new state the current is removed from the visible
listbox and the listbox decides to display the new current.
if there is no entry left the box closes.

i am used to std::vectors but like to know more about that g_lists. my
searches turned up very little information. any hints?

please report code indent problems




___

File Attachments:


---
Date: Sunday 09/16/2007 at 15:50  Name: mc-cvs-historydelete.patch  Size: 3kB
  By: me4mc



___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


[patch #6093] skip skipall

2007-09-16 Thread me

Follow-up Comment #1, patch #6093 (project mc):

i dont feel the patch is very readable, but adding comments to every added
'if' would explode the source.

so i will tell the basic concept:

FileOpContext gets a new public member 'skip_all' for usage in all possible
quests. it is initalized with 0 on every action.

file.c is altered to support a skipall in the error dialog. it takes the enum
value 2 and assigns 3 to FILE_SKIP.
there are 5 ways in file.c to handle the error_dialog:
1. success mc_{chmod|mknod} breaks the loop
 the following code is executed on success.
 skip uses break to leave the loop
 retry continues
 other statuses return.
 extra break when skipall is set
  so the error dialog wont show up and the other code is executed.
 extra break if skip is selected
  the code continues without the knowledge that anything went wrong - you
maybe want to skip each problem by hand.
 FILE_SKIPALL is used to set the FileOpContext and should break as well.

2. success mc_{open,read,fstat,write} breaks the loop
 the following code is executed on success.
 skip uses break to leave the loop
 retry continues
 other statuses 'goto ret' - big block that decides the return_status.
 therefore skip_all goes to ret.
 FILE_SKIP goto ret
 FILE_SKIPALL sets the FileOpContext
3. success mc_{close,chwon,chmod breaks the loop
 error was: anything but retry breaks
 is FILE_SKIPALL sets the FileOpContext
 FILE_SKIP is added for convenience
 break unless retry
 !!return_status setting differs
4. failed mc_unlink
 was: everything but retry returns from function
 is: abort returns from function
 retry continues
 is FILE_SKIPALL sets the FileOpContext
 FILE_SKIP is added for convenience
 break to update progress

5. failed mc_rmdir
 recursive_erase with weird return condition
 (false if not continue)
 simplified the recursion:
  root while is aborted with FILE_ABORT
  rmdir while
   abort returns
   retry continues
   is FILE_SKIPALL sets the FileOpContext
   FILE_SKIP is added for convenience
   break to return FILE_CONT

please review the latest patch because this central change maybe messes up
files. i tested it with some complicated files:
a=0; while [ 1 ]; do a=$(($a+1)); sudo touch $a; sudo chmod $a $a; done
but maybe there are more complex situations that are not considered here.

because i uploaded the patch before documenting it i detected possible flaws
while writing. (tor was accidently enabled)
please comment the logic. ill test this some weeks then merge my experience
with your comments
  
thanks

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


[patch #6093] skip skipall

2007-09-16 Thread anonymous

Additional Item Attachment, patch #6093 (project mc):

File name: mc-cvs-skipall.patch   Size:9 KB


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/

___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel