Skip to content

Commit

Permalink
fix: Setting Default Enviroment Variable for our Network Cache - Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishwaldo committed Jun 19, 2020
1 parent 85c173f commit 79b466f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ozwadmin-main/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ QtProperty *Configuration::addEnumProperty(QString name, QStringList options, in
m_enumManager->setEnumNames(enumitem, options);
m_enumManager->setValue(enumitem, selected);
enumitem->setBold(settings.contains("openzwave/"+name));
enumitem->setEnabled(!readonly);
enumitem->setEnabled(readonly);
this->m_variantToProperty.insert(name, enumitem);
return enumitem;
}
11 changes: 11 additions & 0 deletions ozwadmin-main/ozwcore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ SettingsManager::SettingsManager(QObject *parent) :
qCDebug(ozwadmin) << "Using Enviroment Network Cache:" << size;
setNetworkCache(size);
}
/* Just Put our Enviroment Back there in case it was default */
qputenv("QTRO_NODES_CACHE_SIZE", QString::number(networkCache()).toLocal8Bit());

setLogBufferSize(logBufferSize());
setRetriveLogBuffer(retriveLogBuffer());

Expand All @@ -77,7 +80,15 @@ void SettingsManager::setNetworkCache(quint32 size)
if (size != networkCache()) {
m_settings.setValue("network/cachesize", size);
emit networkCacheChanged(size);
qCInfo(ozwadmin) << "Set Network Cache Size Called: " << QString::number(size).toLocal8Bit();
qputenv("QTRO_NODES_CACHE_SIZE", QString::number(size).toLocal8Bit());
bool ok;
int size = qEnvironmentVariableIntValue("QTRO_NODES_CACHE_SIZE", &ok);
if (!ok) {
qCDebug(ozwadmin) << "QTRO_NODES_CACHE_SIZE Enviroment missing";
} else {
qCDebug(ozwadmin) << "QTRO_NODES_CACHE_SIZE Enviroment is now set to" << size;
}
}
}

Expand Down

0 comments on commit 79b466f

Please sign in to comment.