mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 06:02:29 -06:00
Coding style clean up
This commit is contained in:
@@ -67,7 +67,7 @@ TorrentCreatorDlg::~TorrentCreatorDlg() {
|
||||
delete creatorThread;
|
||||
}
|
||||
|
||||
void TorrentCreatorDlg::on_addFolder_button_clicked(){
|
||||
void TorrentCreatorDlg::on_addFolder_button_clicked() {
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString();
|
||||
QString dir = QFileDialog::getExistingDirectory(this, tr("Select a folder to add to the torrent"), last_path, QFileDialog::ShowDirsOnly);
|
||||
@@ -83,7 +83,7 @@ void TorrentCreatorDlg::on_addFolder_button_clicked(){
|
||||
}
|
||||
}
|
||||
|
||||
void TorrentCreatorDlg::on_addFile_button_clicked(){
|
||||
void TorrentCreatorDlg::on_addFile_button_clicked() {
|
||||
QIniSettings settings("qBittorrent", "qBittorrent");
|
||||
QString last_path = settings.value("CreateTorrent/last_add_path", QDir::homePath()).toString();
|
||||
QString file = QFileDialog::getOpenFileName(this, tr("Select a file to add to the torrent"), last_path);
|
||||
@@ -104,11 +104,11 @@ int TorrentCreatorDlg::getPieceSize() const {
|
||||
}
|
||||
|
||||
// Main function that create a .torrent file
|
||||
void TorrentCreatorDlg::on_createButton_clicked(){
|
||||
void TorrentCreatorDlg::on_createButton_clicked() {
|
||||
QString input = textInputPath->text().trimmed();
|
||||
if (input.endsWith(QDir::separator()))
|
||||
input.chop(1);
|
||||
if (input.isEmpty()){
|
||||
if (input.isEmpty()) {
|
||||
QMessageBox::critical(0, tr("No input path set"), tr("Please type an input path first"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ void TorrentCreatorThread::create(QString _input_path, QString _save_path, QStri
|
||||
start();
|
||||
}
|
||||
|
||||
void sendProgressUpdateSignal(int i, int num, TorrentCreatorThread *parent){
|
||||
void sendProgressUpdateSignal(int i, int num, TorrentCreatorThread *parent) {
|
||||
parent->sendProgressSignal((int)(i*100./(float)num));
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ void TorrentCreatorThread::run() {
|
||||
create_torrent t(fs, piece_size);
|
||||
|
||||
// Add url seeds
|
||||
foreach (const QString &seed, url_seeds){
|
||||
foreach (const QString &seed, url_seeds) {
|
||||
t.add_url_seed(seed.trimmed().toStdString());
|
||||
}
|
||||
foreach (const QString &tracker, trackers) {
|
||||
@@ -138,7 +138,7 @@ void TorrentCreatorThread::run() {
|
||||
} else {
|
||||
throw std::exception();
|
||||
}
|
||||
} catch (std::exception& e){
|
||||
} catch (std::exception& e) {
|
||||
emit creationFailure(QString::fromLocal8Bit(e.what()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user