diff --git a/src/bittorrent.h b/src/bittorrent.h index 1de0c6161..12203126e 100644 --- a/src/bittorrent.h +++ b/src/bittorrent.h @@ -118,6 +118,9 @@ public: bool useTemporaryFolder() const; QString getDefaultSavePath() const; ScanFoldersModel* getScanFoldersModel() const; +#if LIBTORRENT_VERSION_MINOR < 15 + void saveDHTEntry(); +#endif public slots: QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false); @@ -136,9 +139,6 @@ public slots: void resumeTorrent(QString hash); void resumeAllTorrents(); /* End Web UI */ -#if LIBTORRENT_VERSION_MINOR < 15 - void saveDHTEntry(); -#endif void preAllocateAllFiles(bool b); void saveFastResumeData(); void enableIPFilter(QString filter); diff --git a/src/createtorrent_imp.cpp b/src/createtorrent_imp.cpp index 17ae24ed0..b336ad46a 100644 --- a/src/createtorrent_imp.cpp +++ b/src/createtorrent_imp.cpp @@ -68,7 +68,7 @@ createtorrent::createtorrent(QWidget *parent): QDialog(parent){ setAttribute(Qt::WA_DeleteOnClose); setModal(true); creatorThread = new torrentCreatorThread(this); - connect(creatorThread, SIGNAL(creationSuccess(QString, const char*)), this, SLOT(handleCreationSuccess(QString, const char*))); + connect(creatorThread, SIGNAL(creationSuccess(QString, QString)), this, SLOT(handleCreationSuccess(QString, QString))); connect(creatorThread, SIGNAL(creationFailure(QString)), this, SLOT(handleCreationFailure(QString))); connect(creatorThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgressBar(int))); path::default_name_check(no_check); @@ -197,7 +197,7 @@ void createtorrent::handleCreationFailure(QString msg) { QMessageBox::information(0, tr("Torrent creation"), tr("Torrent creation was unsuccessful, reason: %1").arg(msg)); } -void createtorrent::handleCreationSuccess(QString path, const char* branch_path) { +void createtorrent::handleCreationSuccess(QString path, QString branch_path) { if(checkStartSeeding->isChecked()) { // Create save path temp data boost::intrusive_ptr t; @@ -208,7 +208,7 @@ void createtorrent::handleCreationSuccess(QString path, const char* branch_path) return; } QString hash = misc::toQString(t->info_hash()); - TorrentTempData::setSavePath(hash, QString::fromLocal8Bit(branch_path)); + TorrentTempData::setSavePath(hash, branch_path); #if LIBTORRENT_VERSION_MINOR > 14 // Enable seeding mode (do not recheck the files) TorrentTempData::setSeedingMode(hash, true); @@ -281,7 +281,7 @@ void torrentCreatorThread::run() { ofstream out(complete(path((const char*)save_path.toLocal8Bit())), std::ios_base::binary); bencode(std::ostream_iterator(out), t.generate()); emit updateProgress(100); - emit creationSuccess(save_path, full_path.branch_path().string().c_str()); + emit creationSuccess(save_path, QString::fromUtf8(full_path.branch_path().string().c_str())); } catch (std::exception& e){ emit creationFailure(QString::fromUtf8(e.what())); diff --git a/src/createtorrent_imp.h b/src/createtorrent_imp.h index a279e68cc..76ca17c33 100644 --- a/src/createtorrent_imp.h +++ b/src/createtorrent_imp.h @@ -64,7 +64,7 @@ class torrentCreatorThread : public QThread { signals: void creationFailure(QString msg); - void creationSuccess(QString path, const char* branch_path); + void creationSuccess(QString path, QString branch_path); signals: void updateProgress(int progress); @@ -97,7 +97,7 @@ class createtorrent : public QDialog, private Ui::createTorrentDialog{ void on_addURLSeed_button_clicked(); void on_removeURLSeed_button_clicked(); void handleCreationFailure(QString msg); - void handleCreationSuccess(QString path, const char* branch_path); + void handleCreationSuccess(QString path, QString branch_path); }; #endif