mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-27 06:54:20 +00:00
Cache SearchPluginManager::engineLocation() result
Also the folder is only created on first usage.
This commit is contained in:
parent
361afb401b
commit
5c50c5b24d
@ -322,13 +322,16 @@ QString SearchPluginManager::pluginsLocation()
|
||||
|
||||
QString SearchPluginManager::engineLocation()
|
||||
{
|
||||
QString folder = "nova";
|
||||
if (Utils::ForeignApps::pythonInfo().version.majorNumber() >= 3)
|
||||
folder = "nova3";
|
||||
const QString location = Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Data) + folder);
|
||||
QDir locationDir(location);
|
||||
if (!locationDir.exists())
|
||||
static QString location;
|
||||
if (location.isEmpty()) {
|
||||
const QString folder = (Utils::ForeignApps::pythonInfo().version.majorNumber() >= 3)
|
||||
? "nova3" : "nova";
|
||||
location = Utils::Fs::expandPathAbs(specialFolderLocation(SpecialFolder::Data) + folder);
|
||||
|
||||
const QDir locationDir(location);
|
||||
locationDir.mkpath(locationDir.absolutePath());
|
||||
}
|
||||
|
||||
return location;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user