git-svn-id: svn://db.shs.com.ru/pip@76 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2015-04-07 14:04:20 +00:00
parent b9021977e4
commit f52322287d

View File

@@ -43,15 +43,18 @@ bool PIFileTransfer::send(const PIStringList& files) {
bool PIFileTransfer::send(PIVector<PIFile::FileInfo> entries) { bool PIFileTransfer::send(PIVector<PIFile::FileInfo> entries) {
started_ = true;
PIVector<PFTFileInfo> allEntries; PIVector<PFTFileInfo> allEntries;
for (int i = 0; i < entries.size_s(); i++) { for (int i = 0; i < entries.size_s(); i++) {
allEntries << PFTFileInfo(entries[i]); allEntries << PFTFileInfo(entries[i]);
allEntries.back().dest_path = entries[i].name(); allEntries.back().dest_path = entries[i].name();
if (entries[i].isDir()) { if (entries[i].isDir()) {
cur_file_string = "scaning " + entries[i].name() + " (" + PIString::fromNumber(i) + "/" + PIString::fromNumber(entries.size()) + ")";
PIDir d(entries[i].path); PIDir d(entries[i].path);
PIVector<PIFile::FileInfo> fls = d.allEntries(); PIVector<PIFile::FileInfo> fls = d.allEntries();
d.up(); d.up();
for (int j=0; j<fls.size(); j++) { for (int j=0; j<fls.size(); j++) {
cur_file_string = "scaning " + entries[i].name() + " (" + PIString::fromNumber(j) + "/" + PIString::fromNumber(fls.size()) + ")";
allEntries << PFTFileInfo(fls[j]); allEntries << PFTFileInfo(fls[j]);
allEntries.back().dest_path = d.relative(fls[j].path); allEntries.back().dest_path = d.relative(fls[j].path);
} }
@@ -74,12 +77,13 @@ bool PIFileTransfer::sendFiles(const PIVector<PFTFileInfo> &files) {
} }
srand(PISystemTime::current().toMilliseconds()); srand(PISystemTime::current().toMilliseconds());
pftheader.session_id = rand(); pftheader.session_id = rand();
started_ = true;
sendFilesStarted(); sendFilesStarted();
cur_file_string = "buil session";
desc.clear(); desc.clear();
desc << files_; desc << files_;
pftheader.step = pft_Description; pftheader.step = pft_Description;
buildSession(PIVector<Part>() << Part(0, desc.size())); buildSession(PIVector<Part>() << Part(0, desc.size()));
cur_file_string = "";
if (!send_process()) return false; if (!send_process()) return false;
pftheader.step = pft_Data; pftheader.step = pft_Data;
PIVector<Part> pts; PIVector<Part> pts;