Corretto MI3576: aggiunto anche il ripristino dei sottodirettori.
git-svn-id: svn://10.65.10.50/trunk@5664 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4d44e7180a
commit
62d347f0a3
@ -479,11 +479,33 @@ bool TArchive::restore(
|
||||
if (ok)
|
||||
{
|
||||
_arc = new ALArchive(output);
|
||||
|
||||
|
||||
TAssoc_array subdirs; // Array dei sottodirettori da creare
|
||||
TProgress_win w("Ripristino", this);
|
||||
ALEntryList list(w.monitor());
|
||||
_arc->ReadDirectory(list);
|
||||
|
||||
// Naviga attraverso l'archivio e compone l'array dei sottodirettori da creare
|
||||
ALEntry *entry = list.GetFirstEntry();
|
||||
TFilename path;
|
||||
|
||||
while (entry)
|
||||
{
|
||||
path = entry->mpStorageObject->mName;
|
||||
path = path.path();
|
||||
if (path.not_empty() && subdirs.objptr(path) == NULL) // Se non c'e' lo aggiunge alla lista
|
||||
if (!fexist(path))
|
||||
subdirs.add(path,path);
|
||||
entry = entry->GetNextEntry();
|
||||
}
|
||||
|
||||
// Scorre la lista dei sottodirettori da creare
|
||||
for (TFilename* p = (TFilename*)subdirs.first_item(); p != NULL; p = (TFilename*)subdirs.succ_item())
|
||||
{
|
||||
p->rtrim(1); // Strip trailing /
|
||||
make_dir(*p);
|
||||
}
|
||||
|
||||
w.open_modal();
|
||||
_arc->Extract( list );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user