mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Cleanup code
Also remove redundant code, it is already handled correctly in subsequent function calls.
This commit is contained in:
parent
19d6de795c
commit
6759446639
5 changed files with 27 additions and 31 deletions
|
@ -38,7 +38,6 @@
|
|||
#include <QMimeData>
|
||||
#include <QProcess>
|
||||
#include <QPushButton>
|
||||
#include <QRegularExpression>
|
||||
#include <QScrollBar>
|
||||
#include <QShortcut>
|
||||
#include <QSplitter>
|
||||
|
@ -1628,11 +1627,7 @@ void MainWindow::showNotificationBaloon(QString title, QString msg) const
|
|||
void MainWindow::downloadFromURLList(const QStringList &urlList)
|
||||
{
|
||||
const bool useTorrentAdditionDialog = AddNewTorrentDialog::isEnabled();
|
||||
for (QString url : urlList) {
|
||||
if (((url.size() == 40) && !url.contains(QRegularExpression("[^0-9A-Fa-f]")))
|
||||
|| ((url.size() == 32) && !url.contains(QRegularExpression("[^2-7A-Za-z]"))))
|
||||
url = "magnet:?xt=urn:btih:" + url;
|
||||
|
||||
for (const QString &url : urlList) {
|
||||
if (useTorrentAdditionDialog)
|
||||
AddNewTorrentDialog::show(url, this);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue