git-svn-id: svn://db.shs.com.ru/pip@76 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -43,15 +43,18 @@ bool PIFileTransfer::send(const PIStringList& files) {
|
||||
|
||||
|
||||
bool PIFileTransfer::send(PIVector<PIFile::FileInfo> entries) {
|
||||
started_ = true;
|
||||
PIVector<PFTFileInfo> allEntries;
|
||||
for (int i = 0; i < entries.size_s(); i++) {
|
||||
allEntries << PFTFileInfo(entries[i]);
|
||||
allEntries.back().dest_path = entries[i].name();
|
||||
if (entries[i].isDir()) {
|
||||
cur_file_string = "scaning " + entries[i].name() + " (" + PIString::fromNumber(i) + "/" + PIString::fromNumber(entries.size()) + ")";
|
||||
PIDir d(entries[i].path);
|
||||
PIVector<PIFile::FileInfo> fls = d.allEntries();
|
||||
d.up();
|
||||
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.back().dest_path = d.relative(fls[j].path);
|
||||
}
|
||||
@@ -74,12 +77,13 @@ bool PIFileTransfer::sendFiles(const PIVector<PFTFileInfo> &files) {
|
||||
}
|
||||
srand(PISystemTime::current().toMilliseconds());
|
||||
pftheader.session_id = rand();
|
||||
started_ = true;
|
||||
sendFilesStarted();
|
||||
cur_file_string = "buil session";
|
||||
desc.clear();
|
||||
desc << files_;
|
||||
pftheader.step = pft_Description;
|
||||
buildSession(PIVector<Part>() << Part(0, desc.size()));
|
||||
cur_file_string = "";
|
||||
if (!send_process()) return false;
|
||||
pftheader.step = pft_Data;
|
||||
PIVector<Part> pts;
|
||||
|
||||
Reference in New Issue
Block a user