mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Remove misc::safeRemove(): shouldn't be needed
This commit is contained in:
parent
60d9bfe077
commit
c25586b500
9 changed files with 45 additions and 50 deletions
|
@ -101,7 +101,7 @@ void GeoIPManager::exportEmbeddedDb() {
|
||||||
}
|
}
|
||||||
// Remove destination files
|
// Remove destination files
|
||||||
if(QFile::exists(geoipDBpath(false)))
|
if(QFile::exists(geoipDBpath(false)))
|
||||||
misc::safeRemove(geoipDBpath(false));
|
QFile::remove(geoipDBpath(false));
|
||||||
// Copy from executable to hard disk
|
// Copy from executable to hard disk
|
||||||
qDebug("%s -> %s", qPrintable(geoipDBpath(true)), qPrintable(geoipDBpath(false)));
|
qDebug("%s -> %s", qPrintable(geoipDBpath(true)), qPrintable(geoipDBpath(false)));
|
||||||
if(!QFile::copy(geoipDBpath(true), geoipDBpath(false))) {
|
if(!QFile::copy(geoipDBpath(true), geoipDBpath(false))) {
|
||||||
|
|
|
@ -509,7 +509,7 @@ void misc::copyDir(QString src_path, QString dst_path) {
|
||||||
// Copy the file from src to dest
|
// Copy the file from src to dest
|
||||||
QFile::copy(src_child_path, dest_child_path);
|
QFile::copy(src_child_path, dest_child_path);
|
||||||
// Remove source file
|
// Remove source file
|
||||||
safeRemove(src_child_path);
|
QFile::remove(src_child_path);
|
||||||
}
|
}
|
||||||
// Remove source folder
|
// Remove source folder
|
||||||
const QString dir_name = sourceDir.dirName();
|
const QString dir_name = sourceDir.dirName();
|
||||||
|
|
|
@ -93,15 +93,6 @@ public:
|
||||||
static void shutdownComputer(bool sleep=false);
|
static void shutdownComputer(bool sleep=false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool safeRemove(QString file_path) {
|
|
||||||
QFile MyFile(file_path);
|
|
||||||
if(!MyFile.exists()) return true;
|
|
||||||
// Make sure the permissions are ok
|
|
||||||
MyFile.setPermissions(MyFile.permissions()|QFile::ReadOwner|QFile::WriteOwner|QFile::ReadUser|QFile::WriteUser);
|
|
||||||
// Actually remove the file
|
|
||||||
return MyFile.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
static QString parseHtmlLinks(const QString &raw_text);
|
static QString parseHtmlLinks(const QString &raw_text);
|
||||||
|
|
||||||
static bool removeEmptyFolder(const QString &dirpath);
|
static bool removeEmptyFolder(const QString &dirpath);
|
||||||
|
|
|
@ -793,7 +793,7 @@ void QBtSession::deleteTorrent(const QString &hash, bool delete_local_files) {
|
||||||
// Remove unneeded and incomplete files
|
// Remove unneeded and incomplete files
|
||||||
foreach(const QString &uneeded_file, uneeded_files) {
|
foreach(const QString &uneeded_file, uneeded_files) {
|
||||||
qDebug("Removing uneeded file: %s", qPrintable(uneeded_file));
|
qDebug("Removing uneeded file: %s", qPrintable(uneeded_file));
|
||||||
misc::safeRemove(uneeded_file);
|
QFile::remove(uneeded_file);
|
||||||
const QString parent_folder = misc::branchPath(uneeded_file);
|
const QString parent_folder = misc::branchPath(uneeded_file);
|
||||||
qDebug("Attempt to remove parent folder (if empty): %s", qPrintable(parent_folder));
|
qDebug("Attempt to remove parent folder (if empty): %s", qPrintable(parent_folder));
|
||||||
misc::removeEmptyFolder(parent_folder);
|
misc::removeEmptyFolder(parent_folder);
|
||||||
|
@ -805,7 +805,7 @@ void QBtSession::deleteTorrent(const QString &hash, bool delete_local_files) {
|
||||||
filters << hash+".*";
|
filters << hash+".*";
|
||||||
const QStringList files = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted);
|
const QStringList files = torrentBackup.entryList(filters, QDir::Files, QDir::Unsorted);
|
||||||
foreach(const QString &file, files) {
|
foreach(const QString &file, files) {
|
||||||
misc::safeRemove(torrentBackup.absoluteFilePath(file));
|
QFile::remove(torrentBackup.absoluteFilePath(file));
|
||||||
}
|
}
|
||||||
TorrentPersistentData::deletePersistentData(hash);
|
TorrentPersistentData::deletePersistentData(hash);
|
||||||
// Remove tracker errors
|
// Remove tracker errors
|
||||||
|
@ -1005,7 +1005,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
|
||||||
addConsoleMessage(tr("Unable to decode torrent file: '%1'", "e.g: Unable to decode torrent file: '/home/y/xxx.torrent'").arg(from_url), QString::fromUtf8("red"));
|
addConsoleMessage(tr("Unable to decode torrent file: '%1'", "e.g: Unable to decode torrent file: '/home/y/xxx.torrent'").arg(from_url), QString::fromUtf8("red"));
|
||||||
addConsoleMessage(QString::fromLocal8Bit(e.what()), "red");
|
addConsoleMessage(QString::fromLocal8Bit(e.what()), "red");
|
||||||
//emit invalidTorrent(from_url);
|
//emit invalidTorrent(from_url);
|
||||||
misc::safeRemove(path);
|
QFile::remove(path);
|
||||||
}else{
|
}else{
|
||||||
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
#if defined(Q_WS_WIN) || defined(Q_OS_OS2)
|
||||||
QString displayed_path = path;
|
QString displayed_path = path;
|
||||||
|
@ -1019,7 +1019,7 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
|
||||||
addConsoleMessage(tr("This file is either corrupted or this isn't a torrent."),QString::fromUtf8("red"));
|
addConsoleMessage(tr("This file is either corrupted or this isn't a torrent."),QString::fromUtf8("red"));
|
||||||
if(fromScanDir) {
|
if(fromScanDir) {
|
||||||
// Remove file
|
// Remove file
|
||||||
misc::safeRemove(path);
|
QFile::remove(path);
|
||||||
}
|
}
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
@ -1050,7 +1050,8 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
|
||||||
mergeTorrents(h_ex, t);
|
mergeTorrents(h_ex, t);
|
||||||
|
|
||||||
// Delete file if temporary
|
// Delete file if temporary
|
||||||
if(!from_url.isNull() || fromScanDir) misc::safeRemove(path);
|
if(!from_url.isNull() || fromScanDir)
|
||||||
|
QFile::remove(path);
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1058,7 +1059,8 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
|
||||||
if(t->num_files() < 1) {
|
if(t->num_files() < 1) {
|
||||||
addConsoleMessage(tr("Error: The torrent %1 does not contain any file.").arg(misc::toQStringU(t->name())));
|
addConsoleMessage(tr("Error: The torrent %1 does not contain any file.").arg(misc::toQStringU(t->name())));
|
||||||
// Delete file if temporary
|
// Delete file if temporary
|
||||||
if(!from_url.isNull() || fromScanDir) misc::safeRemove(path);
|
if(!from_url.isNull() || fromScanDir)
|
||||||
|
QFile::remove(path);
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1135,7 +1137,8 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
|
||||||
// Check if it worked
|
// Check if it worked
|
||||||
if(!h.is_valid()) {
|
if(!h.is_valid()) {
|
||||||
qDebug("/!\\ Error: Invalid handle");
|
qDebug("/!\\ Error: Invalid handle");
|
||||||
if(!from_url.isNull()) misc::safeRemove(path);
|
if(!from_url.isNull())
|
||||||
|
QFile::remove(path);
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
// Remember root folder
|
// Remember root folder
|
||||||
|
@ -1180,7 +1183,8 @@ QTorrentHandle QBtSession::addTorrent(QString path, bool fromScanDir, QString fr
|
||||||
}
|
}
|
||||||
|
|
||||||
// If temporary file, remove it
|
// If temporary file, remove it
|
||||||
if(!from_url.isNull() || fromScanDir) misc::safeRemove(path);
|
if(!from_url.isNull() || fromScanDir)
|
||||||
|
QFile::remove(path);
|
||||||
|
|
||||||
// Display console message
|
// Display console message
|
||||||
if(!from_url.isNull()) {
|
if(!from_url.isNull()) {
|
||||||
|
@ -1496,7 +1500,7 @@ void QBtSession::loadSessionState() {
|
||||||
if(!QFile::exists(state_path)) return;
|
if(!QFile::exists(state_path)) return;
|
||||||
if(QFile(state_path).size() == 0) {
|
if(QFile(state_path).size() == 0) {
|
||||||
// Remove empty invalid state file
|
// Remove empty invalid state file
|
||||||
misc::safeRemove(state_path);
|
QFile::remove(state_path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#if LIBTORRENT_VERSION_MINOR > 14
|
||||||
|
@ -1700,7 +1704,7 @@ void QBtSession::saveFastResumeData() {
|
||||||
const QString filepath = torrentBackup.absoluteFilePath(h.hash()+".fastresume");
|
const QString filepath = torrentBackup.absoluteFilePath(h.hash()+".fastresume");
|
||||||
QFile resume_file(filepath);
|
QFile resume_file(filepath);
|
||||||
if(resume_file.exists())
|
if(resume_file.exists())
|
||||||
misc::safeRemove(filepath);
|
QFile::remove(filepath);
|
||||||
if(!out.empty() && resume_file.open(QIODevice::WriteOnly)) {
|
if(!out.empty() && resume_file.open(QIODevice::WriteOnly)) {
|
||||||
resume_file.write(&out[0], out.size());
|
resume_file.write(&out[0], out.size());
|
||||||
resume_file.close();
|
resume_file.close();
|
||||||
|
@ -2302,7 +2306,7 @@ void QBtSession::readAlerts() {
|
||||||
const QString filepath = torrentBackup.absoluteFilePath(h.hash()+".fastresume");
|
const QString filepath = torrentBackup.absoluteFilePath(h.hash()+".fastresume");
|
||||||
QFile resume_file(filepath);
|
QFile resume_file(filepath);
|
||||||
if(resume_file.exists())
|
if(resume_file.exists())
|
||||||
misc::safeRemove(filepath);
|
QFile::remove(filepath);
|
||||||
qDebug("Saving fastresume data in %s", qPrintable(filepath));
|
qDebug("Saving fastresume data in %s", qPrintable(filepath));
|
||||||
vector<char> out;
|
vector<char> out;
|
||||||
bencode(back_inserter(out), *p->resume_data);
|
bencode(back_inserter(out), *p->resume_data);
|
||||||
|
|
|
@ -60,7 +60,7 @@ RssFeed::~RssFeed(){
|
||||||
saveItemsToDisk();
|
saveItemsToDisk();
|
||||||
}
|
}
|
||||||
if(!m_icon.startsWith(":/") && QFile::exists(m_icon))
|
if(!m_icon.startsWith(":/") && QFile::exists(m_icon))
|
||||||
misc::safeRemove(m_icon);
|
QFile::remove(m_icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RssFeed::saveItemsToDisk() {
|
void RssFeed::saveItemsToDisk() {
|
||||||
|
|
|
@ -243,8 +243,8 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
|
||||||
if(QFile::exists(dest_path)) {
|
if(QFile::exists(dest_path)) {
|
||||||
// Backup in case install fails
|
// Backup in case install fails
|
||||||
QFile::copy(dest_path, dest_path+".bak");
|
QFile::copy(dest_path, dest_path+".bak");
|
||||||
misc::safeRemove(dest_path);
|
QFile::remove(dest_path);
|
||||||
misc::safeRemove(dest_path+"c");
|
QFile::remove(dest_path+"c");
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
// Copy the plugin
|
// Copy the plugin
|
||||||
|
@ -255,22 +255,22 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
|
||||||
if(!supported_engines->contains(plugin_name)) {
|
if(!supported_engines->contains(plugin_name)) {
|
||||||
if(update) {
|
if(update) {
|
||||||
// Remove broken file
|
// Remove broken file
|
||||||
misc::safeRemove(dest_path);
|
QFile::remove(dest_path);
|
||||||
// restore backup
|
// restore backup
|
||||||
QFile::copy(dest_path+".bak", dest_path);
|
QFile::copy(dest_path+".bak", dest_path);
|
||||||
misc::safeRemove(dest_path+".bak");
|
QFile::remove(dest_path+".bak");
|
||||||
QMessageBox::warning(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin could not be updated, keeping old version.", "%1 is the name of the search engine").arg(plugin_name));
|
QMessageBox::warning(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin could not be updated, keeping old version.", "%1 is the name of the search engine").arg(plugin_name));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Remove broken file
|
// Remove broken file
|
||||||
misc::safeRemove(dest_path);
|
QFile::remove(dest_path);
|
||||||
QMessageBox::warning(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin could not be installed.", "%1 is the name of the search engine").arg(plugin_name));
|
QMessageBox::warning(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin could not be installed.", "%1 is the name of the search engine").arg(plugin_name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Install was successful, remove backup
|
// Install was successful, remove backup
|
||||||
if(update) {
|
if(update) {
|
||||||
misc::safeRemove(dest_path+".bak");
|
QFile::remove(dest_path+".bak");
|
||||||
}
|
}
|
||||||
if(update) {
|
if(update) {
|
||||||
QMessageBox::information(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin was successfully updated.", "%1 is the name of the search engine").arg(plugin_name));
|
QMessageBox::information(this, tr("Search plugin install")+" -- "+tr("qBittorrent"), tr("%1 search engine plugin was successfully updated.", "%1 is the name of the search engine").arg(plugin_name));
|
||||||
|
@ -388,7 +388,7 @@ bool engineSelectDlg::parseVersionsFile(QString versions_file) {
|
||||||
// Close file
|
// Close file
|
||||||
versions.close();
|
versions.close();
|
||||||
// Clean up tmp file
|
// Clean up tmp file
|
||||||
misc::safeRemove(versions_file);
|
QFile::remove(versions_file);
|
||||||
if(file_correct && !updated) {
|
if(file_correct && !updated) {
|
||||||
QMessageBox::information(this, tr("Search plugin update")+" -- "+tr("qBittorrent"), tr("All your plugins are already up to date."));
|
QMessageBox::information(this, tr("Search plugin update")+" -- "+tr("qBittorrent"), tr("All your plugins are already up to date."));
|
||||||
}
|
}
|
||||||
|
@ -418,21 +418,21 @@ void engineSelectDlg::processDownloadedFile(QString url, QString filePath) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Delete tmp file
|
// Delete tmp file
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(url.endsWith("versions.txt")) {
|
if(url.endsWith("versions.txt")) {
|
||||||
if(!parseVersionsFile(filePath)) {
|
if(!parseVersionsFile(filePath)) {
|
||||||
QMessageBox::warning(this, tr("Search plugin update")+" -- "+tr("qBittorrent"), tr("Sorry, update server is temporarily unavailable."));
|
QMessageBox::warning(this, tr("Search plugin update")+" -- "+tr("qBittorrent"), tr("Sorry, update server is temporarily unavailable."));
|
||||||
}
|
}
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(url.endsWith(".py", Qt::CaseInsensitive)) {
|
if(url.endsWith(".py", Qt::CaseInsensitive)) {
|
||||||
QString plugin_name = misc::fileName(url);
|
QString plugin_name = misc::fileName(url);
|
||||||
plugin_name.chop(3); // Remove extension
|
plugin_name.chop(3); // Remove extension
|
||||||
installPlugin(filePath, plugin_name);
|
installPlugin(filePath, plugin_name);
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,7 +168,7 @@ void SearchEngine::pythonDownloadSuccess(QString url, QString file_path) {
|
||||||
on_search_button_clicked();
|
on_search_button_clicked();
|
||||||
}
|
}
|
||||||
// Delete temp file
|
// Delete temp file
|
||||||
misc::safeRemove(file_path+".msi");
|
QFile::remove(file_path+".msi");
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchEngine::pythonDownloadFailure(QString url, QString error) {
|
void SearchEngine::pythonDownloadFailure(QString url, QString error) {
|
||||||
|
@ -500,8 +500,8 @@ void SearchEngine::updateNova() {
|
||||||
QString filePath = search_dir.absoluteFilePath("nova2.py");
|
QString filePath = search_dir.absoluteFilePath("nova2.py");
|
||||||
if(getPluginVersion(":/"+nova_folder+"/nova2.py") > getPluginVersion(filePath)) {
|
if(getPluginVersion(":/"+nova_folder+"/nova2.py") > getPluginVersion(filePath)) {
|
||||||
if(QFile::exists(filePath)) {
|
if(QFile::exists(filePath)) {
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
misc::safeRemove(filePath+"c");
|
QFile::remove(filePath+"c");
|
||||||
}
|
}
|
||||||
QFile::copy(":/"+nova_folder+"/nova2.py", filePath);
|
QFile::copy(":/"+nova_folder+"/nova2.py", filePath);
|
||||||
}
|
}
|
||||||
|
@ -509,8 +509,8 @@ void SearchEngine::updateNova() {
|
||||||
filePath = search_dir.absoluteFilePath("nova2dl.py");
|
filePath = search_dir.absoluteFilePath("nova2dl.py");
|
||||||
if(getPluginVersion(":/"+nova_folder+"/nova2dl.py") > getPluginVersion(filePath)) {
|
if(getPluginVersion(":/"+nova_folder+"/nova2dl.py") > getPluginVersion(filePath)) {
|
||||||
if(QFile::exists(filePath)){
|
if(QFile::exists(filePath)){
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
misc::safeRemove(filePath+"c");
|
QFile::remove(filePath+"c");
|
||||||
}
|
}
|
||||||
QFile::copy(":/"+nova_folder+"/nova2dl.py", filePath);
|
QFile::copy(":/"+nova_folder+"/nova2dl.py", filePath);
|
||||||
}
|
}
|
||||||
|
@ -518,8 +518,8 @@ void SearchEngine::updateNova() {
|
||||||
filePath = search_dir.absoluteFilePath("novaprinter.py");
|
filePath = search_dir.absoluteFilePath("novaprinter.py");
|
||||||
if(getPluginVersion(":/"+nova_folder+"/novaprinter.py") > getPluginVersion(filePath)) {
|
if(getPluginVersion(":/"+nova_folder+"/novaprinter.py") > getPluginVersion(filePath)) {
|
||||||
if(QFile::exists(filePath)){
|
if(QFile::exists(filePath)){
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
misc::safeRemove(filePath+"c");
|
QFile::remove(filePath+"c");
|
||||||
}
|
}
|
||||||
QFile::copy(":/"+nova_folder+"/novaprinter.py", filePath);
|
QFile::copy(":/"+nova_folder+"/novaprinter.py", filePath);
|
||||||
}
|
}
|
||||||
|
@ -527,24 +527,24 @@ void SearchEngine::updateNova() {
|
||||||
filePath = search_dir.absoluteFilePath("helpers.py");
|
filePath = search_dir.absoluteFilePath("helpers.py");
|
||||||
if(getPluginVersion(":/"+nova_folder+"/helpers.py") > getPluginVersion(filePath)) {
|
if(getPluginVersion(":/"+nova_folder+"/helpers.py") > getPluginVersion(filePath)) {
|
||||||
if(QFile::exists(filePath)){
|
if(QFile::exists(filePath)){
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
misc::safeRemove(filePath+"c");
|
QFile::remove(filePath+"c");
|
||||||
}
|
}
|
||||||
QFile::copy(":/"+nova_folder+"/helpers.py", filePath);
|
QFile::copy(":/"+nova_folder+"/helpers.py", filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
filePath = search_dir.absoluteFilePath("socks.py");
|
filePath = search_dir.absoluteFilePath("socks.py");
|
||||||
if(QFile::exists(filePath)){
|
if(QFile::exists(filePath)){
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
misc::safeRemove(filePath+"c");
|
QFile::remove(filePath+"c");
|
||||||
}
|
}
|
||||||
QFile::copy(":/"+nova_folder+"/socks.py", filePath);
|
QFile::copy(":/"+nova_folder+"/socks.py", filePath);
|
||||||
|
|
||||||
if (nova_folder == "nova3") {
|
if (nova_folder == "nova3") {
|
||||||
filePath = search_dir.absoluteFilePath("sgmllib3.py");
|
filePath = search_dir.absoluteFilePath("sgmllib3.py");
|
||||||
if(QFile::exists(filePath)){
|
if(QFile::exists(filePath)){
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
misc::safeRemove(filePath+"c");
|
QFile::remove(filePath+"c");
|
||||||
}
|
}
|
||||||
QFile::copy(":/"+nova_folder+"/sgmllib3.py", filePath);
|
QFile::copy(":/"+nova_folder+"/sgmllib3.py", filePath);
|
||||||
}
|
}
|
||||||
|
@ -560,8 +560,8 @@ void SearchEngine::updateNova() {
|
||||||
qDebug("shipped %s is more recent then local plugin, updating...", qPrintable(file));
|
qDebug("shipped %s is more recent then local plugin, updating...", qPrintable(file));
|
||||||
if(QFile::exists(dest_file)) {
|
if(QFile::exists(dest_file)) {
|
||||||
qDebug("Removing old %s", qPrintable(dest_file));
|
qDebug("Removing old %s", qPrintable(dest_file));
|
||||||
misc::safeRemove(dest_file);
|
QFile::remove(dest_file);
|
||||||
misc::safeRemove(dest_file+"c");
|
QFile::remove(dest_file+"c");
|
||||||
}
|
}
|
||||||
qDebug("%s copied to %s", qPrintable(shipped_file), qPrintable(dest_file));
|
qDebug("%s copied to %s", qPrintable(shipped_file), qPrintable(dest_file));
|
||||||
QFile::copy(shipped_file, dest_file);
|
QFile::copy(shipped_file, dest_file);
|
||||||
|
|
|
@ -258,7 +258,7 @@ void torrentAdditionDialog::showLoad(QString filePath, QString from_url) {
|
||||||
qDebug("Caught error loading torrent");
|
qDebug("Caught error loading torrent");
|
||||||
if(!from_url.isNull()){
|
if(!from_url.isNull()){
|
||||||
QBtSession::instance()->addConsoleMessage(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
QBtSession::instance()->addConsoleMessage(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+from_url+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
misc::safeRemove(filePath);
|
QFile::remove(filePath);
|
||||||
}else{
|
}else{
|
||||||
QBtSession::instance()->addConsoleMessage(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
QBtSession::instance()->addConsoleMessage(tr("Unable to decode torrent file:")+QString::fromUtf8(" '")+filePath+QString::fromUtf8("'"), QString::fromUtf8("red"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ void TorrentCreatorThread::create(QString _input_path, QString _save_path, QStri
|
||||||
input_path = _input_path;
|
input_path = _input_path;
|
||||||
save_path = _save_path;
|
save_path = _save_path;
|
||||||
if(QFile(save_path).exists())
|
if(QFile(save_path).exists())
|
||||||
misc::safeRemove(save_path);
|
QFile::remove(save_path);
|
||||||
trackers = _trackers;
|
trackers = _trackers;
|
||||||
url_seeds = _url_seeds;
|
url_seeds = _url_seeds;
|
||||||
comment = _comment;
|
comment = _comment;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue