Browse Source

Code clean up

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
b41aa38f39
  1. 27
      src/misc.cpp
  2. 3
      src/misc.h
  3. 6
      src/qtlibtorrent/qbtsession.cpp

27
src/misc.cpp

@ -432,33 +432,6 @@ QString misc::updateLabelInSavePath(const QString& defaultSavePath, const QStrin @@ -432,33 +432,6 @@ QString misc::updateLabelInSavePath(const QString& defaultSavePath, const QStrin
return new_save_path;
}
void misc::moveToXDGFolders() {
QDir old_qBtPath(QDir::homePath().replace("\\","/")+"/"+".qbittorrent");
if(old_qBtPath.exists()) {
// Copy BT_backup folder
const QString old_BTBackupPath = old_qBtPath.absoluteFilePath("BT_backup");
if(QDir(old_BTBackupPath).exists()) {
copyDir(old_BTBackupPath, BTBackupLocation());
}
// Copy search engine folder
const QString old_searchPath = old_qBtPath.absoluteFilePath("nova");
if(QDir(old_searchPath).exists()) {
copyDir(old_searchPath, searchEngineLocation());
}
// Copy *_state files
if(QFile::exists(old_qBtPath.absoluteFilePath("dht_state"))) {
QFile::copy(old_qBtPath.absoluteFilePath("dht_state"), QDir(cacheLocation()).absoluteFilePath("dht_state"));
safeRemove(old_qBtPath.absoluteFilePath("dht_state"));
}
if(QFile::exists(old_qBtPath.absoluteFilePath("ses_state"))) {
QFile::copy(old_qBtPath.absoluteFilePath("ses_state"), QDir(cacheLocation()).absoluteFilePath("ses_state"));
safeRemove(old_qBtPath.absoluteFilePath("ses_state"));
}
// Remove .qbittorrent folder if empty
QDir::home().rmdir(".qbittorrent");
}
}
QString misc::toValidFileSystemName(QString filename) {
qDebug("toValidFSName: %s", qPrintable(filename));
filename = filename.replace("\\", "/").trimmed();

3
src/misc.h

@ -127,9 +127,6 @@ public: @@ -127,9 +127,6 @@ public:
static bool sameFiles(const QString &path1, const QString &path2);
static void copyDir(QString src_path, QString dst_path);
// Introduced in v2.1.0 for backward compatibility
// Remove after some releases
static void moveToXDGFolders();
static QString toValidFileSystemName(QString filename);
static bool isValidFileSystemName(QString filename);

6
src/qtlibtorrent/qbtsession.cpp

@ -92,15 +92,11 @@ QBtSession::QBtSession() @@ -92,15 +92,11 @@ QBtSession::QBtSession()
#ifndef DISABLE_GUI
, geoipDBLoaded(false), resolve_countries(false)
#endif
, m_tracker(0)
{
Preferences pref;
m_tracker = 0;
// To avoid some exceptions
boost::filesystem::path::default_name_check(boost::filesystem::no_check);
// For backward compatibility
// Move .qBittorrent content to XDG folder
// TODO: Remove after some releases (introduced in v2.1.0)
misc::moveToXDGFolders();
// Creating Bittorrent session
// Check if we should spoof utorrent
QList<int> version;

Loading…
Cancel
Save