mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Allow drop action only on transfer list
Now drop action is only allowed on transfer list, previously it was on main window. Having drop action on the whole main window is not preferred because it could allow drop action on other unrelated widgets, such as execution log or RSS widget which is unexpected behavior. PR #21332.
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#include <QStringView>
|
||||
#include <QSysInfo>
|
||||
|
||||
#include "base/net/downloadmanager.h"
|
||||
#include "base/path.h"
|
||||
#include "base/unicodestrings.h"
|
||||
#include "base/utils/string.h"
|
||||
@@ -212,6 +213,14 @@ bool Utils::Misc::isPreviewable(const Path &filePath)
|
||||
return multimediaExtensions.contains(filePath.extension().toUpper());
|
||||
}
|
||||
|
||||
bool Utils::Misc::isTorrentLink(const QString &str)
|
||||
{
|
||||
return str.startsWith(u"magnet:", Qt::CaseInsensitive)
|
||||
|| str.endsWith(TORRENT_FILE_EXTENSION, Qt::CaseInsensitive)
|
||||
|| (!str.startsWith(u"file:", Qt::CaseInsensitive)
|
||||
&& Net::DownloadManager::hasSupportedScheme(str));
|
||||
}
|
||||
|
||||
QString Utils::Misc::userFriendlyDuration(const qlonglong seconds, const qlonglong maxCap, const TimeResolution resolution)
|
||||
{
|
||||
if (seconds < 0)
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace Utils::Misc
|
||||
qint64 sizeInBytes(qreal size, SizeUnit unit);
|
||||
|
||||
bool isPreviewable(const Path &filePath);
|
||||
bool isTorrentLink(const QString &str);
|
||||
|
||||
// Take a number of seconds and return a user-friendly
|
||||
// time duration like "1d 2h 10m".
|
||||
|
||||
Reference in New Issue
Block a user