mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-09 05:14:23 +00:00
This commit is contained in:
parent
36f894d0d8
commit
a8d2590a4c
@ -203,13 +203,13 @@ bool AddNewTorrentDialog::loadTorrent(const QString &torrentPath)
|
|||||||
m_filePath = torrentPath;
|
m_filePath = torrentPath;
|
||||||
|
|
||||||
if (!QFile::exists(m_filePath)) {
|
if (!QFile::exists(m_filePath)) {
|
||||||
MessageBoxRaised::critical(0, tr("I/O Error"), tr("The torrent file does not exist."));
|
MessageBoxRaised::critical(0, tr("I/O Error"), tr("The torrent file '%1' does not exist.").arg(Utils::Fs::toNativePath(m_filePath)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QFileInfo fileinfo(m_filePath);
|
QFileInfo fileinfo(m_filePath);
|
||||||
if (!fileinfo.isReadable()) {
|
if (!fileinfo.isReadable()) {
|
||||||
MessageBoxRaised::critical(0, tr("I/O Error"), tr("The torrent file cannot be read from the disk. Probably you don't have enough permissions."));
|
MessageBoxRaised::critical(0, tr("I/O Error"), tr("The torrent file '%1' cannot be read from the disk. Probably you don't have enough permissions.").arg(Utils::Fs::toNativePath(m_filePath)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ bool AddNewTorrentDialog::loadTorrent(const QString &torrentPath)
|
|||||||
QString error;
|
QString error;
|
||||||
m_torrentInfo = BitTorrent::TorrentInfo::loadFromFile(m_filePath, error);
|
m_torrentInfo = BitTorrent::TorrentInfo::loadFromFile(m_filePath, error);
|
||||||
if (!m_torrentInfo.isValid()) {
|
if (!m_torrentInfo.isValid()) {
|
||||||
MessageBoxRaised::critical(0, tr("Invalid torrent"), tr("Failed to load the torrent: %1").arg(error));
|
MessageBoxRaised::critical(0, tr("Invalid torrent"), tr("Failed to load the torrent: %1.\nError: %2", "Don't remove the '\n' characters. They insert a newline.").arg(Utils::Fs::toNativePath(m_filePath)).arg(error));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user