From 20eef8ad163af6ac7558a135df52533bed84cae7 Mon Sep 17 00:00:00 2001 From: evgeny Date: Fri, 4 Sep 2026 13:25:06 +0300 Subject: [PATCH] =?UTF-8?q?chatgui:=20=D0=BB=D0=BE=D0=B3=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D1=83=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD=D0=B8=D1=8E=20=D0=B2?= =?UTF-8?q?=20=D1=84=D0=B0=D0=B9=D0=BB=20chatgui.log=20(debug=5Ffile)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/chatgui/src/main.cpp | 9 +++++++++ tools/chatgui/transport/node_config.cpp | 2 ++ tools/chatgui/transport/node_config.h | 1 + 3 files changed, 12 insertions(+) diff --git a/tools/chatgui/src/main.cpp b/tools/chatgui/src/main.cpp index baf76cfd..308c85e0 100644 --- a/tools/chatgui/src/main.cpp +++ b/tools/chatgui/src/main.cpp @@ -135,6 +135,15 @@ int main(int argc, char *argv[]) { cfg.save(); } + QString debugFile = cfg.debugFile(); + if (debugFile.isEmpty()) debugFile = "chatgui.log"; + if (!QDir::isAbsolutePath(debugFile)) + debugFile = QCoreApplication::applicationDirPath() + "/" + debugFile; + if (cfg.debugFile() != debugFile) { + cfg.setDebugFile(debugFile); + cfg.save(); + } + DbManager db; MainWindow w(nullptr, &db, cfgPath, dbPath, cfg.debugFile(), cfg.debugLevel(), cfg.debugCategories()); diff --git a/tools/chatgui/transport/node_config.cpp b/tools/chatgui/transport/node_config.cpp index 19aec409..098ddb61 100644 --- a/tools/chatgui/transport/node_config.cpp +++ b/tools/chatgui/transport/node_config.cpp @@ -182,6 +182,8 @@ bool NodeConfig::create(const QString& nodeName, quint16 listenPort) { m_autoSockets = true; if (m_dbPath.isEmpty()) m_dbPath = "chat_data"; + if (m_debugFile.isEmpty()) + m_debugFile = "chatgui.log"; return save(); } diff --git a/tools/chatgui/transport/node_config.h b/tools/chatgui/transport/node_config.h index 81597277..2e58d932 100644 --- a/tools/chatgui/transport/node_config.h +++ b/tools/chatgui/transport/node_config.h @@ -49,6 +49,7 @@ public: QString dbPath() const { return m_dbPath; } void setDbPath(const QString& p) { m_dbPath = p; } QString debugFile() const { return m_debugFile; } + void setDebugFile(const QString& p) { m_debugFile = p; } QString debugLevel() const { return m_debugLevel; } QString debugCategories() const { return m_debugCategories; }