From 6b908cfef4d550e275d854a7bb20d95015881821 Mon Sep 17 00:00:00 2001 From: Hamatoma Date: Wed, 17 Feb 2016 20:50:06 +0100 Subject: [PATCH] rebackgui: windows specific errors, program icon --- appl/rebackgui/BackupEngine.cpp | 29 ++++++++++++++++++++++++----- appl/rebackgui/mainwindow.cpp | 2 +- appl/rebackgui/rebackgui.pro | 2 +- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/appl/rebackgui/BackupEngine.cpp b/appl/rebackgui/BackupEngine.cpp index 55d5e50..f9fe13a 100644 --- a/appl/rebackgui/BackupEngine.cpp +++ b/appl/rebackgui/BackupEngine.cpp @@ -609,6 +609,14 @@ void SearchTask::run() .arg(ReQStringUtils::readableDuration( QDateTime::currentMSecsSinceEpoch() - start))); } +void checkInfo(const QString& info){ + int ix = info.indexOf('\t') + 1; + if (ix > 0 && ix < info.length() && info.at(ix) > ' '){ + QChar cc = info.at(ix); + ix++; + } +} + /** * Search the files to backup and write it to a list. * @@ -673,7 +681,7 @@ void SearchTask::searchOneDirectory(const QString& source, if (doTransfer){ info = prefix + it.fileName(); } - m_mutex.lock(); + m_mutex.lock(); if (doTransfer){ m_files.append(info); m_hotFiles++; @@ -764,6 +772,9 @@ bool SearchTargetTask::removeOlder(const QString& directory, const QDateTime& ti isEmpty = false; info = QChar(MAX_INDEX) + ReFileUtils::nativePath(it.filePath()) + m_separatorString + QChar(CmdRemove); +#if defined _DEBUG + checkInfo(info); +#endif m_mutex.lock(); m_files.append(info); m_hotFiles++; @@ -779,7 +790,10 @@ bool SearchTargetTask::removeOlder(const QString& directory, const QDateTime& ti m_mainWindow->addToFileList("x " + directory); info = QChar(MAX_INDEX) + directory + m_separatorString + QChar(CmdRemoveDir); - m_mutex.lock(); +#if defined _DEBUG + checkInfo(info); +#endif + m_mutex.lock(); m_files.append(info); m_matchedFiles++; m_hotFiles++; @@ -839,7 +853,10 @@ void SearchTargetTask::searchOneDirectory(const QString& target, info = prefix + QChar(command) + it.fileName(); } } - m_mutex.lock(); +#if defined _DEBUG + checkInfo(info); +#endif + m_mutex.lock(); if (command != CmdUndef){ m_files.append(info); m_hotFiles++; @@ -881,10 +898,12 @@ void SearchTargetTask::searchOneDirectory(const QString& target, */ void SearchTargetTask::moveToShadow(const QString& target, const QString& relPath, int index){ QString shadowDir = m_shadowDirs.at(index) + relPath; - if (! ReFileUtils::makeDirWithParents(shadowDir)) + ReQStringUtils::chomp(shadowDir, OS_SEPARATOR); + if (! ReFileUtils::makeDirWithParents(shadowDir)){ + error(QObject::tr("cannot create shadow directory (%1): %2") .arg(errno).arg(shadowDir)); - else { + } else { QString shadow = shadowDir + ReFileUtils::nodeOf(target); if (rename(I18N::s2b(target).constData(), I18N::s2b(shadow).constData()) != 0){ error(QObject::tr("cannot move to shadow directory (%1): %2 -> %3") diff --git a/appl/rebackgui/mainwindow.cpp b/appl/rebackgui/mainwindow.cpp index 8864610..2ab0460 100644 --- a/appl/rebackgui/mainwindow.cpp +++ b/appl/rebackgui/mainwindow.cpp @@ -13,7 +13,7 @@ #include "aboutdialog.hpp" #include -const QString VERSION("2016.02.16"); +const QString VERSION("2016.02.17"); /** * Constructor. diff --git a/appl/rebackgui/rebackgui.pro b/appl/rebackgui/rebackgui.pro index 7a982b0..8051f80 100644 --- a/appl/rebackgui/rebackgui.pro +++ b/appl/rebackgui/rebackgui.pro @@ -12,7 +12,7 @@ TARGET = rebackgui TEMPLATE = app INCLUDEPATH = ../.. -win32:RC_ICONS += rebackgui.ico +RC_ICONS = rebackgui.ico SOURCES += main.cpp\ ../../base/ReException.cpp \ -- 2.39.5