mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-20 12:44:47 -04:00
Reduce use of static vars in browser plugin
* Convert BrowserSettings into instanced class * Moved HostInstaller init into class constructor
This commit is contained in:
parent
57e60681f2
commit
53a17c2355
11 changed files with 209 additions and 203 deletions
|
@ -30,14 +30,14 @@
|
|||
NativeMessagingHost::NativeMessagingHost(DatabaseTabWidget* parent, const bool enabled)
|
||||
: NativeMessagingBase(enabled)
|
||||
, m_mutex(QMutex::Recursive)
|
||||
, m_browserClients(m_browserService)
|
||||
, m_browserService(parent)
|
||||
, m_browserClients(m_browserService)
|
||||
{
|
||||
m_localServer.reset(new QLocalServer(this));
|
||||
m_localServer->setSocketOptions(QLocalServer::UserAccessOption);
|
||||
m_running.store(false);
|
||||
|
||||
if (BrowserSettings::isEnabled() && !m_running) {
|
||||
if (browserSettings()->isEnabled() && !m_running) {
|
||||
run();
|
||||
}
|
||||
|
||||
|
@ -64,8 +64,8 @@ void NativeMessagingHost::run()
|
|||
}
|
||||
|
||||
// Update KeePassXC/keepassxc-proxy binary paths to Native Messaging scripts
|
||||
if (BrowserSettings::updateBinaryPath()) {
|
||||
BrowserSettings::updateBinaryPaths(BrowserSettings::useCustomProxy() ? BrowserSettings::customProxyLocation()
|
||||
if (browserSettings()->updateBinaryPath()) {
|
||||
browserSettings()->updateBinaryPaths(browserSettings()->useCustomProxy() ? browserSettings()->customProxyLocation()
|
||||
: "");
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ void NativeMessagingHost::run()
|
|||
QtConcurrent::run(this, static_cast<void (NativeMessagingHost::*)()>(&NativeMessagingHost::readNativeMessages));
|
||||
#endif
|
||||
|
||||
if (BrowserSettings::supportBrowserProxy()) {
|
||||
if (browserSettings()->supportBrowserProxy()) {
|
||||
QString serverPath = getLocalServerPath();
|
||||
QFile::remove(serverPath);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue