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;
|
bool useTemporaryFolder() const;
|
||||||
QString getDefaultSavePath() const;
|
QString getDefaultSavePath() const;
|
||||||
ScanFoldersModel* getScanFoldersModel() const;
|
ScanFoldersModel* getScanFoldersModel() const;
|
||||||
|
#if LIBTORRENT_VERSION_MINOR < 15
|
||||||
|
void saveDHTEntry();
|
||||||
|
#endif
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
QTorrentHandle addTorrent(QString path, bool fromScanDir = false, QString from_url = QString(), bool resumed = false);
|
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 resumeTorrent(QString hash);
|
||||||
void resumeAllTorrents();
|
void resumeAllTorrents();
|
||||||
/* End Web UI */
|
/* End Web UI */
|
||||||
#if LIBTORRENT_VERSION_MINOR < 15
|
|
||||||
void saveDHTEntry();
|
|
||||||
#endif
|
|
||||||
void preAllocateAllFiles(bool b);
|
void preAllocateAllFiles(bool b);
|
||||||
void saveFastResumeData();
|
void saveFastResumeData();
|
||||||
void enableIPFilter(QString filter);
|
void enableIPFilter(QString filter);
|
||||||
|
@ -68,7 +68,7 @@ createtorrent::createtorrent(QWidget *parent): QDialog(parent){
|
|||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
setModal(true);
|
setModal(true);
|
||||||
creatorThread = new torrentCreatorThread(this);
|
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(creationFailure(QString)), this, SLOT(handleCreationFailure(QString)));
|
||||||
connect(creatorThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgressBar(int)));
|
connect(creatorThread, SIGNAL(updateProgress(int)), this, SLOT(updateProgressBar(int)));
|
||||||
path::default_name_check(no_check);
|
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));
|
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()) {
|
if(checkStartSeeding->isChecked()) {
|
||||||
// Create save path temp data
|
// Create save path temp data
|
||||||
boost::intrusive_ptr<torrent_info> t;
|
boost::intrusive_ptr<torrent_info> t;
|
||||||
@ -208,7 +208,7 @@ void createtorrent::handleCreationSuccess(QString path, const char* branch_path)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QString hash = misc::toQString(t->info_hash());
|
QString hash = misc::toQString(t->info_hash());
|
||||||
TorrentTempData::setSavePath(hash, QString::fromLocal8Bit(branch_path));
|
TorrentTempData::setSavePath(hash, branch_path);
|
||||||
#if LIBTORRENT_VERSION_MINOR > 14
|
#if LIBTORRENT_VERSION_MINOR > 14
|
||||||
// Enable seeding mode (do not recheck the files)
|
// Enable seeding mode (do not recheck the files)
|
||||||
TorrentTempData::setSeedingMode(hash, true);
|
TorrentTempData::setSeedingMode(hash, true);
|
||||||
@ -281,7 +281,7 @@ void torrentCreatorThread::run() {
|
|||||||
ofstream out(complete(path((const char*)save_path.toLocal8Bit())), std::ios_base::binary);
|
ofstream out(complete(path((const char*)save_path.toLocal8Bit())), std::ios_base::binary);
|
||||||
bencode(std::ostream_iterator<char>(out), t.generate());
|
bencode(std::ostream_iterator<char>(out), t.generate());
|
||||||
emit updateProgress(100);
|
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){
|
catch (std::exception& e){
|
||||||
emit creationFailure(QString::fromUtf8(e.what()));
|
emit creationFailure(QString::fromUtf8(e.what()));
|
||||||
|
@ -64,7 +64,7 @@ class torrentCreatorThread : public QThread {
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void creationFailure(QString msg);
|
void creationFailure(QString msg);
|
||||||
void creationSuccess(QString path, const char* branch_path);
|
void creationSuccess(QString path, QString branch_path);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void updateProgress(int progress);
|
void updateProgress(int progress);
|
||||||
@ -97,7 +97,7 @@ class createtorrent : public QDialog, private Ui::createTorrentDialog{
|
|||||||
void on_addURLSeed_button_clicked();
|
void on_addURLSeed_button_clicked();
|
||||||
void on_removeURLSeed_button_clicked();
|
void on_removeURLSeed_button_clicked();
|
||||||
void handleCreationFailure(QString msg);
|
void handleCreationFailure(QString msg);
|
||||||
void handleCreationSuccess(QString path, const char* branch_path);
|
void handleCreationSuccess(QString path, QString branch_path);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user