mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Fix unicode problem in torrent creator tool
This commit is contained in:
parent
80d76ae038
commit
ca10c0ab09
@ -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);
|
||||
|
@ -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<torrent_info> 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<char>(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()));
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user