chatgui: postChatSetting в хедер, chat_core_get_inst include, chat→chatserver

This commit is contained in:
Evgeny committed 2026-08-04 17:28:05 +03:00
1 parent 969cad831b
commit 90eb961c37
4 files changed
+6 -5

No files matched your search

@@ -215,7 +215,7 @@ void AudioDeviceSettingsPage::applyAndSave() {
/* also update [chat] config section + live apply for headless-compat settings */
if (!m_configPath.isEmpty()) {
auto postChat = [](const QString& path, const char* name, int val) {
config_update_option(path, "chat", name, QString::number(val), CONFIG_UPDATE_REPLACE);
config_update_option(path, "chatserver", name, QString::number(val), CONFIG_UPDATE_REPLACE);
QByteArray v = QByteArray::number(val);
size_t nlen = strlen(name), vlen = (size_t)v.size(), total = nlen + 1 + vlen + 1;
if (total > 256) return;
+1
View File
@@ -6,6 +6,7 @@
#include "../transport/gui_bridge.h"
#include "../db/db_manager.h"
extern "C" {
#include "chat/chat_core.h"
#include "chat/chat_sync.h"
#include "transport_layer/secure_channel.h"
}
+2 -4
View File
@@ -23,10 +23,8 @@ static void saveUiStateInt(const char* key, int val) {
gui_bridge_post_uasync_fn(chat_core_save_ui_state_trampoline, arg);
}
static void postChatSetting(const QString& configPath, const char* name, int val) {
/* persist to config file */
config_update_option(configPath, "chat", name, QString::number(val), CONFIG_UPDATE_REPLACE);
/* apply on-the-fly via bridge */
void postChatSetting(const QString& configPath, const char* name, int val) {
config_update_option(configPath, "chatserver", name, QString::number(val), CONFIG_UPDATE_REPLACE);
QByteArray v = QByteArray::number(val);
size_t nlen = strlen(name), vlen = (size_t)v.size(), total = nlen + 1 + vlen + 1;
if (total > 256) return;
+2
View File
@@ -6,6 +6,8 @@ class DbManager;
class QCheckBox;
class QSpinBox;
void postChatSetting(const QString& configPath, const char* name, int val);
class StorageSettingsPage : public QWidget {
Q_OBJECT
public: