mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -06:00
Show error message when Session failed to start
This commit is contained in:
committed by
sledgehammer999
parent
2f0646e7f0
commit
d703d98836
@@ -38,12 +38,12 @@ AsyncFileStorage::AsyncFileStorage(const QString &storageFolderPath, QObject *pa
|
||||
, m_lockFile(m_storageDir.absoluteFilePath(QStringLiteral("storage.lock")))
|
||||
{
|
||||
if (!m_storageDir.mkpath(m_storageDir.absolutePath()))
|
||||
throw AsyncFileStorageError(
|
||||
QString("Could not create directory '%1'.").arg(m_storageDir.absolutePath()));
|
||||
throw AsyncFileStorageError {tr("Could not create directory '%1'.")
|
||||
.arg(m_storageDir.absolutePath())};
|
||||
|
||||
// TODO: This folder locking approach does not work for UNIX systems. Implement it.
|
||||
if (!m_lockFile.open(QFile::WriteOnly))
|
||||
throw AsyncFileStorageError(m_lockFile.errorString());
|
||||
throw AsyncFileStorageError {m_lockFile.errorString()};
|
||||
}
|
||||
|
||||
AsyncFileStorage::~AsyncFileStorage()
|
||||
@@ -76,13 +76,3 @@ void AsyncFileStorage::store_impl(const QString &fileName, const QByteArray &dat
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AsyncFileStorageError::AsyncFileStorageError(const QString &message)
|
||||
: std::runtime_error(message.toUtf8().data())
|
||||
{
|
||||
}
|
||||
|
||||
QString AsyncFileStorageError::message() const
|
||||
{
|
||||
return what();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user