}
QFileInfo sourceInfo(source);
if (m_verboseLevel >= VerboseStandard)
- m_mainWindow->addToFileList(source + " " + ReQStringUtils::readableSize(sourceInfo.size()));
+ m_mainWindow->addToFileList(target + " " + ReQStringUtils::readableSize(sourceInfo.size()));
m_mutex.lock();
m_processedFiles++;
m_processedBytes += sourceInfo.size();
QDateTime start = QDateTime::currentDateTime();
int hotFiles, processedFiles;
qint64 processedBytes, hotBytes;
+ int lastIndex = -1;
while (! m_shouldStop){
m_mutex.lock();
if (m_files.size() == 0)
relPath = info.mid(1, pos - 1);
node = info.mid(pos + 1);
if (m_searchReady){
+ if (index != lastIndex){
+ lastIndex = index;
+ m_mainWindow->setLastTarget(m_targetDirs.at(index));
+ }
m_mainWindow->setLastFile(relPath, node);
}
copyFile(index, relPath, node);
for (int ix = 0; ! m_shouldStop && ix < m_sourceDirs.size(); ix++){
sourceDir = m_sourceDirs.at(ix);
targetDir = m_targetDirs.at(ix);
+ m_mainWindow->setLastTarget(targetDir);
searchOneDirectory(targetDir, sourceDir, ix);
}
if (! m_shouldStop && ReFileUtils::isDirectory(m_shadowBaseDir)){
#include "base/retrace.hpp"
DECLARE_TRACER(s_traceMain, "/tmp/bup_main.log");
-const QString VERSION("2016.04.07");
+const QString VERSION("2016.05.17");
/**
* Constructor.
m_mutexLastFile(),
m_lastFile(""),
m_lastDirectory(""),
+ m_lastTarget(""),
m_textChangeLocked(false),
m_temporaryMounted("")
{
item.m_type = ReGuiQueueItem::Undef;
}
m_mutexLastFile.lock();
- ui->labelLastFile->setText(m_lastDirectory + m_lastFile);
+ ui->labelLastFile->setText(m_lastTarget + m_lastDirectory + m_lastFile);
m_mutexLastFile.unlock();
if (!statusMessage.isEmpty())
setStatusMessage(LOG_INFO, statusMessage);
BackupEngine::m_verboseLevel = (ReVerbose_t) index;
}
+void MainWindow::setLastTarget(const QString& lastTarget)
+{
+ m_lastTarget = lastTarget;
+}
+
+QString MainWindow::lastDirectory() const
+{
+ return m_lastDirectory;
+}
+
/**
* Reads the history of the widget values and other parameters and set it.
*/
void setLastFile(const QString& lastDir, const QString& lastFile);
void saveState();
void unmount(const QString& device);
-protected slots:
+ QString lastDirectory() const;
+ void setLastTarget(const QString& lastTarget);
+
private:
void extractTarget(const QString& dir);
void initializeGui();
QMutex m_mutexLastFile;
QString m_lastFile;
QString m_lastDirectory;
+ QString m_lastTarget;
bool m_textChangeLocked;
QString m_temporaryMounted;
};
<property name="editable">
<bool>true</bool>
</property>
+ <item>
+ <property name="text">
+ <string>*,*~,*.bak</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>*</string>
+ </property>
+ </item>
</widget>
</item>
<item>
<property name="editable">
<bool>true</bool>
</property>
+ <item>
+ <property name="text">
+ <string>*,-*cache*,*thumbnails*</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>*</string>
+ </property>
+ </item>
</widget>
</item>
</layout>
QByteArrayList lines = output.split('\n');
QString device;
QRegularExpression regExpr("^(.*?) on (.*) type ");
- QString relativePath;
QString line;
QString directory;
for (int ix = 0; ix < lines.size(); ix++){
+ if (lines[ix][0] != OS_SEPARATOR)
+ continue;
line = I18N::b2s(lines.at(ix));
QRegularExpressionMatch match = regExpr.match(line);
if (match.hasMatch()){
QString ReMountInfo::findDevice(const QString &path)
{
QString rc;
- QMap<QString, QString>::const_iterator it;
- for (it = m_deviceOfMountPoint.cbegin(); it != m_deviceOfMountPoint.cend(); ++it){
- QString path2 = *it;
- if (path.startsWith(path2) && path2 != OS_SEPARATOR_STR)
- rc = m_deviceOfMountPoint.value(path2);
+ QMapIterator<QString, QString> it(m_deviceOfMountPoint);
+ while(it.hasNext()){
+ it.next();
+ QString path2 = it.key();
+ if (path.startsWith(path2) && path2 != OS_SEPARATOR_STR){
+ rc = m_deviceOfMountPoint.value(path2);
+ break;
+ }
}
return rc;
}
const ReBlockDevice* rc = NULL;
QList<ReBlockDevice>::const_iterator it;
for (it = m_devices.cbegin(); it != m_devices.cend(); ++it){
- if ((*it).m_device == device){
+ QString dev = (*it).m_device;
+ if (dev == device){
rc = &*it;
break;
}