Revert "Zip-O-Matic: fix zipping single folder."

This reverts commit d1d90b0462.
This commit is contained in:
John Scipione
2015-06-20 19:38:10 -07:00
parent ee5588f2ab
commit 134b3a7139
+19 -11
View File
@@ -93,25 +93,29 @@ ZipperThread::ThreadStartup()
gotDirRef = true; gotDirRef = true;
} }
BString archiveName; if (gotDirRef) {
BEntry entry(&dirRef);
if (gotDirRef || sameFolder) { BPath path;
entry.GetPath(&path);
chdir(path.Path());
} else if (sameFolder) {
BEntry entry(&lastRef); BEntry entry(&lastRef);
BPath path; BPath path;
entry.GetParent(&entry); entry.GetParent(&entry);
entry.GetPath(&path); entry.GetPath(&path);
archiveName = path.Path(); chdir(path.Path());
} else { } else {
BPath path; BPath path;
if (find_directory(B_DESKTOP_DIRECTORY, &path) == B_OK) if (find_directory(B_DESKTOP_DIRECTORY, &path) == B_OK)
archiveName = path.Path(); chdir(path.Path());
} }
archiveName.Append("/");
BString archiveName;
if (refCount > 1) if (refCount > 1)
archiveName.Append(B_TRANSLATE("Archive")); archiveName = B_TRANSLATE("Archive");
else else
archiveName.Append(lastRef.name); archiveName = lastRef.name;
int index = 1; int index = 1;
for (;; index++) { for (;; index++) {
@@ -140,9 +144,13 @@ ZipperThread::ThreadStartup()
for (int index = 0; index < refCount; index++) { for (int index = 0; index < refCount; index++) {
fThreadDataStore->FindRef("refs", index, &ref); fThreadDataStore->FindRef("refs", index, &ref);
BPath path(&ref); if (gotDirRef || sameFolder) {
BString file = path.Path(); argv[3 + index] = strdup(ref.name);
argv[3 + index] = strdup(path.Path()); } else {
BPath path(&ref);
BString file = path.Path();
argv[3 + index] = strdup(path.Path());
}
} }
argv[argc] = NULL; argv[argc] = NULL;