"Update subtree" command, take 2 (unfinished, but basically working)dev
commite6f3fae79d4029bb320cc0e741edb1ccab7ff801
authorPlamen Petrov <pvp@tk.ru.acad.bg>
Mon, 3 Mar 2008 17:38:52 +0000 (3 19:38 +0200)
committerPlamen Petrov <pvp@tk.ru.acad.bg>
Mon, 3 Mar 2008 17:38:52 +0000 (3 19:38 +0200)
treead74c9529f229895410fa1609ef538e93246362d
parent17a417ec2ec44c75bb9e434deb4b4b08396a1601
"Update subtree" command, take 2 (unfinished, but basically working)

  This patch removes the method traverseUpdate_tree, but introduces
two others: rem_MmData_folder - used to remove a folder inside
a MmData catalog with all its sub-items (folders and files);
update_catalog_stats is used to go over the entire catalog
and collect statistics; traverse_tree is changed so now it can
be called with two parameters - the first is the folder it is to
scan; the second param is optional - if it is present and other
than "AUTO" (its a QString), it should hold what is to be set
as the scanned folder's parent (either the parent folder's
absolute path, or the text "TREE_BASE" which marks it as a subtree
in the catalog tree view.
  The new update command now works as follows: it determines the
folder to update absolute path by walking up in the tree view; it
then tries to find the relevant MmData object in the catalog
(which should succed always if the updated folder is not a
"TREE_BASE") and then removes it and all its children; if the
folder really exists - then it is being rescanned; and last,
the tree view and catalog stats are updated.
  The current implementation of the "Update subtree" command
isn't entirely correct, because each folder item holds the number
of files within it only and the number of files in all of its
subfolders; the later should be updated, but currently - it isn't.
src/kmk.cpp
src/kmk.h