diff options
Diffstat (limited to 'helper.cpp')
-rw-r--r-- | helper.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -77,19 +77,23 @@ namespace Helper { return retval; } - bool moveToArchive(const QString &path, const QString &md5){ + const QString moveToArchive(const QString &path, const QString &md5){ QFileInfo info(path); if(!info.exists()){ - return false; + return QString(); } QFileInfo destFile = QFileInfo(createArchivePath(path, md5)); if(destFile.exists()){ destFile = QFileInfo(createArchivePath(path, md5, true)); if(destFile.exists()){ - return false; + return QString(); } } - return QFile::rename(path, destFile.absoluteFilePath()); + bool success = QFile::rename(path, destFile.absoluteFilePath()); + if(success){ + return destFile.absoluteFilePath(); + } + return QString(); } bool removeFromArchive(const QString &fileName, const QString &md5){ @@ -113,5 +117,9 @@ namespace Helper { } return retval; } + + bool StringListContains::operator()(const QString s, const QString &part) const{ + return s.contains(part); + } } |