UI: AppInfoManager: Use "noCache" flag

This commit is contained in:
Nodir Temirkhodjaev 2024-06-08 14:00:42 +03:00
parent 112e6c77f1
commit adf095e831
4 changed files with 7 additions and 5 deletions

View File

@ -98,7 +98,8 @@ inline void setupClientServices(IocContainer *ioc, const FortSettings *settings)
ioc->setService<AskPendingManager>(new AskPendingManagerRpc()); ioc->setService<AskPendingManager>(new AskPendingManagerRpc());
ioc->setService<AutoUpdateManager>(new AutoUpdateManagerRpc(settings->cachePath())); ioc->setService<AutoUpdateManager>(new AutoUpdateManagerRpc(settings->cachePath()));
ioc->setService<DriverManager>(new DriverManagerRpc()); ioc->setService<DriverManager>(new DriverManagerRpc());
ioc->setService<AppInfoManager>(new AppInfoManagerRpc(settings->cacheFilePath())); ioc->setService<AppInfoManager>(
new AppInfoManagerRpc(settings->cacheFilePath(), settings->noCache()));
ioc->setService<LogManager>(new LogManagerRpc()); ioc->setService<LogManager>(new LogManagerRpc());
ioc->setService<ServiceInfoManager>(new ServiceInfoManagerRpc()); ioc->setService<ServiceInfoManager>(new ServiceInfoManagerRpc());
ioc->setService<TaskManager>(new TaskManagerRpc()); ioc->setService<TaskManager>(new TaskManagerRpc());

View File

@ -50,7 +50,7 @@ QString FortSettings::statBlockFilePath() const
QString FortSettings::cacheFilePath() const QString FortSettings::cacheFilePath() const
{ {
return noCache() && !hasService() ? ":memory:" : cachePath() + "appinfo.db"; return noCache() ? ":memory:" : cachePath() + "appinfo.db";
} }
QString FortSettings::passwordUnlockedTillText() const QString FortSettings::passwordUnlockedTillText() const

View File

@ -5,8 +5,9 @@
#include <rpc/rpcmanager.h> #include <rpc/rpcmanager.h>
#include <util/ioc/ioccontainer.h> #include <util/ioc/ioccontainer.h>
AppInfoManagerRpc::AppInfoManagerRpc(const QString &filePath, QObject *parent) : AppInfoManagerRpc::AppInfoManagerRpc(const QString &filePath, bool noCache, QObject *parent) :
AppInfoManager(filePath, parent, SqliteDb::OpenDefaultReadOnly) AppInfoManager(filePath, parent,
(noCache ? SqliteDb::OpenDefaultReadWrite : SqliteDb::OpenDefaultReadOnly))
{ {
} }

View File

@ -12,7 +12,7 @@ class AppInfoManagerRpc : public AppInfoManager
Q_OBJECT Q_OBJECT
public: public:
explicit AppInfoManagerRpc(const QString &filePath, QObject *parent = nullptr); explicit AppInfoManagerRpc(const QString &filePath, bool noCache, QObject *parent = nullptr);
static bool processServerCommand( static bool processServerCommand(
const ProcessCommandArgs &p, QVariantList &resArgs, bool &ok, bool &isSendResult); const ProcessCommandArgs &p, QVariantList &resArgs, bool &ok, bool &isSendResult);