mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
Remove unused code
This commit is contained in:
parent
b43e641d21
commit
737982e92f
2 changed files with 0 additions and 31 deletions
30
src/misc.cpp
30
src/misc.cpp
|
@ -488,36 +488,6 @@ bool misc::sameFiles(const QString &path1, const QString &path2) {
|
||||||
return same;
|
return same;
|
||||||
}
|
}
|
||||||
|
|
||||||
void misc::copyDir(QString src_path, QString dst_path) {
|
|
||||||
QDir sourceDir(src_path);
|
|
||||||
if(!sourceDir.exists()) return;
|
|
||||||
// Create destination directory
|
|
||||||
QDir destDir(dst_path);
|
|
||||||
if(!destDir.exists()) {
|
|
||||||
if(!destDir.mkpath(destDir.absolutePath())) return;
|
|
||||||
}
|
|
||||||
// List source directory
|
|
||||||
const QFileInfoList content = sourceDir.entryInfoList();
|
|
||||||
foreach(const QFileInfo& child, content) {
|
|
||||||
if(child.fileName()[0] == '.') continue;
|
|
||||||
if(child.isDir()) {
|
|
||||||
copyDir(child.absoluteFilePath(), dst_path+QDir::separator()+QDir(child.absoluteFilePath()).dirName());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const QString src_child_path = child.absoluteFilePath();
|
|
||||||
const QString dest_child_path = destDir.absoluteFilePath(child.fileName());
|
|
||||||
// Copy the file from src to dest
|
|
||||||
QFile::copy(src_child_path, dest_child_path);
|
|
||||||
// Remove source file
|
|
||||||
QFile::remove(src_child_path);
|
|
||||||
}
|
|
||||||
// Remove source folder
|
|
||||||
const QString dir_name = sourceDir.dirName();
|
|
||||||
if(sourceDir.cdUp()) {
|
|
||||||
sourceDir.rmdir(dir_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void misc::chmod644(const QDir& folder) {
|
void misc::chmod644(const QDir& folder) {
|
||||||
qDebug("chmod644(%s)", qPrintable(folder.absolutePath()));
|
qDebug("chmod644(%s)", qPrintable(folder.absolutePath()));
|
||||||
if(!folder.exists()) return;
|
if(!folder.exists()) return;
|
||||||
|
|
|
@ -105,7 +105,6 @@ public:
|
||||||
|
|
||||||
static bool sameFiles(const QString &path1, const QString &path2);
|
static bool sameFiles(const QString &path1, const QString &path2);
|
||||||
static bool isUrl(const QString &s);
|
static bool isUrl(const QString &s);
|
||||||
static void copyDir(QString src_path, QString dst_path);
|
|
||||||
static QString toValidFileSystemName(QString filename);
|
static QString toValidFileSystemName(QString filename);
|
||||||
static bool isValidFileSystemName(const QString& filename);
|
static bool isValidFileSystemName(const QString& filename);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue