mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Replace single-character string with character literal
Also remove unnecessary dynamic allocation.
This commit is contained in:
committed by
sledgehammer999
parent
d088ab6f43
commit
9e99a0d3f5
@@ -734,16 +734,16 @@ void TorrentsController::setLocationAction()
|
||||
{
|
||||
checkParams({"hashes", "location"});
|
||||
|
||||
const QStringList hashes {params()["hashes"].split("|")};
|
||||
const QStringList hashes {params()["hashes"].split('|')};
|
||||
const QString newLocation {params()["location"].trimmed()};
|
||||
|
||||
if (newLocation.isEmpty())
|
||||
throw APIError(APIErrorType::BadParams, tr("Save path is empty"));
|
||||
|
||||
|
||||
// try to create the location if it does not exist
|
||||
if (!QDir(newLocation).mkpath("."))
|
||||
throw APIError(APIErrorType::Conflict, tr("Cannot make save path"));
|
||||
|
||||
|
||||
// check permissions
|
||||
if (!QFileInfo(newLocation).isWritable())
|
||||
throw APIError(APIErrorType::AccessDenied, tr("Cannot write to directory"));
|
||||
|
||||
Reference in New Issue
Block a user