From ebbf58c9220f7c46f62af4116782ae3ca7fff8be Mon Sep 17 00:00:00 2001 From: Wang Cong Date: Tue, 26 Dec 2023 15:19:25 +0800 Subject: [PATCH] feat: Debug mode log adaptation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 适配调试模式 Log: Debug mode log adaptation Task: https://pms.uniontech.com/task-view-310055.html --- CMakeLists.txt | 24 ++- .../config/dconfig/org.deepin.terminal.json | 19 ++ .../debugconfig/org.deepin.terminal.json | 12 ++ .../config/logconfig/org.deepin.terminal.json | 57 ++++++ src/assets/logconfig/deepin-terminal.json | 8 - src/common/utils.cpp | 95 +++++++--- src/common/utils.h | 23 +++ src/customcommand/customcommandoptdlg.cpp | 36 ++-- src/customcommand/customcommandpanel.cpp | 12 +- src/customcommand/customcommandplugin.cpp | 4 +- .../customcommandsearchrstpanel.cpp | 10 +- src/customcommand/customcommandtoppanel.cpp | 8 +- src/encodeplugin/encodelistmodel.cpp | 8 +- src/encodeplugin/encodelistview.cpp | 8 +- src/encodeplugin/encodepanelplugin.cpp | 6 +- src/main/dbusmanager.cpp | 42 ++--- src/main/main.cpp | 19 +- src/main/mainwindow.cpp | 170 +++++++++--------- src/main/service.cpp | 18 +- src/main/terminalapplication.cpp | 12 +- src/main/windowsmanager.cpp | 10 +- src/remotemanage/remotemanagementpanel.cpp | 16 +- src/remotemanage/remotemanagementplugn.cpp | 22 +-- .../remotemanagementsearchpanel.cpp | 12 +- src/remotemanage/remotemanagementtoppanel.cpp | 30 ++-- src/remotemanage/serverconfiggrouppanel.cpp | 12 +- src/remotemanage/serverconfigmanager.cpp | 42 ++--- src/remotemanage/serverconfigoptdlg.cpp | 8 +- src/settings/settings.cpp | 20 +-- src/settings/shortcutmanager.cpp | 20 +-- src/views/customthemesettingdialog.cpp | 10 +- src/views/iconbutton.cpp | 4 +- src/views/itemwidget.cpp | 30 ++-- src/views/listview.cpp | 40 ++--- src/views/pagesearchbar.cpp | 4 +- src/views/tabbar.cpp | 12 +- src/views/tabrenamedlg.cpp | 4 +- src/views/termwidget.cpp | 36 ++-- src/views/termwidgetpage.cpp | 32 ++-- 39 files changed, 568 insertions(+), 387 deletions(-) create mode 100644 src/assets/config/dconfig/org.deepin.terminal.json create mode 100644 src/assets/config/debugconfig/org.deepin.terminal.json create mode 100644 src/assets/config/logconfig/org.deepin.terminal.json delete mode 100644 src/assets/logconfig/deepin-terminal.json diff --git a/CMakeLists.txt b/CMakeLists.txt index a7d1887e5..0895eae3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,7 @@ find_package(Qt5Widgets REQUIRED) find_package(Qt5LinguistTools REQUIRED) find_package(Qt5Network REQUIRED) find_package(Qt5X11Extras REQUIRED) -#find_package(DtkWidget REQUIRED) +find_package(DtkWidget REQUIRED) #find_package(DtkCore REQUIRED) #find_package(DtkGui REQUIRED) @@ -276,9 +276,6 @@ install(FILES src/deepin-terminal.desktop install(FILES src/assets/logo/deepin-terminal.svg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/) -install(FILES src/assets/logconfig/deepin-terminal.json - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-log-viewer/deepin-log.conf.d/) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/deepin-terminal DESTINATION ${CMAKE_INSTALL_PREFIX}/bin PERMISSIONS OWNER_READ OWNER_EXECUTE @@ -289,6 +286,25 @@ install(FILES ${DTNG_QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin- install(DIRECTORY src/assets/deepin-terminal DESTINATION /usr/share/deepin-manual/manual-assets/application/) +message("CMAKE_INSTALL_PREFIX: " ${CMAKE_INSTALL_PREFIX}) +#安装日志调试模式配置文件 +install(FILES src/assets/config/debugconfig/org.deepin.terminal.json + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-debug-config/deepin-debug-config.d/) +#install(FILES src/assets/config/debugconfig/deepin-terminal_debug.sh +# DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-debug-config/shell/) +#安装DConfig配置 +set(APPID org.deepin.terminal) +set(configFile ${PROJECT_SOURCE_DIR}/src/assets/config/dconfig/org.deepin.terminal.json) +if (DEFINED DSG_DATA_DIR) + message("-- DConfig is supported by DTK") + dconfig_meta_files(APPID ${APPID} FILES ${configFile}) +else() + message("-- DConfig is not supported by DTK") + install(FILES ${configFile} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dsg/config/org.deepin.terminal/) +endif() +#安装日志收集工具配置文件 +install(FILES src/assets/config/logconfig/org.deepin.terminal.json + DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-log-viewer/deepin-log.conf.d/) # Unit Test if (CMAKE_BUILD_TYPE MATCHES Debug) diff --git a/src/assets/config/dconfig/org.deepin.terminal.json b/src/assets/config/dconfig/org.deepin.terminal.json new file mode 100644 index 000000000..2591230ad --- /dev/null +++ b/src/assets/config/dconfig/org.deepin.terminal.json @@ -0,0 +1,19 @@ +{ + "magic": "dsg.config.meta", + "version": "1.0", + "contents": { + "log_rules": { + "value": "*terminal*.debug=false;*terminal*.info=false;*terminal*.warning=true", + "serial": 0, + "flags": [ + "global" + ], + "name": "log rules", + "name[zh_CN]": "日志规则", + "description": "log rules", + "description[zh_CN]": "日志规则", + "permissions": "readwrite", + "visibility": "public" + } + } +} \ No newline at end of file diff --git a/src/assets/config/debugconfig/org.deepin.terminal.json b/src/assets/config/debugconfig/org.deepin.terminal.json new file mode 100644 index 000000000..79c332792 --- /dev/null +++ b/src/assets/config/debugconfig/org.deepin.terminal.json @@ -0,0 +1,12 @@ +{ + "name": "deepin-terminal", + "group": "", + "submodules": [ + { + "name": "deepin-terminal", + "exec": "/usr/share/deepin-debug-config/shell/deepin-terminal_debug.sh" + } + ], + "reboot": 1, + "version": "V1.0" +} diff --git a/src/assets/config/logconfig/org.deepin.terminal.json b/src/assets/config/logconfig/org.deepin.terminal.json new file mode 100644 index 000000000..9a5a8286b --- /dev/null +++ b/src/assets/config/logconfig/org.deepin.terminal.json @@ -0,0 +1,57 @@ +{ + "name": "deepin-terminal", + "group": "", + "submodules": [ + { + "name": "main", + "filter": "org.deepin.terminal", + "exec": "/usr/bin/deepin-terminal", + "logType": "journal", + "logPath": "~/.cache/deepin/deepin-terminal/deepin-terminal.log" + }, + { + "name": "common", + "filter": "org.deepin.terminal.common", + "exec": "/usr/bin/deepin-terminal", + "logType": "journal", + "logPath": "~/.cache/deepin/deepin-terminal/deepin-terminal.log" + }, + { + "name": "customcom", + "filter": "org.deepin.terminal.customcommand", + "exec": "/usr/bin/deepin-terminal", + "logType": "journal", + "logPath": "~/.cache/deepin/deepin-terminal/deepin-terminal.log" + }, + { + "name": "remotemanage", + "filter": "org.deepin.terminal.remotemanage", + "exec": "/usr/bin/deepin-terminal", + "logType": "journal", + "logPath": "~/.cache/deepin/deepin-terminal/deepin-terminal.log" + }, + { + "name": "tsettings", + "filter": "org.deepin.terminal.tsettings", + "exec": "/usr/bin/deepin-terminal", + "logType": "journal", + "logPath": "~/.cache/deepin/deepin-terminal/deepin-terminal.log" + }, + { + "name": "views", + "filter": "org.deepin.terminal.views", + "exec": "/usr/bin/deepin-terminal", + "logType": "journal", + "logPath": "~/.cache/deepin/deepin-terminal/deepin-terminal.log" + }, + { + "name": "encodeplugin", + "filter": "org.deepin.terminal.encodeplugin", + "exec": "/usr/bin/deepin-terminal", + "logType": "journal", + "logPath": "~/.cache/deepin/deepin-terminal/deepin-terminal.log" + } + ], + "visible": 1, + "version": "V1.0" +} diff --git a/src/assets/logconfig/deepin-terminal.json b/src/assets/logconfig/deepin-terminal.json deleted file mode 100644 index 98432f2df..000000000 --- a/src/assets/logconfig/deepin-terminal.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "deepin-terminal", - "exec": "/usr/bin/deepin-terminal", - "logType": "journal", - "logPath": "~/.cache/deepin/deepin-terminal/deepin-terminal.log", - "visible": "1", - "version": "V1.0" -} \ No newline at end of file diff --git a/src/common/utils.cpp b/src/common/utils.cpp index 02a022a76..1926a9d5e 100644 --- a/src/common/utils.cpp +++ b/src/common/utils.cpp @@ -46,9 +46,9 @@ Utils::~Utils() } #ifdef QT_DEBUG -Q_LOGGING_CATEGORY(LogCommon,"log.terminal.common.work") +Q_LOGGING_CATEGORY(common,"org.deepin.terminal.common") #else -Q_LOGGING_CATEGORY(LogCommon,"log.terminal.common.work",QtInfoMsg) +Q_LOGGING_CATEGORY(common,"org.deepin.terminal.common",QtInfoMsg) #endif QString Utils::getQssContent(const QString &filePath) @@ -336,7 +336,7 @@ void Utils::parseCommandLine(QStringList arguments, TermProperties &Properties, // 解析参数 Properties[KeepOpen] = false; if (!parser.parse(arguments)) - qCInfo(LogCommon) << "parser error:" << parser.errorText(); + qCInfo(common) << "parser error:" << parser.errorText(); if (parser.isSet(optExecute)) { /************************ Add by sunchengxi 2020-09-15:Bug#42864 无法同时打开多个终端 Begin************************/ @@ -377,11 +377,11 @@ void Utils::parseCommandLine(QStringList arguments, TermProperties &Properties, // 处理相应参数,当遇到-v -h参数的时候,这里进程会退出。 parser.process(arguments); } else { - qCInfo(LogCommon) << "Command line input args:" << qPrintable(arguments.join(" ")); - qCInfo(LogCommon) << "The work directory :" << parser.value(optWorkDirectory); - qCInfo(LogCommon) << QString("Execute %1 command in the terminal").arg(Properties[Execute].toStringList().join(" ")); - qCInfo(LogCommon) << "Run in quake mode :" << parser.isSet(optQuakeMode); - qCInfo(LogCommon) << "Set the window mode on starting :" << parser.isSet(optWindowState); + qCInfo(common) << "Command line input args:" << qPrintable(arguments.join(" ")); + qCInfo(common) << "The work directory :" << parser.value(optWorkDirectory); + qCInfo(common) << QString("Execute %1 command in the terminal").arg(Properties[Execute].toStringList().join(" ")); + qCInfo(common) << "Run in quake mode :" << parser.isSet(optQuakeMode); + qCInfo(common) << "Set the window mode on starting :" << parser.isSet(optWindowState); // 这个位置参数解析出来是无法匹配的,可是不带前面标识符,无法准确使用。 } return; @@ -437,7 +437,7 @@ QStringList Utils::parseExecutePara(QStringList &arguments) } arguments.removeOne("-e"); arguments.removeOne("--execute"); - qCInfo(LogCommon) << "Remove the arguments after '-e',the arguments :" << arguments; + qCInfo(common) << "Remove the arguments after '-e',the arguments :" << arguments; } return paraList; @@ -461,7 +461,7 @@ QStringList Utils::parseNestedQString(QString str) //对路径带空格的脚本,右键执行时不进行拆分处理, //./deepin-terminal "-e" "/home/lx777/Desktop/a b/PerfTools_1.9.sh" QFileInfo fi(str); if (fi.isFile()) { - qCWarning(LogCommon) << "this is file,not split."; + qCWarning(common) << "this is file,not split."; paraList.append(str); return paraList; } @@ -528,7 +528,7 @@ QList Utils::encodeList() } } if (!bFind) - qCWarning(LogCommon) << "encode (name :" << name << ") not find!"; + qCWarning(common) << "encode (name :" << name << ") not find!"; else encodeList << encodename; @@ -599,12 +599,12 @@ bool Utils::isLoongarch() if(m_Arch.isEmpty()) { utsname utsbuf; if (uname(&utsbuf) == -1) { - qCWarning(LogCommon) << "get Arch error"; + qCWarning(common) << "get Arch error"; return false; } m_Arch = QString::fromLocal8Bit(utsbuf.machine); } - qCInfo(LogCommon) << "Current system architecture:" << m_Arch; + qCInfo(common) << "Current system architecture:" << m_Arch; return "mips64" == m_Arch || "loongarch64" == m_Arch; } @@ -633,7 +633,7 @@ void Utils::insertToDefaultConfigJson(QVariant &jsonVar, const QString &groups_k obj = objArrayFind(obj, "groups", "key", groups_key2); obj = objArrayFind(obj, "options", "key", options_key); if(!obj) { - qCWarning(LogCommon) << QString("cannot find path %1/%2/%3").arg(groups_key).arg(groups_key2).arg(options_key); + qCWarning(common) << QString("cannot find path %1/%2/%3").arg(groups_key).arg(groups_key2).arg(options_key); return; } obj->insert(key, value); @@ -649,7 +649,7 @@ QVariant Utils::getValueInDefaultConfigJson(QVariant &jsonVar, const QString &gr obj = objArrayFind(obj, "groups", "key", groups_key2); obj = objArrayFind(obj, "options", "key", options_key); if(!obj) { - qCWarning(LogCommon) << QString("cannot find path %1/%2/%3").arg(groups_key).arg(groups_key2).arg(options_key); + qCWarning(common) << QString("cannot find path %1/%2/%3").arg(groups_key).arg(groups_key2).arg(options_key); return QVariant(); } return obj->value(key); @@ -678,9 +678,9 @@ MainWindow *Utils::getMainWindow(QWidget *currWidget) MainWindow *main = nullptr; QWidget *pWidget = currWidget->parentWidget(); while (pWidget != nullptr) { - qCInfo(LogCommon) << "Current Window Class Name :" << pWidget->metaObject()->className(); + qCInfo(common) << "Current Window Class Name :" << pWidget->metaObject()->className(); if (("NormalWindow" == pWidget->objectName()) || ("QuakeWindow" == pWidget->objectName())) { - qCInfo(LogCommon) << "has find MainWindow"; + qCInfo(common) << "has find MainWindow"; main = static_cast(pWidget); break; } @@ -723,7 +723,7 @@ void FontFilter::handleWidthFont() m_thread->start(); return; } - //qCInfo(LogCommon) << "m_thread is Running"; + //qCInfo(common) << "m_thread is Running"; } void FontFilter::setStop(bool stop) @@ -810,7 +810,62 @@ void FontFilter::compareWhiteList() else Blacklist.append(sfont); } - qCInfo(LogCommon) << "Font whitelist obtained through the dbus interface :" << DBUSWhitelist; - qCInfo(LogCommon) << "Whitelist of real available fonts :" << Whitelist; + qCInfo(common) << "Font whitelist obtained through the dbus interface :" << DBUSWhitelist; + qCInfo(common) << "Whitelist of real available fonts :" << Whitelist; } /******** Add by ut001000 renfeixiang 2020-06-15:增加 处理等宽字体的类 End***************/ + +#ifdef DTKCORE_CLASS_DConfigFile +LoggerRules::LoggerRules(QObject *parent) + : QObject(parent), m_rules(""), m_config(nullptr) { +} + +LoggerRules::~LoggerRules() { m_config->deleteLater(); } + +void LoggerRules::initLoggerRules() +{ + QByteArray logRules = qgetenv("QT_LOGGING_RULES"); + qunsetenv("QT_LOGGING_RULES"); + + // set env + m_rules = logRules; + qCDebug(common) << "Current system env log rules:" << logRules; + + // set dconfig + m_config = DConfig::create("org.deepin.terminal", "org.deepin.terminal"); + qCDebug(common) << "Current DConfig file is :" << m_config->name(); + logRules = m_config->value("log_rules").toByteArray(); + qCDebug(common) << "Current app log rules :" << logRules; + appendRules(logRules); + setRules(m_rules); + + // watch dconfig + connect(m_config, &DConfig::valueChanged, this, [this](const QString &key) { + if (key == "log_rules") { + qCDebug(common) << "value changed:" << key; + setRules(m_config->value(key).toByteArray()); + } + }); +} + +void LoggerRules::setRules(const QString &rules) { + auto tmpRules = rules; + m_rules = tmpRules.replace(";", "\n"); + QLoggingCategory::setFilterRules(m_rules); +} + +void LoggerRules::appendRules(const QString &rules) { + QString tmpRules = rules; + tmpRules = tmpRules.replace(";", "\n"); + auto tmplist = tmpRules.split('\n'); + for (int i = 0; i < tmplist.count(); i++) + if (m_rules.contains(tmplist.at(i))) { + tmplist.removeAt(i); + i--; + } + if (tmplist.isEmpty()) + return; + m_rules.isEmpty() ? m_rules = tmplist.join("\n") + : m_rules += "\n" + tmplist.join("\n"); +} +#endif diff --git a/src/common/utils.h b/src/common/utils.h index 75a1153d6..e77cb29ac 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -11,6 +11,9 @@ #include #include +#ifdef DTKCORE_CLASS_DConfig +#include +#endif #include #include @@ -456,4 +459,24 @@ class FontFilter : public QObject }; /******** Add by ut001000 renfeixiang 2020-06-15:增加 处理等宽字体的类 End***************/ +#ifdef DTKCORE_CLASS_DConfigFile +class LoggerRules : public QObject { + Q_OBJECT +public: + explicit LoggerRules(QObject *parent = nullptr); + ~LoggerRules(); + + void initLoggerRules(); + inline QString rules() const { return m_rules; } + void setRules(const QString &rules); + +private: + void appendRules(const QString &rules); + +private: + QString m_rules; + Dtk::Core::DConfig *m_config; +}; +#endif + #endif diff --git a/src/customcommand/customcommandoptdlg.cpp b/src/customcommand/customcommandoptdlg.cpp index 0d39a536d..c1b42fe68 100644 --- a/src/customcommand/customcommandoptdlg.cpp +++ b/src/customcommand/customcommandoptdlg.cpp @@ -28,9 +28,9 @@ #include #ifdef QT_DEBUG -Q_LOGGING_CATEGORY(LogCustomCommand,"log.terminal.customcommand.work") +Q_LOGGING_CATEGORY(customcommand,"org.deepin.terminal.customcommand") #else -Q_LOGGING_CATEGORY(LogCustomCommand,"log.terminal.customcommand.work",QtInfoMsg) +Q_LOGGING_CATEGORY(customcommand,"org.deepin.terminal.customcommand",QtInfoMsg) #endif CustomCommandOptDlg::CustomCommandOptDlg(CustomCmdOptType type, CustomCommandData *currItemData, QWidget *parent) @@ -228,14 +228,14 @@ inline void CustomCommandOptDlg::slotShortCutLineEditingFinished(const QKeySeque { //删除 if ("Backspace" == sequence.toString()) { - qCInfo(LogCustomCommand) << "The KeySequenceE is Backspace"; + qCInfo(customcommand) << "The KeySequenceE is Backspace"; m_shortCutLineEdit->clear(); m_lastCmdShortcut = ""; return; } // 取消 if ("Esc" == sequence.toString()) { - qCInfo(LogCustomCommand) << "The KeySequenceE is Esc"; + qCInfo(customcommand) << "The KeySequenceE is Esc"; m_shortCutLineEdit->clear(); m_shortCutLineEdit->setKeySequence(QKeySequence(m_lastCmdShortcut)); /***add by ut001121 zhangmeng 20200521 在快捷键编辑框中按下ESC键时退出窗口 修复BUG27554***/ @@ -249,10 +249,10 @@ inline void CustomCommandOptDlg::slotShortCutLineEditingFinished(const QKeySeque QString reason; // 判断快捷键是否冲突 if (!ShortcutManager::instance()->checkShortcutValid(checkName, sequence.toString(), reason)) { - qCWarning(LogCustomCommand) << "Shortcut key conflict"; + qCWarning(customcommand) << "Shortcut key conflict"; // 冲突 if (sequence.toString() != "Esc") { - qCWarning(LogCustomCommand) << "The current shortcut key is not Esc! ("<< sequence <<")"; + qCWarning(customcommand) << "The current shortcut key is not Esc! ("<< sequence <<")"; showShortcutConflictMsgbox(reason); } m_shortCutLineEdit->clear(); @@ -381,21 +381,21 @@ void CustomCommandOptDlg::slotAddSaveButtonClicked() strName = strName.trimmed();//空格的名称是无效的,剔除名称前后的空格 if (strName.isEmpty()) { - qCWarning(LogCustomCommand) << "The name of the user-defined command is empty!"; + qCWarning(customcommand) << "The name of the user-defined command is empty!"; m_nameLineEdit->showAlertMessage(tr("Please enter a name"), m_nameLineEdit->parentWidget()); return; } /***add begin by ut001121 zhangmeng 20200615 限制名称字符长度 修复BUG31286***/ if (strName.length() > MAX_NAME_LEN) { - qCWarning(LogCustomCommand) << "The name should be no more than 32 characters"; + qCWarning(customcommand) << "The name should be no more than 32 characters"; m_nameLineEdit->showAlertMessage(QObject::tr("The name should be no more than 32 characters"), m_nameLineEdit->parentWidget()); return; } /***add end by ut001121***/ QString strCommandtemp = strCommand.trimmed();//空格的命令是无效的 if (strCommandtemp.isEmpty()) { - qCWarning(LogCustomCommand) << "The custom command is empty"; + qCWarning(customcommand) << "The custom command is empty"; m_commandLineEdit->showAlertMessage(tr("Please enter a command"), m_commandLineEdit->parentWidget()); return; } @@ -410,20 +410,20 @@ void CustomCommandOptDlg::slotAddSaveButtonClicked() QAction *existAction = nullptr; int icount = 0; if (CCT_MODIFY == m_type) { - qCInfo(LogCustomCommand) << "It is the modify type of custom command operation"; + qCInfo(customcommand) << "It is the modify type of custom command operation"; if (m_bRefreshCheck) { - qCInfo(LogCustomCommand) << "CustomCommand was refreshed"; + qCInfo(customcommand) << "CustomCommand was refreshed"; QAction *refreshExitAction = nullptr; refreshExitAction = ShortcutManager::instance()->checkActionIsExist(*m_newAction); if (refreshExitAction) { - qCWarning(LogCustomCommand) << "The custom command already exists"; + qCWarning(customcommand) << "The custom command already exists"; accept(); return; } } if (strName == m_currItemData->m_cmdName && strCommand == m_currItemData->m_cmdText && keytmp == QKeySequence(m_currItemData->m_cmdShortcut)) { - qCInfo(LogCustomCommand) << "The custom command don't need to save again."; + qCInfo(customcommand) << "The custom command don't need to save again."; accept(); return; } @@ -431,7 +431,7 @@ void CustomCommandOptDlg::slotAddSaveButtonClicked() existAction = ShortcutManager::instance()->checkActionIsExistForModify(*m_newAction); if (strName != m_currItemData->m_cmdName) { - qCInfo(LogCustomCommand) << "Custom commands have been changed."; + qCInfo(customcommand) << "Custom commands have been changed."; QList &customCommandActionList = ShortcutManager::instance()->getCustomCommandActionList(); for (int i = 0; i < customCommandActionList.size(); i++) { QAction *curAction = customCommandActionList[i]; @@ -441,12 +441,12 @@ void CustomCommandOptDlg::slotAddSaveButtonClicked() } } } else { - qCInfo(LogCustomCommand) << "It is the add type of custom command operation"; + qCInfo(customcommand) << "It is the add type of custom command operation"; existAction = ShortcutManager::instance()->checkActionIsExist(*m_newAction); } if (nullptr != existAction || icount) { - qCInfo(LogCustomCommand) << "The name already exists"; + qCInfo(customcommand) << "The name already exists"; QString strFistLine = tr("The name already exists,"); QString strSecondeLine = tr("please input another one."); Utils::showSameNameDialog(this, strFistLine, strSecondeLine); @@ -710,7 +710,7 @@ void CustomCommandOptDlg::closeEvent(QCloseEvent *event) void CustomCommandOptDlg::slotRefreshData(QString oldCmdName, QString newCmdName) { if (CCT_ADD == m_type) { - qCWarning(LogCustomCommand) << "Currently is the add operation interface"; + qCWarning(customcommand) << "Currently is the add operation interface"; return; } //不进行刷新操作 @@ -722,7 +722,7 @@ void CustomCommandOptDlg::slotRefreshData(QString oldCmdName, QString newCmdName return; } m_bRefreshCheck = true; - qCInfo(LogCustomCommand) << "Refresh custom command data.Curren command name is " << m_nameLineEdit->text(); + qCInfo(customcommand) << "Refresh custom command data.Curren command name is " << m_nameLineEdit->text(); QAction *currAction = new QAction(ShortcutManager::instance()); currAction->setText(newCmdName); diff --git a/src/customcommand/customcommandpanel.cpp b/src/customcommand/customcommandpanel.cpp index 6b846d20b..5ebe144fa 100644 --- a/src/customcommand/customcommandpanel.cpp +++ b/src/customcommand/customcommandpanel.cpp @@ -19,7 +19,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogCustomCommand) +Q_DECLARE_LOGGING_CATEGORY(customcommand) CustomCommandPanel::CustomCommandPanel(QWidget *parent) : CommonPanel(parent) { @@ -46,10 +46,10 @@ void CustomCommandPanel::showCurSearchResult() void CustomCommandPanel::showAddCustomCommandDlg() { if (m_pushButton->hasFocus()) { - qCInfo(LogCustomCommand) << "The Add command button has focus to click on!"; + qCInfo(customcommand) << "The Add command button has focus to click on!"; m_bpushButtonHaveFocus = true; } else { - qCInfo(LogCustomCommand) << "The Add command button has no focus to prohibit clicking!"; + qCInfo(customcommand) << "The Add command button has no focus to prohibit clicking!"; m_bpushButtonHaveFocus = false; } @@ -86,13 +86,13 @@ void CustomCommandPanel::onFocusOut(Qt::FocusReason type) // 下一个 或 列表为空, 焦点定位到添加按钮上 m_pushButton->setFocus(); m_cmdListWidget->clearIndex(); - qCInfo(LogCustomCommand) << "Set the focus to the Add command button"; + qCInfo(customcommand) << "Set the focus to the Add command button"; } else if (Qt::BacktabFocusReason == type) { // 判断是否可见,可见设置焦点 if (m_searchEdit->isVisible()) { m_searchEdit->lineEdit()->setFocus(); m_cmdListWidget->clearIndex(); - qCInfo(LogCustomCommand) << "Set the focus to the Search edit"; + qCInfo(customcommand) << "Set the focus to the Search edit"; } } } @@ -173,7 +173,7 @@ void CustomCommandPanel::setFocusInPanel() // 添加按钮下 m_pushButton->setFocus(); } else { - qCWarning(LogCustomCommand) << "focus error unkown reason"; + qCWarning(customcommand) << "focus error unkown reason"; } } diff --git a/src/customcommand/customcommandplugin.cpp b/src/customcommand/customcommandplugin.cpp index f60afe46c..1f0978b5f 100644 --- a/src/customcommand/customcommandplugin.cpp +++ b/src/customcommand/customcommandplugin.cpp @@ -15,7 +15,7 @@ //qt #include #include -Q_DECLARE_LOGGING_CATEGORY(LogCustomCommand) +Q_DECLARE_LOGGING_CATEGORY(customcommand) CustomCommandPlugin::CustomCommandPlugin(QObject *parent) : MainWindowPluginInterface(parent) { @@ -78,7 +78,7 @@ void CustomCommandPlugin::doShowPlugin(const QString name, bool bSetFocus) if (MainWindow::PLUGIN_TYPE_CUSTOMCOMMAND != name) { // 若插件已经显示,则隐藏 if (m_isShow) { - qCWarning(LogCustomCommand) << "Command top panel hide"; + qCWarning(customcommand) << "Command top panel hide"; getCustomCommandTopPanel()->hideAnim(); m_isShow = false; } diff --git a/src/customcommand/customcommandsearchrstpanel.cpp b/src/customcommand/customcommandsearchrstpanel.cpp index 7c3a24d77..d45c20bae 100644 --- a/src/customcommand/customcommandsearchrstpanel.cpp +++ b/src/customcommand/customcommandsearchrstpanel.cpp @@ -21,7 +21,7 @@ #include #include #include -Q_DECLARE_LOGGING_CATEGORY(LogCustomCommand) +Q_DECLARE_LOGGING_CATEGORY(customcommand) CustomCommandSearchRstPanel::CustomCommandSearchRstPanel(QWidget *parent) : CommonPanel(parent) @@ -105,7 +105,7 @@ inline void CustomCommandSearchRstPanel::handleIconButtonFocusOut(Qt::FocusReaso // tab 进入 + QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Tab, Qt::MetaModifier); QApplication::sendEvent(Utils::getMainWindow(this), &keyPress); - qCInfo(LogCustomCommand) << "search panel focus to '+'"; + qCInfo(customcommand) << "search panel focus to '+'"; } } @@ -116,13 +116,13 @@ inline void CustomCommandSearchRstPanel::handleListViewFocusOut(Qt::FocusReason // tab 进入 + QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Tab, Qt::MetaModifier); QApplication::sendEvent(Utils::getMainWindow(this), &keyPress); - qCInfo(LogCustomCommand) << "search panel focus on '+'"; + qCInfo(customcommand) << "search panel focus on '+'"; m_cmdListWidget->clearIndex(); } else if (Qt::BacktabFocusReason == type || Qt::NoFocusReason == type) { // shift + tab 返回 返回键 // 列表为空,也返回到返回键上 m_rebackButton->setFocus(); m_cmdListWidget->clearIndex(); - qCInfo(LogCustomCommand) << "search panel type (" << type << ")"; + qCInfo(customcommand) << "search panel type (" << type << ")"; } } @@ -146,7 +146,7 @@ void CustomCommandSearchRstPanel::refreshData(const QString &strFilter) void CustomCommandSearchRstPanel::doCustomCommand(const QString &strKey) { - qCInfo(LogCustomCommand) << "Search for the current custom commonds based on the key (" << strKey << ")"; + qCInfo(customcommand) << "Search for the current custom commonds based on the key (" << strKey << ")"; QAction *item = ShortcutManager::instance()->findActionByKey(strKey); QString strCommand = item ? item->data().toString() : ""; if (!strCommand.endsWith('\n')) diff --git a/src/customcommand/customcommandtoppanel.cpp b/src/customcommand/customcommandtoppanel.cpp index 8c1d35202..f0471d24a 100644 --- a/src/customcommand/customcommandtoppanel.cpp +++ b/src/customcommand/customcommandtoppanel.cpp @@ -14,7 +14,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogCustomCommand) +Q_DECLARE_LOGGING_CATEGORY(customcommand) const int iAnimationDuration = 300; @@ -63,7 +63,7 @@ void CustomCommandTopPanel::showCustomCommandPanel() if (main != nullptr) { if (main->isFocusOnList()) { m_customCommandPanel->setFocusInPanel(); - qCWarning(LogCustomCommand) << "custom command panel has focus"; + qCWarning(customcommand) << "custom command panel has focus"; } } @@ -132,11 +132,11 @@ void CustomCommandTopPanel::show(bool bSetFocus) m_customCommandSearchPanel->hide(); m_bSetFocus = bSetFocus; if (m_bSetFocus) { - qCInfo(LogCustomCommand) << "Focus is in Custom panel"; + qCInfo(customcommand) << "Focus is in Custom panel"; // 将焦点设置在平面上 m_customCommandPanel->setFocusInPanel(); } else { - qCInfo(LogCustomCommand) << "Focus is in Current page"; + qCInfo(customcommand) << "Focus is in Current page"; // 将焦点落回终端 MainWindow *w = Utils::getMainWindow(this); if(w) diff --git a/src/encodeplugin/encodelistmodel.cpp b/src/encodeplugin/encodelistmodel.cpp index 8bdbd9deb..ec8c632e0 100644 --- a/src/encodeplugin/encodelistmodel.cpp +++ b/src/encodeplugin/encodelistmodel.cpp @@ -15,9 +15,9 @@ DWIDGET_USE_NAMESPACE #ifdef QT_DEBUG -Q_LOGGING_CATEGORY(LogEncodePlugin,"log.terminal.encodeplugin.work") +Q_LOGGING_CATEGORY(encodeplugin,"org.deepin.terminal.encodeplugin") #else -Q_LOGGING_CATEGORY(LogEncodePlugin,"log.terminal.encodeplugin.work",QtInfoMsg) +Q_LOGGING_CATEGORY(encodeplugin,"org.deepin.terminal.encodeplugin",QtInfoMsg) #endif EncodeListModel::EncodeListModel(QObject *parent) : QStandardItemModel(parent) @@ -93,10 +93,10 @@ void EncodeListModel::initEncodeData() } } if (!bFind) - qCWarning(LogEncodePlugin) << "The encoding(" << name << ") in the terminal encoding list is not found in the list of supported encodeings!"; + qCWarning(encodeplugin) << "The encoding(" << name << ") in the terminal encoding list is not found in the list of supported encodeings!"; else m_encodeData << encodename; } - qCInfo(LogEncodePlugin) << "The number("<< m_encodeData.count() << ") of system encoding formats supported by the terminal."; + qCInfo(encodeplugin) << "The number("<< m_encodeData.count() << ") of system encoding formats supported by the terminal."; } diff --git a/src/encodeplugin/encodelistview.cpp b/src/encodeplugin/encodelistview.cpp index 4bb4a7bf5..8319e05c3 100644 --- a/src/encodeplugin/encodelistview.cpp +++ b/src/encodeplugin/encodelistview.cpp @@ -20,7 +20,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogEncodePlugin) +Q_DECLARE_LOGGING_CATEGORY(encodeplugin) EncodeListView::EncodeListView(QWidget *parent) : DListView(parent), m_encodeModel(new EncodeListModel(this)) { @@ -101,7 +101,7 @@ void EncodeListView::focusInEvent(QFocusEvent *event) // 判断焦点 if (Qt::TabFocusReason == m_foucusReason || Qt::BacktabFocusReason == m_foucusReason) { - qCInfo(LogEncodePlugin) << "The reason(" << m_foucusReason << ") for the current focus." + qCInfo(encodeplugin) << "The reason(" << m_foucusReason << ") for the current focus." << "The encoding format(" << m_modelIndexChecked.data().toString() <<") in which focus is currently obtained."; setCurrentIndex(m_modelIndexChecked); } @@ -197,14 +197,14 @@ void EncodeListView::mouseMoveEvent(QMouseEvent *event) void EncodeListView::onListViewClicked(const QModelIndex &index) { if (!index.isValid()) { - qCWarning(LogEncodePlugin) << "The current encoding format("<< index << ") is incorrect."; + qCWarning(encodeplugin) << "The current encoding format("<< index << ") is incorrect."; return; } QStandardItemModel *model = qobject_cast(this->model()); if (nullptr == model) return; - qCInfo(LogEncodePlugin) << "The encoding format(" << m_modelIndexChecked.data().toString() << ") selected last time." + qCInfo(encodeplugin) << "The encoding format(" << m_modelIndexChecked.data().toString() << ") selected last time." << "The encoding format(" << index.data().toString()<< ") selected this time."; //当前Checked子项改为Unchecked状态 diff --git a/src/encodeplugin/encodepanelplugin.cpp b/src/encodeplugin/encodepanelplugin.cpp index 9ceeb989d..d29151591 100644 --- a/src/encodeplugin/encodepanelplugin.cpp +++ b/src/encodeplugin/encodepanelplugin.cpp @@ -15,7 +15,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogEncodePlugin) +Q_DECLARE_LOGGING_CATEGORY(encodeplugin) EncodePanelPlugin::EncodePanelPlugin(QObject *parent) : MainWindowPluginInterface(parent) { @@ -103,7 +103,7 @@ void EncodePanelPlugin::initEncodePanel() void EncodePanelPlugin::setCurrentTermEncode(TermWidget *term) { QString encode; - qCInfo(LogEncodePlugin) <<"Whether to link remote?" << term->isConnectRemote(); + qCInfo(encodeplugin) <<"Whether to link remote?" << term->isConnectRemote(); // 是否连接远程 if (term->isConnectRemote()) { // 远程编码 @@ -114,7 +114,7 @@ void EncodePanelPlugin::setCurrentTermEncode(TermWidget *term) } //更新编码 - qCInfo(LogEncodePlugin) << "Update the encoding(" << encode << ") of the current terminal!"; + qCInfo(encodeplugin) << "Update the encoding(" << encode << ") of the current terminal!"; m_encodePanel->updateEncode(encode); } diff --git a/src/main/dbusmanager.cpp b/src/main/dbusmanager.cpp index 081dfc6dd..03dd123ea 100644 --- a/src/main/dbusmanager.cpp +++ b/src/main/dbusmanager.cpp @@ -14,7 +14,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogMain) +Q_DECLARE_LOGGING_CATEGORY(mainprocess) DBusManager::DBusManager() { @@ -27,7 +27,7 @@ DBusManager::~DBusManager() QDBusConnection conn = QDBusConnection::sessionBus(); if (conn.registerService(TERMINALSERVER)) { conn.unregisterService(TERMINALSERVER); - qCInfo(LogMain) << "Deregister the dbus service of the terminal!"; + qCInfo(mainprocess) << "Deregister the dbus service of the terminal!"; } } @@ -37,12 +37,12 @@ bool DBusManager::initDBus() QDBusConnection conn = QDBusConnection::sessionBus(); if (!conn.registerService(TERMINALSERVER)) { - qCWarning(LogMain) << "The dbus service of the terminal has been registered or failed to be registered!"; + qCWarning(mainprocess) << "The dbus service of the terminal has been registered or failed to be registered!"; return false; } if (!conn.registerObject(TERMINALINTERFACE, this, QDBusConnection::ExportAllSlots)) { - qCWarning(LogMain) << "The dbus service on the terminal fails to create an object!"; + qCWarning(mainprocess) << "The dbus service on the terminal fails to create an object!"; return false; } @@ -56,12 +56,12 @@ int DBusManager::callKDECurrentDesktop() QDBusMessage response = QDBusConnection::sessionBus().call(msg); if (response.type() == QDBusMessage::ReplyMessage) { - qCInfo(LogMain) << "Calling the 'currentDesktop' interface successded!"; + qCInfo(mainprocess) << "Calling the 'currentDesktop' interface successded!"; QList list = response.arguments(); return list.value(0).toInt(); } - qCWarning(LogMain) << "Failed to call the 'currentDesktop' interface'. msg: " << response.errorMessage(); + qCWarning(mainprocess) << "Failed to call the 'currentDesktop' interface'. msg: " << response.errorMessage(); return -1; } @@ -74,9 +74,9 @@ void DBusManager::callKDESetCurrentDesktop(int index) QDBusMessage response = QDBusConnection::sessionBus().call(msg); if (response.type() == QDBusMessage::ReplyMessage) - qCInfo(LogMain) << "Calling the 'setCurrentDesktop' interface successded!"; + qCInfo(mainprocess) << "Calling the 'setCurrentDesktop' interface successded!"; else - qCWarning(LogMain) << "Failed to call the 'setCurrentDesktop' interface'. msg: " << response.errorMessage(); + qCWarning(mainprocess) << "Failed to call the 'setCurrentDesktop' interface'. msg: " << response.errorMessage(); } FontDataList DBusManager::callAppearanceFont(QString fontType) @@ -89,7 +89,7 @@ FontDataList DBusManager::callAppearanceFont(QString fontType) QDBusMessage response = QDBusConnection::sessionBus().call(msg); if (QDBusMessage::ReplyMessage == response.type()) { - qCInfo(LogMain) << "Calling the 'List' interface successded!"; + qCInfo(mainprocess) << "Calling the 'List' interface successded!"; QList list = response.arguments(); QString fonts = list.value(list.count() - 1).toString(); // 原本的返回值为QDBusPendingReply => QString @@ -100,7 +100,7 @@ FontDataList DBusManager::callAppearanceFont(QString fontType) QStringList fontList = fonts.split(","); rList = callAppearanceFont(fontList, fontType); } else { - qCWarning(LogMain) << "Failed to call the 'List' interface'. msg: " << response.errorMessage(); + qCWarning(mainprocess) << "Failed to call the 'List' interface'. msg: " << response.errorMessage(); } @@ -116,16 +116,16 @@ FontDataList DBusManager::callAppearanceFont(QStringList fontList, QString fontT msg << fontType << fontList; QDBusMessage response = QDBusConnection::sessionBus().call(msg); if (response.type() == QDBusMessage::ReplyMessage) { - qCInfo(LogMain) << "Calling the 'Show' interface successded!"; + qCInfo(mainprocess) << "Calling the 'Show' interface successded!"; QByteArray fonts = response.arguments().value(0).toByteArray(); QJsonArray array = QJsonDocument::fromJson(fonts).array(); for (int i = 0; i < array.size(); i++) { QJsonObject object = array.at(i).toObject(); retList.append(FontData(object["Id"].toString(), object["Name"].toString())); } - qCInfo(LogMain) << "Show value" << retList.values(); + qCInfo(mainprocess) << "Show value" << retList.values(); } else { - qCWarning(LogMain) << "Failed to call the 'Show' interface'. msg: " << response.errorMessage(); + qCWarning(mainprocess) << "Failed to call the 'Show' interface'. msg: " << response.errorMessage(); } return retList; } @@ -139,9 +139,9 @@ void DBusManager::callTerminalEntry(QStringList args) QDBusMessage response = QDBusConnection::sessionBus().call(msg, QDBus::NoBlock); if (response.type() == QDBusMessage::ReplyMessage) - qCInfo(LogMain) << "Calling the 'callTerminalEntry' interface successded!"; + qCInfo(mainprocess) << "Calling the 'callTerminalEntry' interface successded!"; else - qCWarning(LogMain) << "Failed to call the 'callTerminalEntry' interface'. msg: " << response.errorMessage(); + qCWarning(mainprocess) << "Failed to call the 'callTerminalEntry' interface'. msg: " << response.errorMessage(); } void DBusManager::entry(QStringList args) @@ -223,9 +223,9 @@ void DBusManager::callSystemSound(const QString &sound) { QDBusMessage response = dbusPlaySound(sound); if (response.type() == QDBusMessage::ReplyMessage) - qCInfo(LogMain) << "Calling the 'dbusPlaySound' interface successded!"; + qCInfo(mainprocess) << "Calling the 'dbusPlaySound' interface successded!"; else - qCWarning(LogMain) << "Failed to call the 'dbusPlaySound' interface'. msg: " << response.errorMessage(); + qCWarning(mainprocess) << "Failed to call the 'dbusPlaySound' interface'. msg: " << response.errorMessage(); } void DBusManager::listenTouchPadSignal() @@ -233,9 +233,9 @@ void DBusManager::listenTouchPadSignal() // 注册监听触控板事件 bool isConnect = QDBusConnection::systemBus().connect(GESTURE_SERVICE, GESTURE_PATH, GESTURE_INTERFACE, GESTURE_SIGNAL, Service::instance(), SIGNAL(touchPadEventSignal(QString, QString, int))); if (isConnect) - qCInfo(LogMain) << "connect to Guest, listen touchPad!"; + qCInfo(mainprocess) << "connect to Guest, listen touchPad!"; else - qCWarning(LogMain) << "disconnect to Guest, cannot listen touchPad!"; + qCWarning(mainprocess) << "disconnect to Guest, cannot listen touchPad!"; } void DBusManager::listenDesktopSwitched() @@ -243,7 +243,7 @@ void DBusManager::listenDesktopSwitched() // 注册监听桌面工作区切换 bool isConnect = QDBusConnection::sessionBus().connect(WM_SERVICE, WM_PATH, WM_INTERFACE, WM_WORKSPACESWITCHED, Service::instance(), SLOT(onDesktopWorkspaceSwitched(int, int))); if (isConnect) - qCInfo(LogMain) << "connect to wm, listen workspaceswitched"; + qCInfo(mainprocess) << "connect to wm, listen workspaceswitched"; else - qCWarning(LogMain) << "disconnect to wm,cannot listen workspaceswitched"; + qCWarning(mainprocess) << "disconnect to wm,cannot listen workspaceswitched"; } diff --git a/src/main/main.cpp b/src/main/main.cpp index dde9e9546..f082434a9 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -26,7 +26,7 @@ DWIDGET_USE_NAMESPACE DCORE_USE_NAMESPACE -Q_DECLARE_LOGGING_CATEGORY(LogMain) +Q_DECLARE_LOGGING_CATEGORY(mainprocess) int main(int argc, char *argv[]) { @@ -46,19 +46,26 @@ int main(int argc, char *argv[]) // 系统日志 #if (DTK_VERSION >= DTK_VERSION_CHECK(5,6,8,0)) - qCDebug(LogMain) << "current libdtkcore5 > 5.6.8.0"; + qCDebug(mainprocess) << "current libdtkcore5 > 5.6.8.0"; DLogManager::registerJournalAppender(); - qCInfo(LogMain) << "Current log register journal!"; + qCInfo(mainprocess) << "Current log register journal!"; #ifdef QT_DEBUG DLogManager::registerConsoleAppender(); - qCInfo(LogMain) << "Current log register console!"; + qCInfo(mainprocess) << "Current log register console!"; #endif #else - qCDebug(LogMain) << "current libdtkcore5 < 5.6.8.0"; + qCDebug(mainprocess) << "current libdtkcore5 < 5.6.8.0"; // DLogManager::registerJournalAppender(); DLogManager::registerConsoleAppender(); DLogManager::registerFileAppender(); - qCInfo(LogMain) << "Current log register console and file!"; + qCInfo(mainprocess) << "Current log register console and file!"; +#endif + +#ifdef DTKCORE_CLASS_DConfigFile + qCInfo(mainprocess) << "DConfig is supported by DTK"; + //日志规则 + LoggerRules logRules; + logRules.initLoggerRules(); #endif // 参数解析 diff --git a/src/main/mainwindow.cpp b/src/main/mainwindow.cpp index 5d3b675c8..7e8510476 100644 --- a/src/main/mainwindow.cpp +++ b/src/main/mainwindow.cpp @@ -68,9 +68,9 @@ DWIDGET_USE_NAMESPACE #define QUAKE_EDGE 5 #ifdef QT_DEBUG -Q_LOGGING_CATEGORY(LogMain,"log.terminal.main.work") +Q_LOGGING_CATEGORY(mainprocess,"org.deepin.terminal") #else -Q_LOGGING_CATEGORY(LogMain,"log.terminal.main.work",QtInfoMsg) +Q_LOGGING_CATEGORY(mainprocess,"org.deepin.terminal",QtInfoMsg) #endif SwitchThemeMenu::SwitchThemeMenu(const QString &title, QWidget *parent): QMenu(title, parent) @@ -131,14 +131,14 @@ MainWindow::MainWindow(TermProperties properties, QWidget *parent) // 主进程的启动时间存在APP中 TerminalApplication *app = static_cast(qApp); m_ReferedAppStartTime = app->getStartTime(); - qCInfo(LogMain) << "The time when the main program starts.[Start Time:" + qCInfo(mainprocess) << "The time when the main program starts.[Start Time:" << QDateTime::fromMSecsSinceEpoch(m_ReferedAppStartTime).toString("yyyy-MM-dd hh:mm:ss:zzz") << "]"; } else { - qCInfo(LogMain) << "The time when the subroutine starts.[Start Time:" + qCInfo(mainprocess) << "The time when the subroutine starts.[Start Time:" << QDateTime::fromMSecsSinceEpoch(m_ReferedAppStartTime).toString("yyyy-MM-dd hh:mm:ss:zzz") << "]"; } m_CreateWindowTime = Service::instance()->getEntryTime(); - qCInfo(LogMain) << "Time when the main window was created. [ Create Time:" + qCInfo(mainprocess) << "Time when the main window was created. [ Create Time:" << QDateTime::fromMSecsSinceEpoch(m_CreateWindowTime).toString("yyyy-MM-dd hh:mm:ss:zzz") << "]";; } @@ -272,7 +272,7 @@ inline void MainWindow::slotOptionButtonPressed() inline void MainWindow::slotClickNewWindowTimeout() { // 创建新的窗口 - qCInfo(LogMain) << "Create a new window using the New Window button in the title bar menu."; + qCInfo(mainprocess) << "Create a new window using the New Window button in the title bar menu."; TermWidgetPage *tabPage = currentPage(); TermWidget *term = tabPage->currentTerminal(); @@ -294,7 +294,7 @@ void MainWindow::initOptionButton() if (dtkbutton != nullptr) dtkbutton->hide(); else - qCWarning(LogMain) << "can not found DTitlebarDWindowQuitFullscreenButton in DTitlebar"; + qCWarning(mainprocess) << "can not found DTitlebarDWindowQuitFullscreenButton in DTitlebar"; // option button DIconButton *optionBtn = titlebar()->findChild("DTitlebarDWindowOptionButton"); @@ -302,7 +302,7 @@ void MainWindow::initOptionButton() // mainwindow的设置按钮触发 connect(titlebar()->findChild("DTitlebarDWindowOptionButton"), &DIconButton::pressed, this, &MainWindow::slotOptionButtonPressed); } else { - qCWarning(LogMain) << "can not found DTitlebarDWindowOptionButton in DTitlebar"; + qCWarning(mainprocess) << "can not found DTitlebarDWindowOptionButton in DTitlebar"; } } @@ -390,7 +390,7 @@ void MainWindow::singleFlagMove() { if (m_properties[SingleFlag].toBool()) { Dtk::Widget::moveToCenter(this); - qCInfo(LogMain) << "The window moves to the center of the screen" ; + qCInfo(mainprocess) << "The window moves to the center of the screen" ; } } @@ -409,14 +409,14 @@ void MainWindow::addTab(TermProperties properties, bool activeTab) qint64 startTime = QDateTime::currentMSecsSinceEpoch(); //如果不允许新建标签,则返回 if (!beginAddTab()){ - qCWarning(LogMain) << "Cannot create new labels"; + qCWarning(mainprocess) << "Cannot create new labels"; return; } TermWidgetPage *termPage = new TermWidgetPage(properties, this); // pageID存在 tab中,所以page增删改操作都要由tab发起。 int index = m_tabbar->addTab(termPage->identifier(), termPage->getCurrentTerminalTitle()); - qCInfo(LogMain) << "The associated index(" << index <<") of the newly added label."; + qCInfo(mainprocess) << "The associated index(" << index <<") of the newly added label."; endAddTab(termPage, activeTab, index, startTime); } @@ -435,7 +435,7 @@ void MainWindow::addTabWithTermPage(const QString &tabName, bool activeTab, bool // pageID存在 tab中,所以page增删改操作都要由tab发起。 int index = m_tabbar->insertTab(insertIndex, page->identifier(), tabName); m_tabbar->setTabText(termPage->identifier(), tabName); - qCInfo(LogMain) << "Insert the associated index("<< index << ") of the label"; + qCInfo(mainprocess) << "Insert the associated index("<< index << ") of the label"; //拖拽过程中存在一种标签预览模式,此时不需要真实添加 if (!isVirtualAdd) { @@ -453,7 +453,7 @@ bool MainWindow::beginAddTab() // 没有雷神,且是雷神让通过,不然不让通过 if (!(nullptr == WindowsManager::instance()->getQuakeWindow() && m_isQuakeWindow)) { // 非雷神窗口不得超过MAXWIDGETCOUNT - qCInfo(LogMain) << "addTab failed, can't create number more than " << MAXWIDGETCOUNT; + qCInfo(mainprocess) << "addTab failed, can't create number more than " << MAXWIDGETCOUNT; return false; } } @@ -487,7 +487,7 @@ void MainWindow::endAddTab(TermWidgetPage *termPage, bool activeTab, int index, connect(termPage->currentTerminal(), &TermWidget::termIsIdle, this, &MainWindow::onTermIsIdle); qint64 endTime = QDateTime::currentMSecsSinceEpoch(); QString strNewTabTime = GRAB_POINT + LOGO_TYPE + CREATE_NEW_TAB_TIME + QString::number(endTime - startTime); - qCInfo(LogMain) << "Add label end.Takes Time: " << qPrintable(strNewTabTime); + qCInfo(mainprocess) << "Add label end.Takes Time: " << qPrintable(strNewTabTime); QString expandThemeStr = ""; expandThemeStr = Settings::instance()->extendColorScheme(); @@ -505,10 +505,10 @@ bool MainWindow::hasRunningProcesses() //没有校验当前tab中是否有其它正在执行的分屏 if (tabPage->runningTerminalCount() != 0) { /******** Modify by nt001000 renfeixiang 2020-05-28:修改 判断当前tab中是否有其它分屏正在执行 End***************/ - qCInfo(LogMain) << "here are processes running in this terminal tab... " << tabPage->identifier() << endl; + qCInfo(mainprocess) << "here are processes running in this terminal tab... " << tabPage->identifier() << endl; return true; } else { - qCInfo(LogMain) << "no processes running in this terminal tab... " << tabPage->identifier() << endl; + qCInfo(mainprocess) << "no processes running in this terminal tab... " << tabPage->identifier() << endl; } } @@ -533,7 +533,7 @@ void MainWindow::closeTab(const QString &identifier, bool hasConfirmed) showExitConfirmDialog(Utils::CloseType_Tab, tabPage->runningTerminalCount(), this); return; } - qCInfo(LogMain) << "Close tab(" << identifier << ")"; + qCInfo(mainprocess) << "Close tab(" << identifier << ")"; m_tabVisitMap.remove(identifier); m_tabChangeColorMap.remove(identifier); m_tabbar->removeTab(identifier); @@ -548,7 +548,7 @@ void MainWindow::closeTab(const QString &identifier, bool hasConfirmed) focusCurrentPage(); return; } - qCInfo(LogMain) << "Main window closed!"; + qCInfo(mainprocess) << "Main window closed!"; close(); } @@ -569,7 +569,7 @@ void MainWindow::removeTermWidgetPage(const QString &identifier, bool isDelete) // 当所有tab标签页都关闭时,关闭整个MainWindow窗口 if (m_termWidgetPageMap.isEmpty()) { - qCWarning(LogMain) << "No other tabs exist and the main window is closed!"; + qCWarning(mainprocess) << "No other tabs exist and the main window is closed!"; /******** Modify by ut000438 王亮 2020-11-23:fix bug 55552:拖动标签页移动窗口过程中异常最大化 ***************/ //当拖动标签过程中销毁窗口时,不保存销毁的窗口大小 m_IfUseLastSize = false; @@ -623,10 +623,10 @@ bool MainWindow::isFocusOnList() // 判断按钮是否有焦点 if (addButton->hasFocus()) { isFocus = false; - qCInfo(LogMain) << "focus on AddButton"; + qCInfo(mainprocess) << "focus on AddButton"; } } else { - qCInfo(LogMain) << "can not found AddButton in DIconButton"; + qCInfo(mainprocess) << "can not found AddButton in DIconButton"; } QList buttonList = {"DTitlebarDWindowOptionButton", "DTitlebarDWindowMinButton", "DTitlebarDWindowMaxButton", "DTitlebarDWindowCloseButton"}; @@ -637,13 +637,13 @@ bool MainWindow::isFocusOnList() // 判断按钮是否有焦点 if (button->hasFocus()) { isFocus = false; - qCInfo(LogMain) << "focus on " << objectName; + qCInfo(mainprocess) << "focus on " << objectName; } } else { - qCWarning(LogMain) << "can not found objectName in DIconButton"; + qCWarning(mainprocess) << "can not found objectName in DIconButton"; } } - qCInfo(LogMain) << "Is focus on list? " << isFocus; + qCInfo(mainprocess) << "Is focus on list? " << isFocus; return isFocus; } @@ -669,7 +669,7 @@ void MainWindow::closeOtherTab(const QString &identifier, bool hasConfirmed) // 关闭其它窗口,需要检测 for (QString &id : closeTabIdList) { closeTab(id, true); - qCDebug(LogMain) << "Id(" << id << ") of the close tab? "; + qCDebug(mainprocess) << "Id(" << id << ") of the close tab? "; } //如果是不关闭当前页的,最后回到当前页来. @@ -689,7 +689,7 @@ void MainWindow::closeAllTab() // 全部关闭时,不再检测了, for (QString &id : closeTabIdList) { closeTab(id, true); - qCDebug(LogMain) << "Id(" << id << ") of the close tab? "; + qCDebug(mainprocess) << "Id(" << id << ") of the close tab? "; } return; @@ -703,9 +703,9 @@ inline void MainWindow::slotDDialogFinished(int result) DIconButton *closeBtn = titlebar()->findChild("DTitlebarDWindowCloseButton"); if (closeBtn != nullptr) { closeBtn->setFocus(); - qCInfo(LogMain) << "Close button to get focus!"; + qCInfo(mainprocess) << "Close button to get focus!"; } else { - qCWarning(LogMain) << "Can not found DTitlebarDWindowCloseButton in DTitlebar"; + qCWarning(mainprocess) << "Can not found DTitlebarDWindowCloseButton in DTitlebar"; } } /********************* Modify by n014361 wangpeili End ************************/ @@ -732,11 +732,11 @@ void MainWindow::showExitConfirmDialog(Utils::CloseType type, int count, QWidget DIconButton *closeBtn = titlebar()->findChild("DTitlebarDWindowCloseButton"); if ((closeBtn != nullptr) && closeBtn->hasFocus() && (Utils::CloseType_Window == type)) { closeBtnHasfocus = true; - qCInfo(LogMain) << "Before close window, focus widget is close button. "; + qCInfo(mainprocess) << "Before close window, focus widget is close button. "; } if (nullptr == closeBtn) - qCInfo(LogMain) << "Can not found DTitlebarDWindowCloseButton in DTitlebar"; + qCInfo(mainprocess) << "Can not found DTitlebarDWindowCloseButton in DTitlebar"; /********************* Modify by n014361 wangpeili End ************************/ @@ -779,7 +779,7 @@ void MainWindow::focusPage(const QString &identifier) tabPage->focusCurrentTerm(); return; } - qCInfo(LogMain) << "focusTab nullptr identifier" << identifier; + qCInfo(mainprocess) << "focusTab nullptr identifier" << identifier; } void MainWindow::focusCurrentPage() @@ -799,7 +799,7 @@ TermWidgetPage *MainWindow::getPageByIdentifier(const QString &identifier) if (tabPage && tabPage->identifier() == identifier) return tabPage; } - qCInfo(LogMain) << "getPageByIdentifier nullptr identifier" << identifier; + qCInfo(mainprocess) << "getPageByIdentifier nullptr identifier" << identifier; return nullptr; } @@ -906,7 +906,7 @@ void MainWindow::closeEvent(QCloseEvent *event) if ((!m_hasConfirmedClose) && (runningCount != 0)) { // 如果不能马上关闭,并且还在没有最小化. - qCInfo(LogMain) << "Minimal mode or not?" << isMinimized(); + qCInfo(mainprocess) << "Minimal mode or not?" << isMinimized(); if ((runningCount != 0) && isMinimized()) { setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive); } @@ -958,7 +958,7 @@ QString MainWindow::getConfigWindowState() // 启动参数配置的状态值优先于 内部配置的状态值 if (m_properties.contains(StartWindowState)) { QString state = m_properties[StartWindowState].toString(); - qCInfo(LogMain) << "State(" << state << ") of the start window."; + qCInfo(mainprocess) << "State(" << state << ") of the start window."; if ("maximum" == state) windowState = "window_maximum"; else if (state == "splitscreen") @@ -968,7 +968,7 @@ QString MainWindow::getConfigWindowState() else if (state == "fullscreen") windowState = state; else - qCWarning(LogMain) << "Error line state set:" << state << "ignore it!"; + qCWarning(mainprocess) << "Error line state set:" << state << "ignore it!"; } return windowState; } @@ -1106,8 +1106,8 @@ inline void MainWindow::slotShortcutSwitchActivated() { QShortcut *switchShortcut = qobject_cast(sender()); int i = switchShortcut->property("index").toInt(); - qCDebug(LogMain) << "Shortcut key selected label index(" << i - 1 << ")"; - qCDebug(LogMain) << "How many tabs exist in the current window?" << m_tabbar->count(); + qCDebug(mainprocess) << "Shortcut key selected label index(" << i - 1 << ")"; + qCDebug(mainprocess) << "How many tabs exist in the current window?" << m_tabbar->count(); TermWidgetPage *page = currentPage(); if (page) { assert(m_tabbar); @@ -1117,14 +1117,14 @@ inline void MainWindow::slotShortcutSwitchActivated() } if (i - 1 >= m_tabbar->count()) { - qCWarning(LogMain) <<"The index(" << i -1 << ") of the current tab exceeds the total number of the current windows tabs(" << m_tabbar->count() << ")"; + qCWarning(mainprocess) <<"The index(" << i -1 << ") of the current tab exceeds the total number of the current windows tabs(" << m_tabbar->count() << ")"; return; } m_tabbar->setCurrentIndex(i - 1); return; } - qCWarning(LogMain) << "Current Page is Nullptr!"; + qCWarning(mainprocess) << "Current Page is Nullptr!"; } inline void MainWindow::slotShortcutNewTab() @@ -1188,7 +1188,7 @@ inline void MainWindow::slotShortcutHorizonzalSplit() } } } - qCInfo(LogMain) << "Can't split horizonzal again"; + qCInfo(mainprocess) << "Can't split horizonzal again"; } inline void MainWindow::slotShortcutVerticalSplit() @@ -1207,7 +1207,7 @@ inline void MainWindow::slotShortcutVerticalSplit() } } } - qCInfo(LogMain) << "Can't split vertical again"; + qCInfo(mainprocess) << "Can't split vertical again"; } inline void MainWindow::slotShortcutSelectUpperWorkspace() @@ -1242,7 +1242,7 @@ inline void MainWindow::slotShortcutCloseWorkspace() { TermWidgetPage *page = currentPage(); if (page) { - qCInfo(LogMain) << "Close Works pace"; + qCInfo(mainprocess) << "Close Works pace"; page->closeSplit(page->currentTerminal()); } } @@ -1316,7 +1316,7 @@ inline void MainWindow::slotShortcutSelectAll() { TermWidgetPage *page = currentPage(); if (page) { - qCInfo(LogMain) << "Select all pages using the shortcut keys"; + qCInfo(mainprocess) << "Select all pages using the shortcut keys"; page->selectAll(); } } @@ -1357,17 +1357,17 @@ inline void MainWindow::slotShortcutRemoteManage() inline void MainWindow::slotShortcutFocusOut() { - qCInfo(LogMain) << "focusout timinal is activated!" << QKEYSEQUENCE_FOCUSOUT_TIMINAL; + qCInfo(mainprocess) << "focusout timinal is activated!" << QKEYSEQUENCE_FOCUSOUT_TIMINAL; DIconButton *addButton = m_tabbar->findChild("AddButton"); if (addButton != nullptr) addButton->setFocus(); else - qCInfo(LogMain) << "can not found AddButton in DIconButton"; + qCInfo(mainprocess) << "can not found AddButton in DIconButton"; } inline void MainWindow::slotShortcutBuiltinPaste() { - qCInfo(LogMain) << "built in paste shortcut is activated!" << QKEYSEQUENCE_PASTE_BUILTIN; + qCInfo(mainprocess) << "built in paste shortcut is activated!" << QKEYSEQUENCE_PASTE_BUILTIN; TermWidgetPage *page = currentPage(); if (page) page->pasteClipboard(); @@ -1375,7 +1375,7 @@ inline void MainWindow::slotShortcutBuiltinPaste() inline void MainWindow::slotShortcutBuiltinCopy() { - qCInfo(LogMain) << "built in copy shortcut is activated!" << QKEYSEQUENCE_COPY_BUILTIN; + qCInfo(mainprocess) << "built in copy shortcut is activated!" << QKEYSEQUENCE_COPY_BUILTIN; TermWidgetPage *page = currentPage(); if (page) page->copyClipboard(); @@ -1404,13 +1404,13 @@ void MainWindow::showPlugin(const QString &name) if ((name == m_CurrentShowPlugin) && (PLUGIN_TYPE_NONE == m_CurrentShowPlugin)) { // 目前没有列表显示,直接返回 - qCInfo(LogMain) << "no plugin show!"; + qCInfo(mainprocess) << "no plugin show!"; return; } m_CurrentShowPlugin = name; if (name != PLUGIN_TYPE_NONE) - qCInfo(LogMain) << "show Plugin" << name << bSetFocus; + qCInfo(mainprocess) << "show Plugin" << name << bSetFocus; emit showPluginChanged(name, bSetFocus); } @@ -1420,7 +1420,7 @@ void MainWindow::hidePlugin() if (PLUGIN_TYPE_NONE == m_CurrentShowPlugin) return; - qCInfo(LogMain) << "hide Plugin" << m_CurrentShowPlugin; + qCInfo(mainprocess) << "hide Plugin" << m_CurrentShowPlugin; m_CurrentShowPlugin = PLUGIN_TYPE_NONE; emit quakeHidePlugin(); } @@ -1432,7 +1432,7 @@ QString MainWindow::selectedText() if (page->currentTerminal()) return page->currentTerminal()->selectedText(); } - qCInfo(LogMain) << "not point terminal??"; + qCInfo(mainprocess) << "not point terminal??"; return ""; } @@ -1546,7 +1546,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event) } while (false); if (!filterReason.isEmpty()) { - qCInfo(LogMain) << "Esc is not effect, reason:" << filterReason; + qCInfo(mainprocess) << "Esc is not effect, reason:" << filterReason; } else { focusCurrentPage(); showPlugin(PLUGIN_TYPE_NONE); @@ -1575,17 +1575,17 @@ void MainWindow::onWindowSettingChanged(const QString &keyName) m_winInfoConfig->setValue(CONFIG_WINDOW_WIDTH, WINDOW_DEFAULT_WIDTH); m_winInfoConfig->setValue(CONFIG_WINDOW_HEIGHT, WINDOW_DEFAULT_HEIGHT); /******** Modify by nt001000 renfeixiang 2020-05-25: 文件wininfo-config.conf中参数,使用定义更换window_width,window_height End***************/ - qCInfo(LogMain) << "change value change value change value"; + qCInfo(mainprocess) << "change value change value change value"; } else { m_IfUseLastSize = false; } - qCInfo(LogMain) << "settingValue[" << keyName << "] changed to " << state + qCInfo(mainprocess) << "settingValue[" << keyName << "] changed to " << state << ", auto effective when next start!"; return; } // auto_hide_raytheon_window在使用中自动读取生效 if ((QStringLiteral("advanced.window.auto_hide_raytheon_window") == keyName) || (QStringLiteral("advanced.window.use_on_starting") == keyName)) { - qCInfo(LogMain) << "settingValue[" << keyName << "] changed to " << Settings::instance()->OutputtingScroll() + qCInfo(mainprocess) << "settingValue[" << keyName << "] changed to " << Settings::instance()->OutputtingScroll() << ", auto effective when happen"; /***mod begin by ut001121 zhangmeng 20200528 修复BUG28920***/ onAppFocusChangeForQuake(); @@ -1593,12 +1593,12 @@ void MainWindow::onWindowSettingChanged(const QString &keyName) return; } - qCInfo(LogMain) << "settingValue[" << keyName << "] changed is not effective"; + qCInfo(mainprocess) << "settingValue[" << keyName << "] changed is not effective"; } void MainWindow::onShortcutSettingChanged(const QString &keyName) { - qCInfo(LogMain) << "Shortcut[" << keyName << "] changed"; + qCInfo(mainprocess) << "Shortcut[" << keyName << "] changed"; if (m_builtInShortcut.contains(keyName)) { QString value = Settings::instance()->settings->option(keyName)->value().toString(); //m_builtInShortcut[keyName]->setKey(QKeySequence(value)); @@ -1607,13 +1607,13 @@ void MainWindow::onShortcutSettingChanged(const QString &keyName) return; } - qCInfo(LogMain) << "Shortcut[" << keyName << "] changed is unknown!"; + qCInfo(mainprocess) << "Shortcut[" << keyName << "] changed is unknown!"; } void MainWindow::setNewTermPage(TermWidgetPage *termPage, bool activePage) { if (nullptr == termPage) { - qCInfo(LogMain) << "termPage is nullptr!"; + qCInfo(mainprocess) << "termPage is nullptr!"; return; } @@ -1798,7 +1798,7 @@ inline void MainWindow::onUploadFileDialogFinished(int code) } remoteUploadFile(strTxt); } else { - qCWarning(LogMain) << "remoteUploadFile file name is Null"; + qCWarning(mainprocess) << "remoteUploadFile file name is Null"; } } @@ -1886,13 +1886,13 @@ void MainWindow::OnHandleCloseType(int result, Utils::CloseType type) // 弹窗隐藏或消失 Service::instance()->setIsDialogShow(this, false); if (result != 1) { - qCInfo(LogMain) << "user cancle close"; + qCInfo(mainprocess) << "user cancle close"; return; } TermWidgetPage *page = currentPage(); if (nullptr == page) { - qCWarning(LogMain) << "null pointer of currentPage ???"; + qCWarning(mainprocess) << "null pointer of currentPage ???"; return; } @@ -1985,10 +1985,10 @@ void MainWindow::createWindowComplete() void MainWindow::firstTerminalComplete() { m_FirstTerminalCompleteTime = QDateTime::currentDateTime().toMSecsSinceEpoch(); - qCInfo(LogMain) << "app create all complete," << "MainWindowID = " << m_MainWindowID << ",all time use" << m_FirstTerminalCompleteTime - m_ReferedAppStartTime << "ms"; - qCInfo(LogMain) << "before entry use" << m_CreateWindowTime - m_ReferedAppStartTime << "ms"; + qCInfo(mainprocess) << "app create all complete," << "MainWindowID = " << m_MainWindowID << ",all time use" << m_FirstTerminalCompleteTime - m_ReferedAppStartTime << "ms"; + qCInfo(mainprocess) << "before entry use" << m_CreateWindowTime - m_ReferedAppStartTime << "ms"; // 创建mainwidow时间,这个时候terminal并没有创建好,不能代表什么。 - qCInfo(LogMain) << "cretae first Terminal use" << m_FirstTerminalCompleteTime - m_CreateWindowTime << "ms"; + qCInfo(mainprocess) << "cretae first Terminal use" << m_FirstTerminalCompleteTime - m_CreateWindowTime << "ms"; } QObjectList MainWindow::getNamedChildren(QObject *obj) @@ -2512,7 +2512,7 @@ void MainWindow::onCommandActionTriggered() { QAction *commandAction = qobject_cast(sender()); - qCInfo(LogMain) << "commandAction->data().toString() is triggered" << this; + qCInfo(mainprocess) << "commandAction->data().toString() is triggered" << this; if (!this->isActiveWindow()) return ; @@ -2568,37 +2568,37 @@ void NormalWindow::initTitleBar() if (addButton != nullptr) addButton->setFocusPolicy(Qt::TabFocus); else - qCWarning(LogMain) << "can not found AddButton in DIconButton"; + qCWarning(mainprocess) << "can not found AddButton in DIconButton"; DIconButton *optionBtn = titlebar()->findChild("DTitlebarDWindowOptionButton"); if (optionBtn != nullptr) optionBtn->setFocusPolicy(Qt::TabFocus); else - qCWarning(LogMain) << "can not found DTitlebarDWindowOptionButton in DTitlebar"; + qCWarning(mainprocess) << "can not found DTitlebarDWindowOptionButton in DTitlebar"; QWidget *quitFullscreenBtn = titlebar()->findChild("DTitlebarDWindowQuitFullscreenButton"); if (quitFullscreenBtn != nullptr) quitFullscreenBtn->setFocusPolicy(Qt::TabFocus); else - qCWarning(LogMain) << "can not found DTitlebarDWindowQuitFullscreenButton in DTitlebar"; + qCWarning(mainprocess) << "can not found DTitlebarDWindowQuitFullscreenButton in DTitlebar"; DIconButton *minBtn = titlebar()->findChild("DTitlebarDWindowMinButton"); if (minBtn != nullptr) minBtn->setFocusPolicy(Qt::TabFocus); else - qCWarning(LogMain) << "can not found DTitlebarDWindowMinButton in DTitlebar"; + qCWarning(mainprocess) << "can not found DTitlebarDWindowMinButton in DTitlebar"; DIconButton *maxBtn = titlebar()->findChild("DTitlebarDWindowMaxButton"); if (maxBtn != nullptr) maxBtn->setFocusPolicy(Qt::TabFocus); else - qCWarning(LogMain) << "can not found DTitlebarDWindowMaxButton in DTitlebar"; + qCWarning(mainprocess) << "can not found DTitlebarDWindowMaxButton in DTitlebar"; DIconButton *closeBtn = titlebar()->findChild("DTitlebarDWindowCloseButton"); if (closeBtn != nullptr) closeBtn->setFocusPolicy(Qt::TabFocus); else - qCWarning(LogMain) << "can not found DTitlebarDWindowCloseButton in DTitlebar"; + qCWarning(mainprocess) << "can not found DTitlebarDWindowCloseButton in DTitlebar"; if (addButton != nullptr && optionBtn != nullptr && quitFullscreenBtn != nullptr && minBtn != nullptr && maxBtn != nullptr && closeBtn != nullptr) { QWidget::setTabOrder(addButton, optionBtn); @@ -2628,8 +2628,8 @@ void NormalWindow::initWindowAttribute() m_IfUseLastSize = true; int saveWidth = m_winInfoConfig->value(CONFIG_WINDOW_WIDTH).toInt(); int saveHeight = m_winInfoConfig->value(CONFIG_WINDOW_HEIGHT).toInt(); - qCInfo(LogMain) << "load window_width: " << saveWidth; - qCInfo(LogMain) << "load window_height: " << saveHeight; + qCInfo(mainprocess) << "load window_width: " << saveWidth; + qCInfo(mainprocess) << "load window_height: " << saveHeight; // 如果配置文件没有数据 if (0 == saveWidth || 0 == saveHeight) { saveWidth = WINDOW_DEFAULT_WIDTH; @@ -2662,7 +2662,7 @@ void NormalWindow::saveWindowSize() // 记录最后一个正常窗口的大小 m_winInfoConfig->setValue(CONFIG_WINDOW_WIDTH, width()); m_winInfoConfig->setValue(CONFIG_WINDOW_HEIGHT, height()); - qCInfo(LogMain) << "save windows size:" << width() << height(); + qCInfo(mainprocess) << "save windows size:" << width() << height(); /******** Modify by nt001000 renfeixiang 2020-05-25: 文件wininfo-config.conf中参数,使用定义更换window_width,window_height End***************/ } } @@ -2754,32 +2754,32 @@ void QuakeWindow::initTitleBar() if (addButton != nullptr) addButton->setFocusPolicy(Qt::TabFocus); else - qCInfo(LogMain) << "can not found AddButton in DIconButton"; + qCInfo(mainprocess) << "can not found AddButton in DIconButton"; // 雷神下其它控件一律没有焦点 DIconButton *optionBtn = titlebar()->findChild("DTitlebarDWindowOptionButton"); if (optionBtn != nullptr) optionBtn->setFocusPolicy(Qt::NoFocus); else - qCInfo(LogMain) << "can not found DTitlebarDWindowOptionButton in DTitlebar"; + qCInfo(mainprocess) << "can not found DTitlebarDWindowOptionButton in DTitlebar"; DIconButton *minBtn = titlebar()->findChild("DTitlebarDWindowMinButton"); if (minBtn != nullptr) minBtn->setFocusPolicy(Qt::NoFocus); else - qCInfo(LogMain) << "can not found DTitlebarDWindowMinButton in DTitlebar"; + qCInfo(mainprocess) << "can not found DTitlebarDWindowMinButton in DTitlebar"; DIconButton *maxBtn = titlebar()->findChild("DTitlebarDWindowMaxButton"); if (maxBtn != nullptr) maxBtn->setFocusPolicy(Qt::NoFocus); else - qCInfo(LogMain) << "can not found DTitlebarDWindowMaxButton in DTitlebar"; + qCInfo(mainprocess) << "can not found DTitlebarDWindowMaxButton in DTitlebar"; DIconButton *closeBtn = titlebar()->findChild("DTitlebarDWindowCloseButton"); if (closeBtn != nullptr) closeBtn->setFocusPolicy(Qt::NoFocus); else - qCInfo(LogMain) << "can not found DTitlebarDWindowCloseButton in DTitlebar"; + qCInfo(mainprocess) << "can not found DTitlebarDWindowCloseButton in DTitlebar"; /*QWidget::setTabOrder(addButton, optionBtn); QWidget::setTabOrder(optionBtn, minBtn); @@ -2791,7 +2791,7 @@ void QuakeWindow::initTitleBar() void QuakeWindow::slotWorkAreaResized() { - qCInfo(LogMain) << "Workspace size change!"; + qCInfo(mainprocess) << "Workspace size change!"; /******** Modify by nt001000 renfeixiang 2020-05-20:修改成只需要设置雷神窗口宽度,根据字体高度设置雷神最小高度 Begin***************/ setMinimumWidth(QApplication::desktop()->availableGeometry().width()); setWindowMinHeightForFont(); @@ -2858,7 +2858,7 @@ void QuakeWindow::saveWindowSize() //Modify by ut001000 renfeixiang 2020-11-16 非雷神动画时,在保存雷神窗口的高度到配置文件 if (isNotAnimation) { m_winInfoConfig->setValue(CONFIG_QUAKE_WINDOW_HEIGHT, height()); - qCInfo(LogMain) << "save quake_window_Height:" << height() << m_desktopMap[m_desktopIndex] << m_desktopIndex; + qCInfo(mainprocess) << "save quake_window_Height:" << height() << m_desktopMap[m_desktopIndex] << m_desktopIndex; } /******** Modify by nt001000 renfeixiang 2020-05-25: 文件wininfo-config.conf中参数,使用定义更换quake_window_Height End***************/ } @@ -2915,7 +2915,7 @@ void QuakeWindow::setWindowMinHeightForFont() /******** Add by nt001000 renfeixiang 2020-05-20:增加雷神窗口根据字体和字体大小设置最小高度函数 End***************/ void QuakeWindow::updateMinHeight() { - qCInfo(LogMain) << "Start update min height"; + qCInfo(mainprocess) << "Start update min height"; bool hasHorizontalSplit = false; int count = m_termStackWidget->count(); for (int i = 0; i < count; i++) { @@ -2989,7 +2989,7 @@ inline void QuakeWindow::onTopToBottomAnimationFinished() void QuakeWindow::bottomToTopAnimation() { if (!isNotAnimation || nullptr == currentPage()) { - qCInfo(LogMain) << "bottomToTopAnimation no need to execute."; + qCInfo(mainprocess) << "bottomToTopAnimation no need to execute."; return; } @@ -3060,7 +3060,7 @@ xcb_atom_t QuakeWindow::internAtom(const char *name, bool only_if_exists) void QuakeWindow::sendWindowForhibitMove(bool forhibit) { if(!QX11Info::connection()){ - qCWarning(LogMain) << "QX11Info::connection() is " << QX11Info::connection(); + qCWarning(mainprocess) << "QX11Info::connection() is " << QX11Info::connection(); return ; } diff --git a/src/main/service.cpp b/src/main/service.cpp index 3b2896780..222f222ad 100644 --- a/src/main/service.cpp +++ b/src/main/service.cpp @@ -25,7 +25,7 @@ Service *Service::g_pService = nullptr; -Q_DECLARE_LOGGING_CATEGORY(LogMain) +Q_DECLARE_LOGGING_CATEGORY(mainprocess) Service *Service::instance() { @@ -131,7 +131,7 @@ void Service::showHideOpacityAndBlurOptions(bool isShow) { QWidget *rightFrame = m_settingDialog->findChild("RightFrame"); if (nullptr == rightFrame) { - qCWarning(LogMain) << "can not found RightFrame in QWidget"; + qCWarning(mainprocess) << "can not found RightFrame in QWidget"; return; } @@ -211,14 +211,14 @@ bool Service::isWindowEffectEnabled() QList list = response.arguments(); QString wmName = list.first().toString(); if (wmName == "deepin wm") { - qCInfo(LogMain) << "The window effects is on"; + qCInfo(mainprocess) << "The window effects is on"; return true; } } else { - qCWarning(LogMain) << "call CurrentWM Fail!" << response.errorMessage(); + qCWarning(mainprocess) << "call CurrentWM Fail!" << response.errorMessage(); } - qCWarning(LogMain) << "The window effects is off"; + qCWarning(mainprocess) << "The window effects is off"; return false; } @@ -266,7 +266,7 @@ QMap Service::getShells() } } while (!shellLine.isNull()); } else { - qCWarning(LogMain) << "read /etc/shells fail! error : " << shellsInfo.error(); + qCWarning(mainprocess) << "read /etc/shells fail! error : " << shellsInfo.error(); } // 关闭文件 shellsInfo.close(); @@ -313,7 +313,7 @@ void Service::showSettingDialog(MainWindow *pOwner) Settings::instance()->reloadShellOptions(); m_settingDialog->show(); } else { - qCWarning(LogMain) << "No setting dialog."; + qCWarning(mainprocess) << "No setting dialog."; return; } // 激活窗口 @@ -433,7 +433,7 @@ void Service::EntryTerminal(QStringList arguments, bool isMain) return; // 超出最大窗口数量 if(WindowsManager::instance()->widgetCount() >= MAXWIDGETCOUNT) { - qCWarning(LogMain) << QString("terminal cannot be created: %1/%2 ") + qCWarning(mainprocess) << QString("terminal cannot be created: %1/%2 ") .arg(WindowsManager::instance()->widgetCount()) .arg(MAXWIDGETCOUNT) ; @@ -496,7 +496,7 @@ void Service::setIsDialogShow(QWidget *parent, bool isDialogShow) if(nullptr == window) return; if (window == WindowsManager::instance()->getQuakeWindow()) { - qCInfo(LogMain) << "QuakeWindow show or hide dialog " << isDialogShow; + qCInfo(mainprocess) << "QuakeWindow show or hide dialog " << isDialogShow; m_isDialogShow = isDialogShow; } diff --git a/src/main/terminalapplication.cpp b/src/main/terminalapplication.cpp index 958ac69f4..c30a8f330 100644 --- a/src/main/terminalapplication.cpp +++ b/src/main/terminalapplication.cpp @@ -10,7 +10,7 @@ // qt #include -Q_DECLARE_LOGGING_CATEGORY(LogMain) +Q_DECLARE_LOGGING_CATEGORY(mainprocess) TerminalApplication::TerminalApplication(int &argc, char *argv[]) : DApplication(argc, argv) { @@ -54,7 +54,7 @@ qint64 TerminalApplication::getStartTime() void TerminalApplication::handleQuitAction() { - qCInfo(LogMain) << "Handle quit action"; + qCInfo(mainprocess) << "Handle quit action"; activeWindow()->close(); } @@ -75,7 +75,7 @@ bool TerminalApplication::notify(QObject *object, QEvent *event) // 包含edit if (m_keySequenceList.contains(edit)) { m_keySequenceList.removeOne(edit); - qCInfo(LogMain) << "remove editing when foucs out"; + qCInfo(mainprocess) << "remove editing when foucs out"; } } if (QEvent::KeyPress == event->type()) { @@ -98,7 +98,7 @@ bool TerminalApplication::notify(QObject *object, QEvent *event) QMouseEvent mouseEvent(QEvent::MouseButtonPress, QPoint(0, 0), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QApplication::sendEvent(childern[0], &mouseEvent); // 记录当前KeySequence已经进入编辑状态 - qCInfo(LogMain) << "KeySequence in Editing"; + qCInfo(mainprocess) << "KeySequence in Editing"; m_keySequenceList.append(edit); return true; } @@ -107,7 +107,7 @@ bool TerminalApplication::notify(QObject *object, QEvent *event) if (m_keySequenceList.contains(edit)) { // 其他情况的按键,移除edit m_keySequenceList.removeOne(edit); - qCInfo(LogMain) << "remove editing when others"; + qCInfo(mainprocess) << "remove editing when others"; } } } @@ -206,7 +206,7 @@ bool TerminalApplication::notify(QObject *object, QEvent *event) #if 0 // 焦点检测 if (event->type() == QEvent::FocusIn) - qCInfo(LogMain) << "FocusIn:" << object; + qCInfo(mainprocess) << "FocusIn:" << object; #endif diff --git a/src/main/windowsmanager.cpp b/src/main/windowsmanager.cpp index 343a38905..d27c27997 100644 --- a/src/main/windowsmanager.cpp +++ b/src/main/windowsmanager.cpp @@ -11,7 +11,7 @@ #include -Q_DECLARE_LOGGING_CATEGORY(LogMain) +Q_DECLARE_LOGGING_CATEGORY(mainprocess) WindowsManager *WindowsManager::pManager = new WindowsManager(); WindowsManager *WindowsManager::instance() @@ -22,7 +22,7 @@ WindowsManager *WindowsManager::instance() void WindowsManager::runQuakeWindow(TermProperties properties) { if (nullptr == m_quakeWindow) { - qCInfo(LogMain) << "Create QuakeWindow!"; + qCInfo(mainprocess) << "Create QuakeWindow!"; m_quakeWindow = new QuakeWindow(properties); //Add by ut001000 renfeixiang 2020-11-16 设置开始雷神动画效果标志 m_quakeWindow->setAnimationFlag(false); @@ -86,13 +86,13 @@ void WindowsManager::createNormalWindow(TermProperties properties, bool isShow) MainWindow *newWindow = new NormalWindow(newProperties); m_normalWindowList << newWindow; - qCInfo(LogMain) << "create NormalWindow, current count =" << m_normalWindowList.count() + qCInfo(mainprocess) << "create NormalWindow, current count =" << m_normalWindowList.count() << ", SingleFlag" << newProperties[SingleFlag].toBool(); if(isShow) newWindow->show(); qint64 newMainWindowTime = newWindow->createNewMainWindowTime(); QString strNewMainWindowTime = GRAB_POINT + LOGO_TYPE + CREATE_NEW_MAINWINDOE + QString::number(newMainWindowTime); - qCInfo(LogMain) << "Create NormalWindow Time:" << qPrintable(strNewMainWindowTime); + qCInfo(mainprocess) << "Create NormalWindow Time:" << qPrintable(strNewMainWindowTime); } void WindowsManager::onMainwindowClosed(MainWindow *window) @@ -112,7 +112,7 @@ void WindowsManager::onMainwindowClosed(MainWindow *window) m_normalWindowList.removeOne(window); } else { //Q_ASSERT(false); - qCWarning(LogMain) << "unkown windows closed " << window; + qCWarning(mainprocess) << "unkown windows closed " << window; } window->deleteLater(); diff --git a/src/remotemanage/remotemanagementpanel.cpp b/src/remotemanage/remotemanagementpanel.cpp index 8e324fa25..af5d198cd 100644 --- a/src/remotemanage/remotemanagementpanel.cpp +++ b/src/remotemanage/remotemanagementpanel.cpp @@ -11,9 +11,9 @@ #include #ifdef QT_DEBUG -Q_LOGGING_CATEGORY(LogRemoteManage,"log.terminal.RemoteManage.work") +Q_LOGGING_CATEGORY(remotemanage,"org.deepin.terminal.remotemanage") #else -Q_LOGGING_CATEGORY(LogRemoteManage,"log.terminal.RemoteManage.work",QtInfoMsg) +Q_LOGGING_CATEGORY(remotemanage,"org.deepin.terminal.remotemanage",QtInfoMsg) #endif RemoteManagementPanel::RemoteManagementPanel(QWidget *parent) : CommonPanel(parent) @@ -34,7 +34,7 @@ void RemoteManagementPanel::refreshPanel() void RemoteManagementPanel::setFocusInPanel() { - qCInfo(LogRemoteManage) << "RemoteManagementPanel focus in Panel."; + qCInfo(remotemanage) << "RemoteManagementPanel focus in Panel."; if (m_searchEdit->isVisible()) { // 搜索框显示 // 设置焦点 @@ -53,7 +53,7 @@ void RemoteManagementPanel::setFocusInPanel() void RemoteManagementPanel::setFocusBack(const QString &strGroup) { - qCInfo(LogRemoteManage) << "RemoteManagementPanel return from RemoteManageGroup"; + qCInfo(remotemanage) << "RemoteManagementPanel return from RemoteManageGroup"; // 返回前判断之前是否要有焦点 if (m_listWidget->getFocusState()) { // 要有焦点 @@ -131,7 +131,7 @@ void RemoteManagementPanel::onItemClicked(const QString &key) if (nullptr != remote) emit doConnectServer(remote); else - qCInfo(LogRemoteManage) << "can't connect to remote" << key; + qCInfo(remotemanage) << "can't connect to remote" << key; } void RemoteManagementPanel::showCurSearchResult() @@ -145,7 +145,7 @@ void RemoteManagementPanel::showCurSearchResult() void RemoteManagementPanel::showAddServerConfigDlg() { - qCInfo(LogRemoteManage) << "RemoteManagementPanel show add server config dialog."; + qCInfo(remotemanage) << "RemoteManagementPanel show add server config dialog."; // 判断控件是否有焦点 bool focusState = m_pushButton->hasFocus(); // 弹窗显示 @@ -260,13 +260,13 @@ void RemoteManagementPanel::initUI() // 下一个 或 列表为空, 焦点定位到添加按钮上 m_pushButton->setFocus(); m_listWidget->clearIndex(); - qCInfo(LogRemoteManage) << "set focus on add pushButton"; + qCInfo(remotemanage) << "set focus on add pushButton"; } else if (Qt::BacktabFocusReason == type) { // 判断是否可见,可见设置焦点 if (m_searchEdit->isVisible()) { m_searchEdit->lineEdit()->setFocus(); m_listWidget->clearIndex(); - qCInfo(LogRemoteManage) << "set focus on add search edit"; + qCInfo(remotemanage) << "set focus on add search edit"; } } }); diff --git a/src/remotemanage/remotemanagementplugn.cpp b/src/remotemanage/remotemanagementplugn.cpp index eb26db464..422f0382c 100644 --- a/src/remotemanage/remotemanagementplugn.cpp +++ b/src/remotemanage/remotemanagementplugn.cpp @@ -12,7 +12,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogRemoteManage) +Q_DECLARE_LOGGING_CATEGORY(remotemanage) RemoteManagementPlugin::RemoteManagementPlugin(QObject *parent) : MainWindowPluginInterface(parent) { @@ -22,7 +22,7 @@ RemoteManagementPlugin::RemoteManagementPlugin(QObject *parent) : MainWindowPlug void RemoteManagementPlugin::initPlugin(MainWindow *mainWindow) { - qCInfo(LogRemoteManage) << "RemoteManagementPlugin init Plugin."; + qCInfo(remotemanage) << "RemoteManagementPlugin init Plugin."; m_mainWindow = mainWindow; //initRemoteManagementTopPanel(); connect(m_mainWindow, &MainWindow::showPluginChanged, this, [ = ](const QString name, bool bSetFocus) { @@ -66,7 +66,7 @@ void RemoteManagementPlugin::initPlugin(MainWindow *mainWindow) // 焦点在列表上,隐藏时,焦点现在当前窗口上 if (m_mainWindow->isFocusOnList()) { m_mainWindow->focusCurrentPage(); - qCInfo(LogRemoteManage) << "focus on remote list, hide remote list and set foucs on terminal"; + qCInfo(remotemanage) << "focus on remote list, hide remote list and set foucs on terminal"; } getRemoteManagementTopPanel()->hide(); }); @@ -101,7 +101,7 @@ void RemoteManagementPlugin::initRemoteManagementTopPanel() void RemoteManagementPlugin::doCennectServer(ServerConfig *curServer) { - qCInfo(LogRemoteManage) << "RemoteManagementPlugin do connect server."; + qCInfo(remotemanage) << "RemoteManagementPlugin do connect server."; if (nullptr != curServer) { QString shellFile = createShellFile(curServer); @@ -126,19 +126,19 @@ void RemoteManagementPlugin::doCennectServer(ServerConfig *curServer) TermWidget *term = m_mainWindow->currentActivatedTerminal(); if (!term) { // 若term为空 - qCInfo(LogRemoteManage) << "current terminal is null"; + qCInfo(remotemanage) << "current terminal is null"; } // 判断是否连接服务器 if (!term->isInRemoteServer()) { // 没有连接上 - qCWarning(LogRemoteManage) << "disconnect to server"; + qCWarning(remotemanage) << "disconnect to server"; return; } // 标记此term连接远程 term->setIsConnectRemote(true); // 设置远程主机 term->modifyRemoteTabTitle(*curServer); - qCInfo(LogRemoteManage) << "connect to server"; + qCInfo(remotemanage) << "connect to server"; // 编码 setRemoteEncode(curServer->m_encoding); // 退格键 @@ -166,7 +166,7 @@ inline QString RemoteManagementPlugin::convertStringToAscii(const QString &strSr QString RemoteManagementPlugin::createShellFile(ServerConfig *curServer) { - qCInfo(LogRemoteManage) << "RemoteManagementPlugin create temporary shell file."; + qCInfo(remotemanage) << "RemoteManagementPlugin create temporary shell file."; // 首先读取通用模板 QFile sourceFile(":/other/ssh_login.sh"); QString fileString; @@ -226,7 +226,7 @@ void RemoteManagementPlugin::setRemoteEncode(QString encode) if (!encode.isNull() && !encode.isEmpty()) { // 设置当前窗口的编码 term->setTextCodec(QTextCodec::codecForName(encode.toLocal8Bit())); - qCInfo(LogRemoteManage) << "Remote encode " << encode; + qCInfo(remotemanage) << "Remote encode " << encode; } // 记录远程编码 term->setRemoteEncode(encode); @@ -247,7 +247,7 @@ void RemoteManagementPlugin::setBackspaceKey(TermWidget *term, QString backspace else if ("tty" == backspaceKey) term->setBackspaceMode(EraseMode_TTY); - qCInfo(LogRemoteManage) << "backspace mode " << backspaceKey; + qCInfo(remotemanage) << "backspace mode " << backspaceKey; } void RemoteManagementPlugin::setDeleteKey(TermWidget *term, QString deleteKey) @@ -263,5 +263,5 @@ void RemoteManagementPlugin::setDeleteKey(TermWidget *term, QString deleteKey) else if ("tty" == deleteKey) term->setDeleteMode(EraseMode_TTY); - qCInfo(LogRemoteManage) << "delete mode " << deleteKey; + qCInfo(remotemanage) << "delete mode " << deleteKey; } diff --git a/src/remotemanage/remotemanagementsearchpanel.cpp b/src/remotemanage/remotemanagementsearchpanel.cpp index 5b63f8ba8..b68027e81 100644 --- a/src/remotemanage/remotemanagementsearchpanel.cpp +++ b/src/remotemanage/remotemanagementsearchpanel.cpp @@ -17,7 +17,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogRemoteManage) +Q_DECLARE_LOGGING_CATEGORY(remotemanage) RemoteManagementSearchPanel::RemoteManagementSearchPanel(QWidget *parent) : CommonPanel(parent) { @@ -85,13 +85,13 @@ inline void RemoteManagementSearchPanel::handleListViewFocusOut(Qt::FocusReason // tab 进入 + QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Tab, Qt::MetaModifier); QApplication::sendEvent(Utils::getMainWindow(this), &keyPress); - qCInfo(LogRemoteManage) << "search panel focus on '+'"; + qCInfo(remotemanage) << "search panel focus on '+'"; m_listWidget->clearIndex(); } else if (Qt::BacktabFocusReason == type || Qt::NoFocusReason == type) { // shift + tab 返回 返回键 // 列表为空,也返回到返回键上 m_rebackButton->setFocus(); m_listWidget->clearIndex(); - qCInfo(LogRemoteManage) << "search panel type" << type; + qCInfo(remotemanage) << "search panel type" << type; } } @@ -134,7 +134,7 @@ void RemoteManagementSearchPanel::onItemClicked(const QString &key) if (nullptr != remote) emit doConnectServer(remote); else - qCInfo(LogRemoteManage) << "can't connect to remote" << key; + qCInfo(remotemanage) << "can't connect to remote" << key; } @@ -145,7 +145,7 @@ void RemoteManagementSearchPanel::onFocusOutList(Qt::FocusReason type) // tab 进入 + QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Tab, Qt::MetaModifier); QApplication::sendEvent(Utils::getMainWindow(this), &keyPress); - qCInfo(LogRemoteManage) << "search panel focus to '+'"; + qCInfo(remotemanage) << "search panel focus to '+'"; } } @@ -173,7 +173,7 @@ void RemoteManagementSearchPanel::clearAllFocus() void RemoteManagementSearchPanel::setFocusBack(const QString &strGroup, bool isFocusOn, int prevIndex) { - qCInfo(LogRemoteManage) << "RemoteManagementSearchPanel return from RemoteManagementGroup."; + qCInfo(remotemanage) << "RemoteManagementSearchPanel return from RemoteManagementGroup."; // 返回前判断之前是否要有焦点 if (isFocusOn) { // 要有焦点 diff --git a/src/remotemanage/remotemanagementtoppanel.cpp b/src/remotemanage/remotemanagementtoppanel.cpp index 154b4e1fb..e5cde2778 100644 --- a/src/remotemanage/remotemanagementtoppanel.cpp +++ b/src/remotemanage/remotemanagementtoppanel.cpp @@ -10,7 +10,7 @@ #include #include #include -Q_DECLARE_LOGGING_CATEGORY(LogRemoteManage) +Q_DECLARE_LOGGING_CATEGORY(remotemanage) const int animationDuration = 300; @@ -64,7 +64,7 @@ void RemoteManagementTopPanel::show() // 清空栈 m_filterStack.clear(); m_prevPanelStack.clear(); - qCInfo(LogRemoteManage) << "show remote panel! stack clear"; + qCInfo(remotemanage) << "show remote panel! stack clear"; } void RemoteManagementTopPanel::setFocusInPanel() @@ -74,7 +74,7 @@ void RemoteManagementTopPanel::setFocusInPanel() void RemoteManagementTopPanel::showSearchPanel(const QString &strFilter) { - qCInfo(LogRemoteManage) << "RemoteManagementTopPanel show search panel."; + qCInfo(remotemanage) << "RemoteManagementTopPanel show search panel."; // 记录搜索界面的搜索条件 m_filterStack.push_back(strFilter); // 设置搜索界面大小 @@ -106,7 +106,7 @@ void RemoteManagementTopPanel::showSearchPanel(const QString &strFilter) connect(animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater); } else { animation1->deleteLater(); - qCWarning(LogRemoteManage) << "unknow current panel!"; + qCWarning(remotemanage) << "unknow current panel!"; return; } // 执行动画 @@ -126,7 +126,7 @@ void RemoteManagementTopPanel::showSearchPanel(const QString &strFilter) void RemoteManagementTopPanel::showGroupPanel(const QString &strGroupName, bool isFocusOn) { - qCInfo(LogRemoteManage) << "RemoteManagementTopPanel show group panel."; + qCInfo(remotemanage) << "RemoteManagementTopPanel show group panel."; // 记录当前分组 m_group = strGroupName; // 设置分组界面大小 @@ -151,7 +151,7 @@ void RemoteManagementTopPanel::showGroupPanel(const QString &strGroupName, bool connect(animation, &QPropertyAnimation::finished, m_remoteManagementPanel, &QWidget::hide); connect(animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater); } else { - qCWarning(LogRemoteManage) << "unknow current panel!"; + qCWarning(remotemanage) << "unknow current panel!"; animation1->deleteLater(); return; } @@ -169,7 +169,7 @@ void RemoteManagementTopPanel::showGroupPanel(const QString &strGroupName, bool MainWindow *w = Utils::getMainWindow(this); if(w) w->focusCurrentPage(); - qCInfo(LogRemoteManage) << "show group but not focus in group"; + qCInfo(remotemanage) << "show group but not focus in group"; } // 记录当前窗口为前一个窗口 @@ -192,20 +192,20 @@ void RemoteManagementTopPanel::showGroupPanel(const QString &strGroupName, bool void RemoteManagementTopPanel::showPrevPanel() { - qCInfo(LogRemoteManage) << "RemoteManagementTopPanel show previous panel."; + qCInfo(remotemanage) << "RemoteManagementTopPanel show previous panel."; PanelState state; ServerConfigManager::PanelType prevType; // 栈为空 if (m_prevPanelStack.isEmpty()) { // 返回 - qCInfo(LogRemoteManage) << "stack is empty! return to remote first panel"; + qCInfo(remotemanage) << "stack is empty! return to remote first panel"; // 栈为空,返回主界面 prevType = ServerConfigManager::PanelType_Manage; } else { // 获取前一个界面的类型,此界面为现在要显示的界面 state = m_prevPanelStack.pop(); prevType = state.m_type; - qCInfo(LogRemoteManage) << "Gets the reality type of the previous interface: " << prevType; + qCInfo(remotemanage) << "Gets the reality type of the previous interface: " << prevType; } // 动画效果 要隐藏的界面 @@ -221,7 +221,7 @@ void RemoteManagementTopPanel::showPrevPanel() connect(animation, &QPropertyAnimation::finished, m_serverConfigGroupPanel, &QWidget::hide); connect(animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater); } else { - qCWarning(LogRemoteManage) << "unknow panel to hide!" << m_currentPanelType; + qCWarning(remotemanage) << "unknow panel to hide!" << m_currentPanelType; } // 动画效果 要显示的界面 @@ -235,7 +235,7 @@ void RemoteManagementTopPanel::showPrevPanel() // 清空栈 m_prevPanelStack.clear(); m_filterStack.clear(); - qCInfo(LogRemoteManage) << "remote clear stack"; + qCInfo(remotemanage) << "remote clear stack"; // 动画效果的设置 animation1 = new QPropertyAnimation(m_remoteManagementPanel, "geometry"); connect(animation1, &QPropertyAnimation::finished, animation1, &QPropertyAnimation::deleteLater); @@ -252,7 +252,7 @@ void RemoteManagementTopPanel::showPrevPanel() case ServerConfigManager::PanelType_Search: { // 刷新列表 => 搜索框能被返回,只能是全局搜索 if (m_filterStack.isEmpty()) { - qCWarning(LogRemoteManage) << "error: filter stack is empty!"; + qCWarning(remotemanage) << "error: filter stack is empty!"; return; } // 取最上一个 @@ -270,7 +270,7 @@ void RemoteManagementTopPanel::showPrevPanel() break; } if (nullptr == animation || nullptr == animation1) { - qCWarning(LogRemoteManage) << "do not has animation"; + qCWarning(remotemanage) << "do not has animation"; if (nullptr != animation1) animation1->deleteLater(); @@ -303,7 +303,7 @@ void RemoteManagementTopPanel::showPrevPanel() m_remoteManagementSearchPanel->setFocusBack(m_group, state.m_isFocusOn, state.m_currentListIndex); } } else { - qCWarning(LogRemoteManage) << "unknow panel"; + qCWarning(remotemanage) << "unknow panel"; } } diff --git a/src/remotemanage/serverconfiggrouppanel.cpp b/src/remotemanage/serverconfiggrouppanel.cpp index ca8b63cc3..336dae297 100644 --- a/src/remotemanage/serverconfiggrouppanel.cpp +++ b/src/remotemanage/serverconfiggrouppanel.cpp @@ -17,7 +17,7 @@ #include #define GROUPSEARCHWIDTH 172 -Q_DECLARE_LOGGING_CATEGORY(LogRemoteManage) +Q_DECLARE_LOGGING_CATEGORY(remotemanage) ServerConfigGroupPanel::ServerConfigGroupPanel(QWidget *parent) : CommonPanel(parent) { @@ -82,7 +82,7 @@ inline void ServerConfigGroupPanel::onListViewFocusOut(Qt::FocusReason type) return; } if (Qt::TabFocusReason == type) { - qCInfo(LogRemoteManage) << "group focus out!"; + qCInfo(remotemanage) << "group focus out!"; QKeyEvent keyPress(QEvent::KeyPress, Qt::Key_Tab, Qt::MetaModifier); QApplication::sendEvent(Utils::getMainWindow(this), &keyPress); m_listWidget->clearIndex(); @@ -95,7 +95,7 @@ inline void ServerConfigGroupPanel::onListViewFocusOut(Qt::FocusReason type) m_listWidget->clearIndex(); } else if (Qt::NoFocusReason == type) { - qCInfo(LogRemoteManage) << "group NoFocusReason"; + qCInfo(remotemanage) << "group NoFocusReason"; int isFocus = false; // 列表没有内容,焦点返回到返回键上 if (m_listWidget->hasFocus() || m_rebackButton->hasFocus()) @@ -113,7 +113,7 @@ inline void ServerConfigGroupPanel::onListViewFocusOut(Qt::FocusReason type) inline void ServerConfigGroupPanel::onRefreshList() { - qCInfo(LogRemoteManage) << "group refresh list"; + qCInfo(remotemanage) << "group refresh list"; if (m_isShow) { refreshData(m_groupName); QMap> &configMap = ServerConfigManager::instance()->getServerConfigs(); @@ -127,7 +127,7 @@ inline void ServerConfigGroupPanel::onRefreshList() void ServerConfigGroupPanel::refreshData(const QString &groupName) { - qCInfo(LogRemoteManage) << "Refresh Data!"; + qCInfo(remotemanage) << "Refresh Data!"; m_groupName = groupName; m_listWidget->clearData(); ServerConfigManager::instance()->refreshServerList(ServerConfigManager::PanelType_Group, m_listWidget, "", groupName); @@ -187,5 +187,5 @@ void ServerConfigGroupPanel::onItemClicked(const QString &key) if (nullptr != remote) emit doConnectServer(remote); else - qCWarning(LogRemoteManage) << "can't connect to remote" << key; + qCWarning(remotemanage) << "can't connect to remote" << key; } diff --git a/src/remotemanage/serverconfigmanager.cpp b/src/remotemanage/serverconfigmanager.cpp index 297f1959c..3ffb0b208 100644 --- a/src/remotemanage/serverconfigmanager.cpp +++ b/src/remotemanage/serverconfigmanager.cpp @@ -15,7 +15,7 @@ #undef signals #include -Q_DECLARE_LOGGING_CATEGORY(LogRemoteManage) +Q_DECLARE_LOGGING_CATEGORY(remotemanage) // 密码回调 struct PasswordReBack { @@ -55,7 +55,7 @@ void ServerConfigManager::settServerConfig(USettings &commandsSettings, const QS void ServerConfigManager::fillManagePanel(ListView *listview) { - qCInfo(LogRemoteManage) << "ServerConfigManager fill data to manage panel."; + qCInfo(remotemanage) << "ServerConfigManager fill data to manage panel."; listview->clearData(); for (QString key : m_serverConfigs.keys()) { // key有效 @@ -75,7 +75,7 @@ void ServerConfigManager::fillManagePanel(ListView *listview) void ServerConfigManager::fillSearchPanel(ListView *listview, const QString &filter, const QString &group) { - qCInfo(LogRemoteManage) << "ServerConfigManager fill data to search panel."; + qCInfo(remotemanage) << "ServerConfigManager fill data to search panel."; listview->clearData(); // 判断是否是组内搜索 if (group.isEmpty() || group.isNull()) { @@ -150,7 +150,7 @@ void ServerConfigManager::initServerConfig() return; QString serverConfigFilePath(serverConfigBasePath.filePath("server-config.conf")); - qCInfo(LogRemoteManage) << "load Server Config: " << serverConfigFilePath; + qCInfo(remotemanage) << "load Server Config: " << serverConfigFilePath; if (!QFile::exists(serverConfigFilePath)) return; @@ -168,7 +168,7 @@ void ServerConfigManager::initServerConfig() QStringList strList = serverName.split("@"); ServerConfig *pServerConfig = new ServerConfig(); if (strList.count() < 3) { - qCWarning(LogRemoteManage) << "An unknoew error exists on the current server(" << serverName << ")"; + qCWarning(remotemanage) << "An unknoew error exists on the current server(" << serverName << ")"; continue; } // 新版数据的读取方式 @@ -274,7 +274,7 @@ void ServerConfigManager::saveServerConfig(ServerConfig *config) // 添加密码 remoteStoreSecreats(config); - qCInfo(LogRemoteManage) << "The server configuration is added successfully.The Config group: " << config->m_group << ".The Server name:"<< config->m_serverName; + qCInfo(remotemanage) << "The server configuration is added successfully.The Config group: " << config->m_group << ".The Server name:"<< config->m_serverName; } @@ -351,7 +351,7 @@ void ServerConfigManager::setModifyDialog(QString key, ServerConfigOptDlg *dlg) { // 添加编辑弹窗 m_serverConfigDialogMap[key].append(dlg); - qCInfo(LogRemoteManage) << "show edit dialog" << key << m_serverConfigDialogMap[key].count() << dlg; + qCInfo(remotemanage) << "show edit dialog" << key << m_serverConfigDialogMap[key].count() << dlg; } void ServerConfigManager::removeDialog(ServerConfigOptDlg *dlg) @@ -371,17 +371,17 @@ void ServerConfigManager::removeDialog(ServerConfigOptDlg *dlg) } // 2.删除数据 if (nullptr != removeOne) { - qCInfo(LogRemoteManage) << "delete dialog from remote name : " << key; + qCInfo(remotemanage) << "delete dialog from remote name : " << key; m_serverConfigDialogMap[key].removeOne(removeOne); } if (0 == m_serverConfigDialogMap[key].count()) { - qCInfo(LogRemoteManage) << "remote dialog is 0, remove remote name : " << key; + qCInfo(remotemanage) << "remote dialog is 0, remove remote name : " << key; m_serverConfigDialogMap.remove(key); } if (nullptr != removeOne) { - qCInfo(LogRemoteManage) << "delete remote dialog" << removeOne; + qCInfo(remotemanage) << "delete remote dialog" << removeOne; removeOne->deleteLater(); } removeOne = nullptr; @@ -389,7 +389,7 @@ void ServerConfigManager::removeDialog(ServerConfigOptDlg *dlg) void ServerConfigManager::SyncData(QString key, ServerConfig *newConfig) { - qCInfo(LogRemoteManage) <<"Sync Data! Key: " << key << ";Server Name:" << newConfig->m_serverName; + qCInfo(remotemanage) <<"Sync Data! Key: " << key << ";Server Name:" << newConfig->m_serverName; //前提是key唯一 // serverName被修改 if (key != newConfig->m_serverName) { @@ -410,17 +410,17 @@ void ServerConfigManager::SyncData(QString key, ServerConfig *newConfig) void ServerConfigManager::closeAllDialog(QString key) { - qCInfo(LogRemoteManage) << "Close ALL Dialogs for the remote server! Remote name : " << key ; + qCInfo(remotemanage) << "Close ALL Dialogs for the remote server! Remote name : " << key ; // 判读此时这个key是否存在 if (!m_serverConfigDialogMap.contains(key)) { // 不存在退出 - qCWarning(LogRemoteManage) << "The current remote(" << key <<") server does not exist!"; + qCWarning(remotemanage) << "The current remote(" << key <<") server does not exist!"; return; } for (auto &item : m_serverConfigDialogMap[key]) { if (item != nullptr) { - qCInfo(LogRemoteManage) << "Reject the current remote window(" << item << ")!"; + qCInfo(remotemanage) << "Reject the current remote window(" << item << ")!"; // reject就会把当前的窗口删除 item->reject(); } @@ -430,7 +430,7 @@ void ServerConfigManager::closeAllDialog(QString key) int ServerConfigManager::getServerCount(const QString &strGroupName) { if (strGroupName.isEmpty() || strGroupName.isNull()) { - qCWarning(LogRemoteManage) << "enter error group name:" << strGroupName << "! please confirm again!"; + qCWarning(remotemanage) << "enter error group name:" << strGroupName << "! please confirm again!"; return -1; } if (m_serverConfigs.contains(strGroupName)) { @@ -453,7 +453,7 @@ ServerConfig *ServerConfigManager::getServerConfig(const QString &key) } } // 没找到返回空 - qCWarning(LogRemoteManage) << "can't find remote key : " << key; + qCWarning(remotemanage) << "can't find remote key : " << key; return nullptr; } @@ -479,13 +479,13 @@ static void on_password_lookup(GObject *source, GAsyncResult *result, gpointer u if (error != NULL) { /* ... handle the failure here */ - qCWarning(LogRemoteManage) << "Failed to get password! error msg:" << error->message; + qCWarning(remotemanage) << "Failed to get password! error msg:" << error->message; g_error_free(error); emit reback->manager->lookupSerceats(reback->key, ""); } else if (password == NULL) { /* password will be null, if no matching password found */ // 密码回调 - qCInfo(LogRemoteManage) << "password is Null server name : " << reback->key; + qCInfo(remotemanage) << "password is Null server name : " << reback->key; emit reback->manager->lookupSerceats(reback->key, ""); } else { @@ -531,7 +531,7 @@ static void on_password_stored(GObject *source, GAsyncResult *result, gpointer u secret_password_store_finish(result, &error); if (error != NULL) { /* ... handle the failure here */ - qCWarning(LogRemoteManage) << "Failed to store password! error msg:" << error->message; + qCWarning(remotemanage) << "Failed to store password! error msg:" << error->message; g_error_free(error); } else { /* ... do something now that the password has been stored */ @@ -569,12 +569,12 @@ static void on_password_cleared(GObject *source, GAsyncResult *result, gpointer if (error != NULL) { /* ... handle the failure here */ - qCWarning(LogRemoteManage) << "Failed to clear password! error msg:" << error->message; + qCWarning(remotemanage) << "Failed to clear password! error msg:" << error->message; g_error_free(error); } else { /* removed will be TRUE if a password was removed */ - qCInfo(LogRemoteManage) << "remove result " << removed; + qCInfo(remotemanage) << "remove result " << removed; } } diff --git a/src/remotemanage/serverconfigoptdlg.cpp b/src/remotemanage/serverconfigoptdlg.cpp index 3647dc0f3..33448d5da 100644 --- a/src/remotemanage/serverconfigoptdlg.cpp +++ b/src/remotemanage/serverconfigoptdlg.cpp @@ -30,7 +30,7 @@ #include //added byq qinyaning DGUI_USE_NAMESPACE -Q_DECLARE_LOGGING_CATEGORY(LogRemoteManage) +Q_DECLARE_LOGGING_CATEGORY(remotemanage) ServerConfigOptDlg::ServerConfigOptDlg(ServerConfigOptType type, ServerConfig *curServer, QWidget *parent) : DAbstractDialog(parent), @@ -435,7 +435,7 @@ ServerConfigOptDlg::~ServerConfigOptDlg() void ServerConfigOptDlg::updataData(ServerConfig *curServer) { - qCInfo(LogRemoteManage) << "ServerConfigOptDlg server configuration options updata data."; + qCInfo(remotemanage) << "ServerConfigOptDlg server configuration options updata data."; // 读取配置 QList textCodeList = getTextCodec(); QList backSpaceKeyList = getBackSpaceKey(); @@ -565,7 +565,7 @@ void ServerConfigOptDlg::setAdvanceRegionVisible(bool isVisible) void ServerConfigOptDlg::slotAddSaveButtonClicked() { - qCInfo(LogRemoteManage) << "ServerConfigOptDlg add and save button clicled slot function."; + qCInfo(remotemanage) << "ServerConfigOptDlg add and save button clicled slot function."; // 服务器名为空 if (m_serverName->text().trimmed().isEmpty()) { m_serverName->showAlertMessage(tr("Please enter a server name"), m_serverName); @@ -635,7 +635,7 @@ void ServerConfigOptDlg::slotAddSaveButtonClicked() ServerConfigManager::instance()->modifyServerConfig(config, m_curServer); } accept(); - qCInfo(LogRemoteManage) << "Add or save remote config finish"; + qCInfo(remotemanage) << "Add or save remote config finish"; } void ServerConfigOptDlg::slotFileChooseDialog() diff --git a/src/settings/settings.cpp b/src/settings/settings.cpp index 1d85c5d08..0bd2806db 100644 --- a/src/settings/settings.cpp +++ b/src/settings/settings.cpp @@ -33,7 +33,7 @@ DComboBox *Settings::g_shellConfigCombox = nullptr; // 全局变量 变量定义的位置可以变,目前只有这边用,所以定义到这儿 const QString DEFAULT_SHELL = "$SHELL"; -Q_DECLARE_LOGGING_CATEGORY(LogCommon) +Q_DECLARE_LOGGING_CATEGORY(tsettings) Settings::Settings() : QObject(qApp) { @@ -72,7 +72,7 @@ void Settings::init() // 默认配置 QFile configFile(":/other/default-config.json"); if(!configFile.open(QFile::ReadOnly)) { - qCInfo(LogCommon) << "can not open default-config.json"; + qCInfo(tsettings) << "can not open default-config.json"; } QByteArray json = configFile.readAll(); configFile.close(); @@ -131,7 +131,7 @@ void Settings::init() windowState->setData("items", windowStateMap); for (QString &key : settings->keys()) - qCDebug(LogCommon) <<"Config' Key: " << key << " Config' Value: " << settings->value(key); + qCDebug(tsettings) <<"Config' Key: " << key << " Config' Value: " << settings->value(key); /********************* Modify by n014361 wangpeili End ************************/ initConnection(); @@ -530,7 +530,7 @@ bool Settings::isShortcutConflict(const QString &Name, const QString &Key) // 例ctlr+shift+? => ctrl+shift+/ if (Utils::converUpToDown(strKey) == Utils::converUpToDown(Key)) { if (Name != tmpKey) { - qCInfo(LogCommon) << Name << Key << "is conflict with Settings!" << tmpKey << settings->value(tmpKey); + qCInfo(tsettings) << Name << Key << "is conflict with Settings!" << tmpKey << settings->value(tmpKey); return true; } } @@ -555,7 +555,7 @@ void Settings::handleWidthFont() int ret = base.addApplicationFont(fontpath); if (-1 == ret) - qCWarning(LogCommon) << "load " << name << " font faild"; + qCWarning(tsettings) << "load " << name << " font faild"; } } @@ -613,10 +613,10 @@ QPair Settings::createFontComBoBoxHandle(QObject *obj) return qc.compare(str1.value, str2.value) < 0; }); - qCInfo(LogCommon) << "createFontComBoBoxHandle get system monospacefont"; + qCInfo(tsettings) << "createFontComBoBoxHandle get system monospacefont"; if (Whitelist.size() <= 0) { //一般不会走这个分支,除非DBUS出现问题 - qCInfo(LogCommon) << "DBusManager::callAppearanceFont failed, get control font failed."; + qCInfo(tsettings) << "DBusManager::callAppearanceFont failed, get control font failed."; //DBUS获取字体失败后,设置系统默认的等宽字体 QStringList fontlist; fontlist << "Courier 10 Pitch" << "DejaVu Sans Mono" << "Liberation Mono" @@ -752,7 +752,7 @@ QPair Settings::createShortcutEditOptionHandle(/*DSettings // 配置修改 option->connect(option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, rightWidget, [ = ](const QVariant & value) { QString keyseq = value.toString(); - qCInfo(LogCommon) << "Current configuration modification! Config's Key: " << rightWidget->option()->key() + qCInfo(tsettings) << "Current configuration modification! Config's Key: " << rightWidget->option()->key() << "Config's Value: " << keyseq; if (SHORTCUT_VALUE == keyseq || keyseq.isEmpty()) { rightWidget->clear(); @@ -825,7 +825,7 @@ void Settings::setFontSize(const int size) void Settings::setFontName(const QString font) { FontDataList fontList = DBusManager::callAppearanceFont("monospacefont"); - qCDebug(LogCommon) << "current font name:" << font << "font size:" << fontList.size(); + qCDebug(tsettings) << "current font name:" << font << "font size:" << fontList.size(); for (int k = 0; k < fontList.count(); k++) { if (font == fontList[k].key || font == fontList[k].value) { settings->option("basic.interface.font")->setValue(font); @@ -863,7 +863,7 @@ void Settings::setConsoleShell(const QString shellName) { QMap shellMap = Service::instance()->getShells(); for (auto itr = shellMap.begin(); itr != shellMap.end(); ++itr) { - qCDebug(LogCommon) <<"Console Shell("<< shellName << ")! key:" << itr.key() << "value: " << itr.value(); + qCDebug(tsettings) <<"Console Shell("<< shellName << ")! key:" << itr.key() << "value: " << itr.value(); if (shellName == itr.key() || shellName == itr.value()) { settings->option("advanced.shell.default_shell")->setValue(itr.value()); break; diff --git a/src/settings/shortcutmanager.cpp b/src/settings/shortcutmanager.cpp index 055a1585c..ca219993f 100644 --- a/src/settings/shortcutmanager.cpp +++ b/src/settings/shortcutmanager.cpp @@ -18,9 +18,9 @@ #include #ifdef QT_DEBUG -Q_LOGGING_CATEGORY(LogSettings,"log.terminal.settings.work") +Q_LOGGING_CATEGORY(tsettings,"org.deepin.terminal.tsettings") #else -Q_LOGGING_CATEGORY(LogSettings,"log.terminal.main.settings",QtInfoMsg) +Q_LOGGING_CATEGORY(tsettings,"org.deepin.terminal.tsettings",QtInfoMsg) #endif /* del by ut001121 zhangmeng 20201221 修复BUG58747 @@ -95,7 +95,7 @@ void ShortcutManager::createCustomCommandsFromConfig() return ; QString customCommandConfigFilePath(customCommandBasePath.filePath("command-config.conf")); - qCInfo(LogSettings) << "load Custom Commands Config: " << customCommandConfigFilePath; + qCInfo(tsettings) << "load Custom Commands Config: " << customCommandConfigFilePath; if (!QFile::exists(customCommandConfigFilePath)) return ; @@ -129,7 +129,7 @@ void ShortcutManager::createCustomCommandsFromConfig() //删除自定义命令文件 QFile fileTemp(customCommandConfigFilePath); if(!fileTemp.remove()) - qWarning(LogSettings) << " remove file error" << customCommandConfigFilePath << fileTemp.errorString(); + qWarning(tsettings) << " remove file error" << customCommandConfigFilePath << fileTemp.errorString(); //将内存数据写入配置文件 for (QAction *action : m_customCommandActionList) { @@ -187,12 +187,12 @@ QAction *ShortcutManager::findActionByKey(const QString &strKey) { for (QAction *action : m_customCommandActionList) { if (action->text() == strKey) { - qCInfo(LogSettings) << "find action " << action; + qCInfo(tsettings) << "find action " << action; return action; } } - qCInfo(LogSettings) << "not find action name " << strKey; + qCInfo(tsettings) << "not find action name " << strKey; return nullptr; } @@ -235,7 +235,7 @@ bool ShortcutManager::isShortcutConflictInCustom(const QString &Name, const QStr for (auto &currAction : m_customCommandActionList) { if (currAction->shortcut().toString() == Key) { if (Name != currAction->text()) { - qCInfo(LogSettings) << Name << Key << "is conflict with custom shortcut!"; + qCInfo(tsettings) << Name << Key << "is conflict with custom shortcut!"; return true; } } @@ -270,7 +270,7 @@ bool ShortcutManager::checkShortcutValid(const QString &Name, const QString &Key //F1-F12是允许的,这个正则不够精确,但是没关系。 QRegExp regexp("^F[0-9]{1,2}$"); if (!Key.contains(regexp)) { - qCInfo(LogSettings) << Key << "is invalid!"; + qCInfo(tsettings) << Key << "is invalid!"; Reason = tr("The shortcut %1 is invalid, ") .arg(style); return false; @@ -279,14 +279,14 @@ bool ShortcutManager::checkShortcutValid(const QString &Name, const QString &Key // 小键盘单键都不允许 QRegExp regexpNum("^Num+.*"); if (Key.contains(regexpNum)) { - qCInfo(LogSettings) << Key << "is invalid!"; + qCInfo(tsettings) << Key << "is invalid!"; Reason = tr("The shortcut %1 is invalid, ") .arg(style); return false; } // 内置快捷键都不允许 if (m_builtinShortcuts.contains(Key)) { - qCInfo(LogSettings) << Key << "is conflict with builtin shortcut!"; + qCInfo(tsettings) << Key << "is conflict with builtin shortcut!"; Reason = tr("The shortcut %1 was already in use, ") .arg(style); return false; diff --git a/src/views/customthemesettingdialog.cpp b/src/views/customthemesettingdialog.cpp index c125774c7..e8d82b7ea 100644 --- a/src/views/customthemesettingdialog.cpp +++ b/src/views/customthemesettingdialog.cpp @@ -27,7 +27,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogViews) +Q_DECLARE_LOGGING_CATEGORY(views) TitleStyleRadioButton::TitleStyleRadioButton(const QString &text, QWidget *parent): DRadioButton(text, parent) { @@ -572,7 +572,7 @@ void CustomThemeSettingDialog::loadConfiguration() QPalette palette; QStringList strList = Settings::instance()->themeSetting->value("Foreground/Color").toStringList(); - qCInfo(LogViews) << "Foreground color list number: " << strList.size(); + qCInfo(views) << "Foreground color list number: " << strList.size(); if (strList.size() != 3) { palette.setColor(QPalette::Background, QColor(0, 255, 0)); foregroundColorParameter = QColor(0, 255, 0); @@ -585,7 +585,7 @@ void CustomThemeSettingDialog::loadConfiguration() QColor backgroundColorParameter; strList.clear(); strList = Settings::instance()->themeSetting->value("Background/Color").toStringList(); - qCInfo(LogViews) << "Background color list number: " << strList.size(); + qCInfo(views) << "Background color list number: " << strList.size(); if (strList.size() != 3) { palette.setColor(QPalette::Background, QColor(37, 37, 37)); backgroundColorParameter = QColor(37, 37, 37); @@ -598,7 +598,7 @@ void CustomThemeSettingDialog::loadConfiguration() QColor ps1ColorParameter; strList.clear(); strList = Settings::instance()->themeSetting->value("Color2Intense/Color").toStringList(); - qCInfo(LogViews) << "Color2Intense color list number: " << strList.size(); + qCInfo(views) << "Color2Intense color list number: " << strList.size(); if (strList.size() != 3) { palette.setColor(QPalette::Background, QColor(133, 153, 0)); ps1ColorParameter = QColor(133, 153, 0); @@ -611,7 +611,7 @@ void CustomThemeSettingDialog::loadConfiguration() QColor ps2ColorParameter; strList.clear(); strList = Settings::instance()->themeSetting->value("Color4Intense/Color").toStringList(); - qCInfo(LogViews) << "Color4Intense color list number: " << strList.size(); + qCInfo(views) << "Color4Intense color list number: " << strList.size(); if (strList.size() != 3) { palette.setColor(QPalette::Background, QColor(52, 101, 164)); ps2ColorParameter = QColor(52, 101, 164); diff --git a/src/views/iconbutton.cpp b/src/views/iconbutton.cpp index 23577e223..a51ce6e00 100644 --- a/src/views/iconbutton.cpp +++ b/src/views/iconbutton.cpp @@ -10,7 +10,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogViews) +Q_DECLARE_LOGGING_CATEGORY(views) IconButton::IconButton(QWidget *parent) : DIconButton(parent) { @@ -37,7 +37,7 @@ void IconButton::keyPressEvent(QKeyEvent *event) void IconButton::focusOutEvent(QFocusEvent *event) { - qCInfo(LogViews) << event->reason() << "IconButton" << this; + qCInfo(views) << event->reason() << "IconButton" << this; emit focusOut(event->reason()); DIconButton::focusOutEvent(event); } diff --git a/src/views/itemwidget.cpp b/src/views/itemwidget.cpp index 674113bce..e15ee3b3d 100644 --- a/src/views/itemwidget.cpp +++ b/src/views/itemwidget.cpp @@ -15,7 +15,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogViews) +Q_DECLARE_LOGGING_CATEGORY(views) // 不同布局模式配置 const int s_ItemHeight = 60; const QMargins s_ItemIconContentMargins = {8, 8, 8, 8}; @@ -109,7 +109,7 @@ void ItemWidget::setText(const QString &firstline, const QString &secondline) // 第二行 组内服务器个数 int serverCount = ServerConfigManager::instance()->getServerCount(firstline); if (serverCount <= 0) { - qCWarning(LogViews) << "get error count " << serverCount; + qCWarning(views) << "get error count " << serverCount; serverCount = 0; } m_secondText = QString("%1 server").arg(serverCount); @@ -137,7 +137,7 @@ void ItemWidget::getFocus() if (ItemFuncType_Item == m_functType) { m_funcButton->show(); m_funcButton->setFocus(); - qCInfo(LogViews) << "edit button show"; + qCInfo(views) << "edit button show"; } } @@ -188,13 +188,13 @@ void ItemWidget::onFuncButtonClicked() switch (m_functType) { case ItemFuncType_Group: // 显示分组 - qCInfo(LogViews) << "group show" << m_firstText; + qCInfo(views) << "group show" << m_firstText; // 第一个参数是分组名,第二个参数是当前是否有焦点 emit groupClicked(m_firstText, m_isFocus); break; case ItemFuncType_Item: { // 修改项 - qCInfo(LogViews) << "modify item" << m_firstText; + qCInfo(views) << "modify item" << m_firstText; bool isFocusOn = false; if (m_funcButton->hasFocus() || m_isFocus) { // 焦点在大框或者编辑按钮上 @@ -222,13 +222,13 @@ void ItemWidget::onIconButtonClicked() switch (m_functType) { case ItemFuncType_Group: // 显示分组 - qCInfo(LogViews) << "group show" << m_firstText; + qCInfo(views) << "group show" << m_firstText; // 第一个参数是分组名,第二个参数是当前是否有焦点 emit groupClicked(m_firstText, m_isFocus); break; case ItemFuncType_Item: // 项被点击 - qCInfo(LogViews) << "item clicked" << m_firstText; + qCInfo(views) << "item clicked" << m_firstText; emit itemClicked(m_firstText); break; } @@ -248,7 +248,7 @@ void ItemWidget::onFocusOut(Qt::FocusReason type) if (Qt::ActiveWindowFocusReason == type) { // 例如:super后返回都需要将焦点返回项 setFocus(); - qCInfo(LogViews) << "set focus back itemwidget"; + qCInfo(views) << "set focus back itemwidget"; } // 项 if (ItemFuncType_Item == m_functType) { @@ -438,7 +438,7 @@ void ItemWidget::keyPressEvent(QKeyEvent *event) switch (event->key()) { case Qt::Key_Right: // 点击键盘右键 - qCInfo(LogViews) << "right key press"; + qCInfo(views) << "right key press"; rightKeyPress(); break; case Qt::Key_Enter: @@ -499,7 +499,7 @@ void ItemWidget::setFontColor(DLabel *label, ItemTextColor colorType) fontPalette.setBrush(DPalette::Text, color); label->setPalette(fontPalette); } else { - qCWarning(LogViews) << "Can't get text color"; + qCWarning(views) << "Can't get text color"; } } @@ -520,7 +520,7 @@ QColor ItemWidget::getColor(ItemTextColor colorType) } break; default: - qCInfo(LogViews) << "item widget text unknow color type!" << colorType; + qCInfo(views) << "item widget text unknow color type!" << colorType; break; } return color; @@ -531,13 +531,13 @@ void ItemWidget::rightKeyPress() switch (m_functType) { case ItemFuncType_Group: { // 显示分组 - qCInfo(LogViews) << "group show" << m_firstText; + qCInfo(views) << "group show" << m_firstText; emit groupClicked(m_firstText, true); } break; case ItemFuncType_Item: // 编辑按钮获得焦点 - qCInfo(LogViews) << "item get focus" << m_firstText; + qCInfo(views) << "item get focus" << m_firstText; m_funcButton->show(); m_funcButton->setFocus(); break; @@ -558,13 +558,13 @@ void ItemWidget::onItemClicked() switch (m_functType) { case ItemFuncType_Group: // 显示分组 - qCInfo(LogViews) << "group show" << m_firstText; + qCInfo(views) << "group show" << m_firstText; // 第一个参数是分组名,第二个参数是当前是否有焦点 emit groupClicked(m_firstText, m_isFocus); break; case ItemFuncType_Item: // 项被点击 - qCInfo(LogViews) << "item clicked" << m_firstText; + qCInfo(views) << "item clicked" << m_firstText; emit itemClicked(m_firstText); break; } diff --git a/src/views/listview.cpp b/src/views/listview.cpp index 27bfb85f7..2ff404484 100644 --- a/src/views/listview.cpp +++ b/src/views/listview.cpp @@ -15,7 +15,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogViews) +Q_DECLARE_LOGGING_CATEGORY(views) ListView::ListView(ListType type, QWidget *parent) : QScrollArea(parent), @@ -175,7 +175,7 @@ int ListView::getNextIndex(int index) { if (index < 0) { // 输入错误的index - qCWarning(LogViews) << "input wrong index" << index; + qCWarning(views) << "input wrong index" << index; return -1; } int count = m_itemList.count(); @@ -198,7 +198,7 @@ void ListView::setCurrentIndex(int currentIndex) // 首先判断currentIndex的有效性 if (!indexIsValid(currentIndex)) { // 无效,返回 - qCInfo(LogViews) << "index(" << currentIndex << ") is wrong"; + qCInfo(views) << "index(" << currentIndex << ") is wrong"; emit focusOut(Qt::NoFocusReason); m_focusState = false; return; @@ -212,7 +212,7 @@ void ListView::setCurrentIndex(int currentIndex) ItemWidget *widget = item ? qobject_cast(item->widget()) : nullptr; if (widget != nullptr) { // 设置焦点 - qCInfo(LogViews) << widget << "get focus" << "current index" << currentIndex; + qCInfo(views) << widget << "get focus" << "current index" << currentIndex; // Todo 让焦点不要进入主窗口 widget->setFocus(); m_focusState = true; @@ -247,17 +247,17 @@ void ListView::onRemoteItemModify(const QString &key, bool isFocusOn) m_currentIndex = curIndex; // 弹窗显示 ServerConfig *curItemServer = ServerConfigManager::instance()->getServerConfig(key); - qCInfo(LogViews) << "modify remote " << curItemServer->m_serverName; + qCInfo(views) << "modify remote " << curItemServer->m_serverName; // 弹窗显示 Service::instance()->setIsDialogShow(window(), true); // 根据点击事件还是键盘事件设置焦点状态 if (isFocusOn) { // 键盘 m_focusState = true; - qCInfo(LogViews) << "keyboard clicked"; + qCInfo(views) << "keyboard clicked"; } else { // 鼠标 - qCInfo(LogViews) << "mouse press"; + qCInfo(views) << "mouse press"; m_focusState = false; m_currentIndex = -1; } @@ -273,7 +273,7 @@ void ListView::onRemoteItemModify(const QString &key, bool isFocusOn) inline void ListView::onServerConfigOptDlgFinished(int result) { // 弹窗隐藏或消失 - qCInfo(LogViews) << "focus state " << m_focusState; + qCInfo(views) << "focus state " << m_focusState; // 3. 对弹窗操作进行分析 // 判断是否删除 if (ServerConfigOptDlg::Accepted == result) { @@ -300,7 +300,7 @@ inline void ListView::onServerConfigOptDlgFinished(int result) // 设置滚轮 // 关闭后及时将弹窗删除 // 记住修改前的位置 m_currentIndex - qCInfo(LogViews) << "index before modify " << m_currentIndex; + qCInfo(views) << "index before modify " << m_currentIndex; ServerConfigManager::instance()->removeDialog(m_configDialog); // 刷新列表 emit ServerConfigManager::instance()->refreshList(); @@ -313,7 +313,7 @@ inline void ListView::onServerConfigOptDlgFinished(int result) } // 依旧没有找到啦 if (index < 0) { - qCInfo(LogViews) << "no next item"; + qCInfo(views) << "no next item"; if (m_focusState) { // 有焦点,焦点出 emit focusOut(Qt::NoFocusReason); @@ -440,7 +440,7 @@ inline void ListView::onCustomCommandOptDlgFinished(int result) if (QDialog::Accepted == result) { //确认修改处理 - qCInfo(LogViews) << "Modify Custom Command"; + qCInfo(views) << "Modify Custom Command"; QAction *newAction = m_pdlg->getCurCustomCmd(); CustomCommandData itemData = *(m_pdlg->m_currItemData); CustomCommandData itemDel = itemData; @@ -476,7 +476,7 @@ inline void ListView::onCustomCommandOptDlgFinished(int result) //Delete custom command 删除自定义命令处理 if (m_pdlg->isDelCurCommand()) { - qCInfo(LogViews) << "Delete Custom Command"; + qCInfo(views) << "Delete Custom Command"; DDialog *dlgDelete = new DDialog(this); dlgDelete->setObjectName("CustomDeleteDialog"); dlgDelete->setAttribute(Qt::WA_DeleteOnClose); @@ -506,11 +506,11 @@ inline void ListView::onCustomCommandOptDlgFinished(int result) ItemWidget *itemWidget = m_itemList.at(m_currentIndex); itemWidget->getFocus(); } else { - qCInfo(LogViews) << "QDialog accepted result is:" << result; + qCInfo(views) << "QDialog accepted result is:" << result; if (-1 != result) { setFocus(); } else { - qCInfo(LogViews) << "QDialog Rejected"; + qCInfo(views) << "QDialog Rejected"; ItemWidget *itemWidget = m_itemList.at(m_currentIndex); itemWidget->getFocus(); } @@ -540,7 +540,7 @@ inline void ListView::onDeleteCustomCommandFinished(int result) setFocus(); } else { // 找不到 - qCInfo(LogViews) << "can't find index" << index; + qCInfo(views) << "can't find index" << index; if (m_itemList.count() == 0) { emit focusOut(Qt::NoFocusReason); } @@ -582,7 +582,7 @@ void ListView::focusInEvent(QFocusEvent *event) else setCurrentIndex(m_currentIndex); - qCInfo(LogViews) << "ListView current index : " << m_currentIndex << event->reason(); + qCInfo(views) << "ListView current index : " << m_currentIndex << event->reason(); m_focusState = true; QScrollArea::focusInEvent(event); } @@ -703,7 +703,7 @@ void ListView::setFocusFromeIndex(int currentIndex, ListFocusType focusType) else if (ListFocusEnd == focusType) index = this->count() - 1; else - qCInfo(LogViews) << "Type of current focus:" << focusType ; + qCInfo(views) << "Type of current focus:" << focusType ; // index >= 0 < 最大数量 // 最上 @@ -757,11 +757,11 @@ void ListView::setFocusFromeIndex(int currentIndex, ListFocusType focusType) m_scrollPostion = 0; verticalScrollBar()->setValue(m_scrollPostion); - qCInfo(LogViews) << "up down scrollPostion : " << m_scrollPostion << verticalScrollBar()->value(); + qCInfo(views) << "up down scrollPostion : " << m_scrollPostion << verticalScrollBar()->value(); // 需要让m_currentIndex于焦点所在位置同步 m_currentIndex = index; - qCInfo(LogViews) << "current index : " << m_currentIndex; + qCInfo(views) << "current index : " << m_currentIndex; } void ListView::lostFocus(int preIndex) @@ -775,7 +775,7 @@ void ListView::lostFocus(int preIndex) if (widget != nullptr) { // 丢失焦点 widget->lostFocus(); - qCInfo(LogViews) << widget << "lost focus"; + qCInfo(views) << widget << "lost focus"; } } diff --git a/src/views/pagesearchbar.cpp b/src/views/pagesearchbar.cpp index 0e69e7a66..fde141e71 100644 --- a/src/views/pagesearchbar.cpp +++ b/src/views/pagesearchbar.cpp @@ -19,7 +19,7 @@ #include #include #include -Q_DECLARE_LOGGING_CATEGORY(LogViews) +Q_DECLARE_LOGGING_CATEGORY(views) PageSearchBar::PageSearchBar(QWidget *parent) : DFloatingWidget(parent) { @@ -189,7 +189,7 @@ void PageSearchBar::initSearchEdit() } } } else { - qCWarning(LogViews) << "can not found _q_qlineeditclearaction in QAction"; + qCWarning(views) << "can not found _q_qlineeditclearaction in QAction"; } // 需求不让自动查找,这个接口预留 diff --git a/src/views/tabbar.cpp b/src/views/tabbar.cpp index 0294d5cb0..8e237e927 100644 --- a/src/views/tabbar.cpp +++ b/src/views/tabbar.cpp @@ -31,7 +31,7 @@ #endif #include -Q_DECLARE_LOGGING_CATEGORY(LogViews) +Q_DECLARE_LOGGING_CATEGORY(views) //TermTabStyle类开始,该类用于设置tab标签样式 TermTabStyle::TermTabStyle() : m_tabCount(0) { @@ -240,7 +240,7 @@ int TabBar::addTab(const QString &tabIdentifier, const QString &tabName) int TabBar::insertTab(const int &index, const QString &tabIdentifier, const QString &tabName) { - qCInfo(LogViews) << "insertTab at index: " << index << " with id::" << tabIdentifier << endl; + qCInfo(views) << "insertTab at index: " << index << " with id::" << tabIdentifier << endl; int insertIndex = DTabBar::insertTab(index, tabName); setTabData(insertIndex, QVariant::fromValue(tabIdentifier)); @@ -712,7 +712,7 @@ void TabBar::handleTabReleased(int index) if (index < 0) index = 0; - qCInfo(LogViews) << "Indicates the index(" << index << ") of the released label!"; + qCInfo(views) << "Indicates the index(" << index << ") of the released label!"; const QString tabName = tabText(index); MainWindow *window = static_cast(this->window()); @@ -728,7 +728,7 @@ void TabBar::handleTabReleased(int index) //从原窗口中移除TermWidgetPage。 window->removeTermWidgetPage(termIdentifer, false); - qCInfo(LogViews) << "Remove Term Widget Page termIdentifer: " << termIdentifer; + qCInfo(views) << "Remove Term Widget Page termIdentifer: " << termIdentifer; updateTabDragMoveStatus(); } @@ -781,7 +781,7 @@ inline void TabBar::handleWindowClose() return; int windowIndex = WindowsManager::instance()->getNormalWindowList().indexOf(window); - qCInfo(LogViews) << "Close window at index: " << windowIndex; + qCInfo(views) << "Close window at index: " << windowIndex; if (windowIndex >= 0) WindowsManager::instance()->getNormalWindowList().takeAt(windowIndex); @@ -815,7 +815,7 @@ void TabBar::handleTabDroped(int index, Qt::DropAction dropAction, QObject *targ { Q_UNUSED(dropAction) - qCInfo(LogViews) << "Handle Tab Droped! index:" << index << ", target:" << target << endl; + qCInfo(views) << "Handle Tab Droped! index:" << index << ", target:" << target << endl; TabBar *tabbar = qobject_cast(target); //拖出的标签--需要新建窗口 diff --git a/src/views/tabrenamedlg.cpp b/src/views/tabrenamedlg.cpp index 424e9d1fe..1dbef3cfe 100644 --- a/src/views/tabrenamedlg.cpp +++ b/src/views/tabrenamedlg.cpp @@ -15,7 +15,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogViews) +Q_DECLARE_LOGGING_CATEGORY(views) TabRenameDlg::TabRenameDlg(QWidget *parent) : DAbstractDialog(parent) { initUi(); @@ -179,7 +179,7 @@ void TabRenameDlg::initConnections() }); connect(m_confirmButton, &DSuggestButton::clicked, this, [ = ] { - qCInfo(LogViews) << "confirm rename title"; + qCInfo(views) << "confirm rename title"; QString tabTitleFormat = getTabTitleEdit()->text(); QString remoteTabTitleFormat = getRemoteTabTitleEdit()->text(); emit tabTitleFormatRename(tabTitleFormat, remoteTabTitleFormat); diff --git a/src/views/termwidget.cpp b/src/views/termwidget.cpp index e27e9b116..e4af93a08 100644 --- a/src/views/termwidget.cpp +++ b/src/views/termwidget.cpp @@ -37,9 +37,9 @@ DWIDGET_USE_NAMESPACE using namespace Konsole; #ifdef QT_DEBUG -Q_LOGGING_CATEGORY(LogViews,"log.terminal.views.work") +Q_LOGGING_CATEGORY(views,"org.deepin.terminal.views") #else -Q_LOGGING_CATEGORY(LogViews,"log.terminal.views.work",QtInfoMsg) +Q_LOGGING_CATEGORY(views,"org.deepin.terminal.views",QtInfoMsg) #endif TermWidget::TermWidget(const TermProperties &properties, QWidget *parent) : QTermWidget(0, parent), m_properties(properties) @@ -55,7 +55,7 @@ TermWidget::TermWidget(const TermProperties &properties, QWidget *parent) : QTer QString strShellPath = Settings::instance()->shellPath(); // set shell program - qCInfo(LogViews) << "set shell program : " << strShellPath; + qCInfo(views) << "set shell program : " << strShellPath; setShellProgram(strShellPath); /******** Modify by ut000610 daizhengwen 2020-07-08:初始化透明度 Begin***************/ // 若没有窗口特效,则不生效 @@ -100,7 +100,7 @@ TermWidget::TermWidget(const TermProperties &properties, QWidget *parent) : QTer //QString args = m_properties[Execute].toString(); //QStringList argList = args.split(QRegExp(QStringLiteral("\\s+")), QString::SkipEmptyParts); QStringList argList = m_properties[Execute].toStringList(); - qCInfo(LogViews) << "Execute args:" << argList; + qCInfo(views) << "Execute args:" << argList; if (argList.count() > 0) { setShellProgram(argList.at(0)); argList.removeAt(0); @@ -149,7 +149,7 @@ TermWidget::TermWidget(const TermProperties &properties, QWidget *parent) : QTer // 增加可以自动运行脚本的命令,不需要的话,可以删除 if (m_properties.contains(Script)) { QString args = m_properties[Script].toString(); - qCInfo(LogViews) << "run cmd:" << args; + qCInfo(views) << "run cmd:" << args; args.append("\n"); if (!m_properties[KeepOpen].toBool()) args.append("exit\n"); @@ -289,11 +289,11 @@ inline void TermWidget::onExitRemoteServer() { // 判断是否此时退出远程 if (!isInRemoteServer()) { - qCInfo(LogViews) << "exit remote"; + qCInfo(views) << "exit remote"; setIsConnectRemote(false); // 还原编码 setTextCodec(QTextCodec::codecForName(encode().toLocal8Bit())); - qCInfo(LogViews) << "current encode " << encode(); + qCInfo(views) << "current encode " << encode(); setBackspaceMode(m_backspaceMode); setDeleteMode(m_deleteMode); emit Service::instance()->checkEncode(encode()); @@ -308,7 +308,7 @@ inline void TermWidget::onUrlActivated(const QUrl &url, bool fromContextMenu) inline void TermWidget::onThemeTypeChanged(DGuiApplicationHelper::ColorType builtInTheme) { - qCInfo(LogViews) << "Theme Type Changed! Current Theme Type: " << builtInTheme; + qCInfo(views) << "Theme Type Changed! Current Theme Type: " << builtInTheme; // ThemePanelPlugin *plugin = qobject_cast(getPluginByName("Theme")); QString theme = "Dark"; /************************ Mod by sunchengxi 2020-09-16:Bug#48226#48230#48236#48241 终端默认主题色应改为深色修改引起的系列问题修复 Begin************************/ @@ -676,7 +676,7 @@ inline QString TermWidget::getFormatFileName(QString selectedText) || (fileName.startsWith("\"") && fileName.endsWith("\""))) { fileName = fileName.remove(0, 1); fileName = fileName.remove(fileName.length() - 1, 1); - qCInfo(LogViews) << "Format fileName is " << fileName; + qCInfo(views) << "Format fileName is " << fileName; } return fileName; @@ -752,7 +752,7 @@ void TermWidget::setBackspaceMode(const EraseMode &backspaceMode) case EraseMode_TTY: ch = getErase(); length = 1; - qCInfo(LogViews) << "tty erase : " << QByteArray(&ch, length).toHex(); + qCInfo(views) << "tty erase : " << QByteArray(&ch, length).toHex(); break; case EraseMode_Escape_Sequeue: length = 4; @@ -779,7 +779,7 @@ void TermWidget::setDeleteMode(const EraseMode &deleteMode) case EraseMode_TTY: ch = getErase(); length = 1; - qCInfo(LogViews) << "tty erase : " << QByteArray(&ch, length).toHex(); + qCInfo(views) << "tty erase : " << QByteArray(&ch, length).toHex(); break; case EraseMode_Auto: case EraseMode_Escape_Sequeue: @@ -894,7 +894,7 @@ void TermWidget::initTabTitleArgs() for (QString arg : strRemoteTabArgs) m_remoteTabArgs.insert(arg, " "); - qCInfo(LogViews) << "Tab args init! tab title count : " << m_tabArgs.count() << " remote title count : " << m_remoteTabArgs.count(); + qCInfo(views) << "Tab args init! tab title count : " << m_tabArgs.count() << " remote title count : " << m_remoteTabArgs.count(); } QString TermWidget::getTabTitleFormat() @@ -1050,17 +1050,17 @@ void TermWidget::selectEncode(QString encode) if (!isConnectRemote()) { // 记录当前的encode setEncode(encode); - qCInfo(LogViews) << "current encode " << encode; + qCInfo(views) << "current encode " << encode; } else { // 记录远程的encode setRemoteEncode(encode); - qCInfo(LogViews) << "Remote encode " << encode; + qCInfo(views) << "Remote encode " << encode; } } void TermWidget::onSettingValueChanged(const QString &keyName) { - qCInfo(LogViews) << "Setting Value Changed! Current Config's key:" << keyName; + qCInfo(views) << "Setting Value Changed! Current Config's key:" << keyName; if ("basic.interface.opacity" == keyName) { setTermOpacity(Settings::instance()->opacity()); return; @@ -1115,18 +1115,18 @@ void TermWidget::onSettingValueChanged(const QString &keyName) } if ("advanced.scroll.scroll_on_output" == keyName) { - qCInfo(LogViews) << "settingValue[" << keyName << "] changed to " << Settings::instance()->OutputtingScroll() + qCInfo(views) << "settingValue[" << keyName << "] changed to " << Settings::instance()->OutputtingScroll() << ", auto effective when happen"; return; } - qCInfo(LogViews) << "settingValue[" << keyName << "] changed is not effective"; + qCInfo(views) << "settingValue[" << keyName << "] changed is not effective"; } void TermWidget::onDropInUrls(const char *urls) { QString strUrls = QString::fromLocal8Bit(urls); - qCInfo(LogViews) << "recv urls:" << strUrls; + qCInfo(views) << "recv urls:" << strUrls; if (isConnectRemote()) { // 远程管理连接中 QString strTxt = "sz "; diff --git a/src/views/termwidgetpage.cpp b/src/views/termwidgetpage.cpp index 531efe03c..55f2a16d6 100644 --- a/src/views/termwidgetpage.cpp +++ b/src/views/termwidgetpage.cpp @@ -19,7 +19,7 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(LogViews) +Q_DECLARE_LOGGING_CATEGORY(views) TermWidgetPage::TermWidgetPage(const TermProperties &properties, QWidget *parent) : QWidget(parent), m_findBar(new PageSearchBar(this)) { @@ -127,12 +127,12 @@ void TermWidgetPage::split(Qt::Orientation orientation) parentMainWindow()->showPlugin(MainWindow::PLUGIN_TYPE_NONE); TermWidget *term = m_currentTerm; if (1 == getTerminalCount()) { - qCInfo(LogViews) << "first split"; + qCInfo(views) << "first split"; QSplitter *firstSplit = createSubSplit(term, orientation); m_layout->addWidget(firstSplit); //return ; } else { - qCInfo(LogViews) << "not first split"; + qCInfo(views) << "not first split"; QSplitter *upSplit = qobject_cast(term->parent()); int index = upSplit->indexOf(term); QList parentSizes = upSplit->sizes(); @@ -181,7 +181,7 @@ DSplitter *TermWidgetPage::createSubSplit(TermWidget *term, Qt::Orientation orie void TermWidgetPage::closeSplit(TermWidget *term, bool hasConfirmed) { - qCInfo(LogViews) << "TermWidgetPage::closeSplit:" << term->getSessionId(); + qCInfo(views) << "TermWidgetPage::closeSplit:" << term->getSessionId(); if (getTerminalCount() > 1) { if (!hasConfirmed && term->hasRunningProcess()) { showExitConfirmDialog(Utils::CloseType_Terminal, 1, parentMainWindow()); @@ -201,16 +201,16 @@ void TermWidgetPage::closeSplit(TermWidget *term, bool hasConfirmed) } // 上级不是分屏控件,就是布局在控制了 else { - qCWarning(LogViews) << "TermWidgetPage only one term exist!"; + qCWarning(views) << "TermWidgetPage only one term exist!"; m_layout->addWidget(brother); } // 子控件的变化会引起焦点的变化,控制焦点要放在最后 if (nextTerm != nullptr) { - qCInfo(LogViews) << "nextTerm change" << m_currentTerm->getSessionId(); + qCInfo(views) << "nextTerm change" << m_currentTerm->getSessionId(); nextTerm->setFocus(); } else { - qCWarning(LogViews) << "can not found nextTerm in TermWidget"; + qCWarning(views) << "can not found nextTerm in TermWidget"; } // 释放控件,并隐藏term、upSplit,避免出现闪现窗口bug#80809 @@ -221,7 +221,7 @@ void TermWidgetPage::closeSplit(TermWidget *term, bool hasConfirmed) upSplit->hide(); upSplit->setParent(nullptr); upSplit->deleteLater(); - qCInfo(LogViews) << "page terminal count =" << getTerminalCount(); + qCInfo(views) << "page terminal count =" << getTerminalCount(); /******** Add by ut001000 renfeixiang 2020-08-07:关闭分屏时改变大小,bug#41436***************/ parentMainWindow()->updateMinHeight(); return; @@ -259,7 +259,7 @@ void TermWidgetPage::showExitConfirmDialog(Utils::CloseType type, int count, QWi // if (type == Utils::CloseType_Terminal) { // connect(dlg, &DDialog::finished, this, [this](int result) { -// qCInfo(LogViews) << result; +// qCInfo(views) << result; // // 有弹窗消失 // Service::instance()->setIsDialogShow(window(), false); // if (result == 1) { @@ -271,7 +271,7 @@ void TermWidgetPage::showExitConfirmDialog(Utils::CloseType type, int count, QWi // if (type == Utils::CloseType_OtherTerminals) { // connect(dlg, &DDialog::finished, this, [this](int result) { -// qCInfo(LogViews) << result; +// qCInfo(views) << result; // // 有弹窗消失 // Service::instance()->setIsDialogShow(window(), false); // if (result == 1) { @@ -305,7 +305,7 @@ void TermWidgetPage::closeOtherTerminal(bool hasConfirmed) QList termList = findChildren(); // 终端数量小于2,执行关闭其他窗口操作 if (termList.count() < 2) { - qCInfo(LogViews) << "current window doesn't have other terminal, can't close other terminals."; + qCInfo(views) << "current window doesn't have other terminal, can't close other terminals."; return; } @@ -345,7 +345,7 @@ int TermWidgetPage::getTerminalCount() bool TermWidgetPage::hasHasHorizontalSplit() { - qCInfo(LogViews) << "start hasHasHorizontalSplit"; + qCInfo(views) << "start hasHasHorizontalSplit"; QList splitList = findChildren(); for (QSplitter *split : splitList) { if (Qt::Vertical == split->orientation()) { @@ -360,7 +360,7 @@ QRect TermWidgetPage::GetRect(TermWidget *term) QPoint leftTop = term->mapTo(term->window(), QPoint(0, 0)); QPoint rightBottom = term->mapTo(term->window(), QPoint(term->width(), term->height())); QRect rec(leftTop, rightBottom); - qCInfo(LogViews) << "leftTop: " << leftTop.x() << leftTop.y() << "rightBottom: " << rightBottom.x() << rightBottom.y(); + qCInfo(views) << "leftTop: " << leftTop.x() << leftTop.y() << "rightBottom: " << rightBottom.x() << rightBottom.y(); return rec; } @@ -612,7 +612,7 @@ void TermWidgetPage::onTermClosed() { TermWidget *w = qobject_cast(sender()); if (!w) { - qCWarning(LogViews) << "TermWidgetPage::onTermClosed: Unknown object to handle" << w; + qCWarning(views) << "TermWidgetPage::onTermClosed: Unknown object to handle" << w; return; } closeSplit(w); @@ -714,7 +714,7 @@ void TermWidgetPage::setCurrentTerminal(TermWidget *term) m_currentTerm = term; if (oldTerm != m_currentTerm) { // 当前界面切换 - qCInfo(LogViews) << "Current terminal change" << m_currentTerm->getSessionId(); + qCInfo(views) << "Current terminal change" << m_currentTerm->getSessionId(); QString tabTitle = term->getTabTitle(); // 当前标签为空,标签格式不为空 => 未得到term参数,暂不上传数据 if ((tabTitle == DEFAULT_TAB_TITLE) && !term->getCurrentTabTitleFormat().trimmed().isEmpty()) @@ -734,7 +734,7 @@ TermWidget *TermWidgetPage::createTerm(TermProperties properties) connect(term, &TermWidget::leftMouseClick, this, &TermWidgetPage::handleLeftMouseClick); connect(term, &TermWidget::finished, this, &TermWidgetPage::onTermClosed); - qCInfo(LogViews) << "create Terminal, sessionId = " << term->getSessionId(); + qCInfo(views) << "create Terminal, sessionId = " << term->getSessionId(); // 对标签页重命名设置 connect(this, &TermWidgetPage::tabTitleFormatChanged, term, &TermWidget::renameTabFormat); return term;