TimerPool fixoutManipulator

git-svn-id: svn://db.shs.com.ru/pip@78 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-07 16:26:59 +00:00
parent 6575b7e074
commit 6c987ee1ae
10 changed files with 220 additions and 72 deletions

View File

@@ -9,7 +9,7 @@ PIFileTransfer::PIFileTransfer() {
pftheader.session_id = 0;
pftheader.step = pft_None;
dir = PIDir::current();
started_ = false;
started_ = scanning = false;
bytes_file_all = bytes_file_cur = 0;
// CONNECT(void, this, sendStarted, this, send_started);
CONNECT(void, this, receiveStarted, this, receive_started);
@@ -49,12 +49,13 @@ bool PIFileTransfer::send(PIVector<PIFile::FileInfo> entries) {
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);
cur_file_string = "scanning ... ";
d.setDir(entries[i].path);
scanning = true;
PIVector<PIFile::FileInfo> fls = d.allEntries();
scanning = false;
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);
}
@@ -237,6 +238,13 @@ void PIFileTransfer::receivePart(PIBaseTransfer::Part fi, PIByteArray ba, PIByte
}
PIString PIFileTransfer::curFile() const {
if (scanning)
return cur_file_string + d.scanDir();
return cur_file_string;
}
PIByteArray PIFileTransfer::customHeader() {
PIByteArray ba;
ba << pftheader;