QFileInfo info(source);
if (m_verboseLevel >= VerboseStandard)
m_mainWindow->addToFileList(source + " " + ReQStringUtils::readableSize(info.size()));
+ m_mutex.lock();
m_processedFiles++;
m_processedBytes += info.size();
+ m_mutex.unlock();
QString errorMsg = ReFileUtils::copy(source, target, &info, m_buffer);
if (! errorMsg.isEmpty()){
qint64 processedBytes, hotBytes;
int hotFiles, processedFiles;
m_mutex.lock();
- hotFiles = m_hotFiles * 2;
+ hotFiles = m_hotFiles;
hotBytes = m_hotBytes * 2;
processedBytes = m_processedBytes;
processedFiles = m_processedFiles;
QString relPath, node;
QString info;
QDateTime start = QDateTime::currentDateTime();
+ int processedFiles, hotFiles;
while (! m_shouldStop){
m_mutex.lock();
if (m_files.size() == 0)
info = m_files.first();
m_files.removeFirst();
}
- m_processedFiles++;
+ hotFiles = m_hotFiles;
+ if (! info.isEmpty())
+ processedFiles = ++m_processedFiles;
m_mutex.unlock();
if (info.isEmpty()){
if (m_searchReady)
case CmdRemoveDir:
if (_rmdir(I18N::s2b(relPath)) != 0){
int errNo = errno;
- if (stat(I18N::s2b(relPath), &info2) == 0)
+ if (stat(I18N::s2b(relPath), &info2) == 0){
error(QObject::tr("cannot remove directory (%1): %2").arg(errNo)
.arg(relPath));
+ }
} else if (m_verboseLevel >= VerboseStandard)
m_mainWindow->addToFileList("/ " + relPath);
break;
break;
}
if (m_verboseLevel > VerboseQuiet){
- double factor = double(m_processedFiles) / max(1, m_hotFiles);
+ double factor = double(processedFiles) / max(1, hotFiles);
qint64 duration = QDateTime::currentMSecsSinceEpoch() - start.toMSecsSinceEpoch();
m_mainWindow->externalAppend(ReGuiQueueItem::StatusLine, NULL,
- tr("%1 of %2 (%3 of %4) %5 MB/sec runtime: %6")
- .arg(m_processedFiles)
- .arg(m_hotFiles)
- .arg(ReQStringUtils::readableSize(m_processedBytes))
- .arg(ReQStringUtils::readableSize(m_hotBytes))
- .arg(m_processedBytes / 1024.0 / 1024 * 1000
- / max(1.0, (double) duration), 0, 'f', 3)
+ tr("%1 of %2 files %3 files/sec runtime: %6")
+ .arg(processedFiles)
+ .arg(hotFiles)
+ .arg(processedFiles * 1000.0 / max(1.0, (double) duration), 0, 'f', 3)
.arg(ReQStringUtils::runtimeEstimation(start, factor)));
}
}
m_mutex.lock();
m_files.append(info);
m_matchedFiles++;
+ m_hotFiles++;
m_mutex.unlock();
}
return isEmpty;