diff --git a/src/ui/fortmanager.cpp b/src/ui/fortmanager.cpp index bf7f9011..fa1cf6e3 100644 --- a/src/ui/fortmanager.cpp +++ b/src/ui/fortmanager.cpp @@ -98,7 +98,8 @@ inline void setupClientServices(IocContainer *ioc, const FortSettings *settings) ioc->setService(new AskPendingManagerRpc()); ioc->setService(new AutoUpdateManagerRpc(settings->cachePath())); ioc->setService(new DriverManagerRpc()); - ioc->setService(new AppInfoManagerRpc(settings->cacheFilePath())); + ioc->setService( + new AppInfoManagerRpc(settings->cacheFilePath(), settings->noCache())); ioc->setService(new LogManagerRpc()); ioc->setService(new ServiceInfoManagerRpc()); ioc->setService(new TaskManagerRpc()); diff --git a/src/ui/fortsettings.cpp b/src/ui/fortsettings.cpp index 9ce6f026..138c95aa 100644 --- a/src/ui/fortsettings.cpp +++ b/src/ui/fortsettings.cpp @@ -50,7 +50,7 @@ QString FortSettings::statBlockFilePath() const QString FortSettings::cacheFilePath() const { - return noCache() && !hasService() ? ":memory:" : cachePath() + "appinfo.db"; + return noCache() ? ":memory:" : cachePath() + "appinfo.db"; } QString FortSettings::passwordUnlockedTillText() const diff --git a/src/ui/rpc/appinfomanagerrpc.cpp b/src/ui/rpc/appinfomanagerrpc.cpp index d5115fa8..d45bd781 100644 --- a/src/ui/rpc/appinfomanagerrpc.cpp +++ b/src/ui/rpc/appinfomanagerrpc.cpp @@ -5,8 +5,9 @@ #include #include -AppInfoManagerRpc::AppInfoManagerRpc(const QString &filePath, QObject *parent) : - AppInfoManager(filePath, parent, SqliteDb::OpenDefaultReadOnly) +AppInfoManagerRpc::AppInfoManagerRpc(const QString &filePath, bool noCache, QObject *parent) : + AppInfoManager(filePath, parent, + (noCache ? SqliteDb::OpenDefaultReadWrite : SqliteDb::OpenDefaultReadOnly)) { } diff --git a/src/ui/rpc/appinfomanagerrpc.h b/src/ui/rpc/appinfomanagerrpc.h index 1d8326ae..9fce517a 100644 --- a/src/ui/rpc/appinfomanagerrpc.h +++ b/src/ui/rpc/appinfomanagerrpc.h @@ -12,7 +12,7 @@ class AppInfoManagerRpc : public AppInfoManager Q_OBJECT public: - explicit AppInfoManagerRpc(const QString &filePath, QObject *parent = nullptr); + explicit AppInfoManagerRpc(const QString &filePath, bool noCache, QObject *parent = nullptr); static bool processServerCommand( const ProcessCommandArgs &p, QVariantList &resArgs, bool &ok, bool &isSendResult);