diff options
Diffstat (limited to 'helper.cpp')
-rw-r--r-- | helper.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -88,7 +88,7 @@ namespace Helper { return retval; } - const QString moveToArchive(const QString &path, const QString &md5){ + const QString moveToArchive(const QString &path, const QString &md5, bool copy){ QFileInfo info(path); if(!info.exists()){ return QString(); @@ -104,7 +104,12 @@ namespace Helper { if(!destDir.exists()){ QDir::root().mkpath(destFile.absolutePath()); } - bool success = QFile::rename(path, destFile.absoluteFilePath()); + bool success = false; + if(copy){ + success = QFile::copy(path, destFile.absoluteFilePath()); + }else{ + success = QFile::rename(path, destFile.absoluteFilePath()); + } if(success){ return destFile.absoluteFilePath(); } |