diff --git a/3rdparty/terminalwidget/lib/BlockArray.cpp b/3rdparty/terminalwidget/lib/BlockArray.cpp index bd36d611e..3ded401e6 100644 --- a/3rdparty/terminalwidget/lib/BlockArray.cpp +++ b/3rdparty/terminalwidget/lib/BlockArray.cpp @@ -136,7 +136,6 @@ const Block * BlockArray::at(size_t i) } if (i > index) { - qDebug() << "BlockArray::at() i > index\n"; return nullptr; } diff --git a/3rdparty/terminalwidget/lib/ColorScheme.cpp b/3rdparty/terminalwidget/lib/ColorScheme.cpp index 7bce3e27f..20966cecc 100644 --- a/3rdparty/terminalwidget/lib/ColorScheme.cpp +++ b/3rdparty/terminalwidget/lib/ColorScheme.cpp @@ -516,16 +516,16 @@ ColorScheme* KDE3ColorSchemeReader::read() if ( line.startsWith(QLatin1String("color")) ) { if (!readColorLine(line,scheme)) - qDebug() << "Failed to read KDE 3 color scheme line" << line; + qWarning() << "Failed to read KDE 3 color scheme line" << line; } else if ( line.startsWith(QLatin1String("title")) ) { if (!readTitleLine(line,scheme)) - qDebug() << "Failed to read KDE 3 color scheme title line" << line; + qWarning() << "Failed to read KDE 3 color scheme title line" << line; } else { - qDebug() << "KDE 3 color scheme contains an unsupported feature, '" << + qWarning() << "KDE 3 color scheme contains an unsupported feature, '" << line << "'"; } } @@ -614,10 +614,10 @@ void ColorSchemeManager::loadAllColorSchemes() } if ( failed > 0 ){ - qDebug() << "failed to load " << failed << " color schemes."; + qWarning() << "failed to load " << failed << " color schemes."; } - qDebug() << "load all color schemes"; + qInfo() << "load all color schemes"; //qDebug() << "nativeColorSchemes" << nativeColorSchemes ; //qDebug() << "kde3ColorSchemes" << kde3ColorSchemes; _haveLoadedAll = true; @@ -644,7 +644,7 @@ bool ColorSchemeManager::loadKDE3ColorScheme(const QString& filePath) if (scheme->name().isEmpty()) { - qDebug() << "color scheme name is not valid."; + qWarning() << "color scheme name is not valid."; delete scheme; return false; } @@ -655,7 +655,7 @@ bool ColorSchemeManager::loadKDE3ColorScheme(const QString& filePath) _colorSchemes.insert(scheme->name(),scheme); else { - qDebug() << "color scheme with name" << scheme->name() << "has already been" << + qWarning() << "color scheme with name" << scheme->name() << "has already been" << "found, ignoring."; delete scheme; } @@ -705,7 +705,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath) if (scheme->name().isEmpty()) { - qDebug() << "Color scheme in" << filePath << "does not have a valid name and was not loaded."; + qWarning() << "Color scheme in" << filePath << "does not have a valid name and was not loaded."; delete scheme; return false; } @@ -716,7 +716,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath) } else { - qDebug() << "color scheme with name" << schemeName << "has already been" << + qWarning() << "color scheme with name" << schemeName << "has already been" << "found, ignoring."; delete scheme; @@ -781,7 +781,7 @@ bool ColorSchemeManager::deleteColorScheme(const QString& name) } else { - qDebug() << "Failed to remove color scheme -" << path; + qWarning() << "Failed to remove color scheme -" << path; return false; } } @@ -794,7 +794,6 @@ bool ColorSchemeManager::deleteColorScheme(const QString& name) *******************************************************************************/ void ColorSchemeManager::realodColorScheme(const QString &origName) { - qDebug() << "realodColorScheme:" << origName; if (!origName.endsWith(QLatin1String(".colorscheme")) || !QFile::exists(origName)) { return; } @@ -806,7 +805,7 @@ void ColorSchemeManager::realodColorScheme(const QString &origName) scheme->read(origName); if (scheme->name().isEmpty()) { - qDebug() << "Color scheme in" << origName << "does not have a valid name and was not loaded."; + qWarning() << "Color scheme in" << origName << "does not have a valid name and was not loaded."; delete scheme; return; } diff --git a/3rdparty/terminalwidget/lib/HistorySearch.cpp b/3rdparty/terminalwidget/lib/HistorySearch.cpp index d1b66be60..e1bae00a1 100644 --- a/3rdparty/terminalwidget/lib/HistorySearch.cpp +++ b/3rdparty/terminalwidget/lib/HistorySearch.cpp @@ -85,8 +85,6 @@ bool HistorySearch::search(int startColumn, int startLine, int endColumn, int en int linesRead = 0; int linesToRead = endLine - startLine + 1; - qDebug() << "linesToRead:" << linesToRead; - QString stringBackwardsAfterForwards; QTextStream backwardsAfterForwardsStream(&stringBackwardsAfterForwards); @@ -179,7 +177,6 @@ bool HistorySearch::search(int startColumn, int startLine, int endColumn, int en m_lastBackwardsPosition = endPosition; qDebug() << "backwards save m_lastBackwardsPosition2:" << m_lastBackwardsPosition; } - qDebug() << "endPosition 5!!!!!!!!!!!! == endColumn:" << endPosition; } } @@ -192,11 +189,8 @@ bool HistorySearch::search(int startColumn, int startLine, int endColumn, int en qDebug() << "forwards matchStart:" << matchStart << ", startColumn:" << startColumn; if (matchStart >= endPosition) { matchStart = -1; - qDebug() << "forwards matchStart == -1:" << matchStart; } } else { - qDebug() << "string:" << string; - qDebug() << "m_lastBackwardsPosition:" << m_lastBackwardsPosition; qDebug() << "string length:" << string.length() << ", endPosition:" << endPosition; //考虑了查找结果在第一行的情况 if (0 == startLine && startLine == endLine && endPosition > endColumn) { @@ -233,10 +227,10 @@ bool HistorySearch::search(int startColumn, int startLine, int endColumn, int en //考虑了查找结果在第一行的情况 if (0 == m_foundStartLine && m_foundStartLine == m_foundEndLine) { m_lastBackwardsPosition = m_foundStartColumn; - qDebug() << "!!! ready to change m_foundStartColumn: " << m_foundStartColumn; - qDebug() << "!!! ready to change m_foundEndColumn: " << m_foundEndColumn; - qDebug() << "!!! ready to change m_foundStartLine: " << m_foundStartLine; - qDebug() << "!!! ready to change m_foundEndLine: " << m_foundEndLine; + qDebug() << "ready to change m_foundStartColumn: " << m_foundStartColumn; + qDebug() << "ready to change m_foundEndColumn: " << m_foundEndColumn; + qDebug() << "ready to change m_foundStartLine: " << m_foundStartLine; + qDebug() << "ready to change m_foundEndLine: " << m_foundEndLine; } else if (-1 == endPosition || -1 == endColumn) { QString stringAfterSearch; @@ -254,7 +248,7 @@ bool HistorySearch::search(int startColumn, int startLine, int endColumn, int en decoder.end(); m_lastBackwardsPosition = stringAfterSearch.length() + m_foundStartColumn; - qDebug() << "!!! ready to change m_lastBackwardsPosition: " << m_lastBackwardsPosition; + qDebug() << "ready to change m_lastBackwardsPosition: " << m_lastBackwardsPosition; } } @@ -262,10 +256,10 @@ bool HistorySearch::search(int startColumn, int startLine, int endColumn, int en //在正向查找的时候,保存当前indexOf(search, totalString) 到 m_lastBackwardsPosition // 总共读了多少行,记录下字符串总长度,加上当前偏移量 - qDebug() << "m_foundStartColumn" << m_foundStartColumn - << "m_foundStartLine" << m_foundStartLine - << "m_foundEndColumn" << m_foundEndColumn - << "m_foundEndLine" << m_foundEndLine; + qDebug() << "changed m_foundStartColumn" << m_foundStartColumn + << "changed m_foundStartLine" << m_foundStartLine + << "changed m_foundEndColumn" << m_foundEndColumn + << "changed m_foundEndLine" << m_foundEndLine; /***add begin by ut001121 zhangmeng 20200515 修复BUG22626***/ /** @@ -286,7 +280,6 @@ bool HistorySearch::search(int startColumn, int startLine, int endColumn, int en //qDebug() << "loseStart" << loseStart << "loseEnd" << loseEnd ; // if (loseStart < 0 || loseStart > loseEnd) { -// qDebug() << "========loseStart and loseEnd is not expected" << loseStart << loseEnd; // exit(-1); // } @@ -333,7 +326,7 @@ bool HistorySearch::search(int startColumn, int startLine, int endColumn, int en linesRead += blockSize; } - qDebug() << "Not found"; + qInfo() << "History Search Not found"; return false; } diff --git a/3rdparty/terminalwidget/lib/KeyboardTranslator.cpp b/3rdparty/terminalwidget/lib/KeyboardTranslator.cpp index 5aa3195b1..8f5fe609e 100644 --- a/3rdparty/terminalwidget/lib/KeyboardTranslator.cpp +++ b/3rdparty/terminalwidget/lib/KeyboardTranslator.cpp @@ -154,7 +154,6 @@ KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(const QString& nam const QString& path = findTranslatorPath(name); QFile source(path); - qDebug() << __FUNCTION__ << path << endl; if (name.isEmpty() || !source.open(QIODevice::ReadOnly | QIODevice::Text)) return nullptr; diff --git a/3rdparty/terminalwidget/lib/encodes/detectcode.cpp b/3rdparty/terminalwidget/lib/encodes/detectcode.cpp index 61315efbb..e5f5a35e8 100644 --- a/3rdparty/terminalwidget/lib/encodes/detectcode.cpp +++ b/3rdparty/terminalwidget/lib/encodes/detectcode.cpp @@ -214,7 +214,7 @@ void DetectCode::icuDetectTextEncoding(const QString &filePath, QByteArrayList & FILE *file; file = fopen(filePath.toLocal8Bit().data(), "rb"); if (file == nullptr) { - qInfo() << "fopen file failed."; + qWarning() << "fopen file failed."; return; } @@ -425,7 +425,7 @@ int DetectCode::ChartDet_DetectingTextCoding(const char *str, QString &encoding, DetectObj *obj = detect_obj_init(); if (obj == nullptr) { - // qInfo() << "Memory Allocation failed\n"; + qWarning() << "Code identification libarary memory allocation failed\n"; return CHARDET_MEM_ALLOCATED_FAIL; } @@ -441,7 +441,6 @@ int DetectCode::ChartDet_DetectingTextCoding(const char *str, QString &encoding, size_t len = fread(buff, 1, buffer_size, fp); detect(buff, &obj); QString encoding = obj->encoding; - qInfo() << "==== encoding: " << encoding; if (encoding == "") { continue; } else if (!encoding.isEmpty()) { diff --git a/CMakeLists.txt b/CMakeLists.txt index 07cfb2f06..a7d1887e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,6 +276,9 @@ 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 diff --git a/src/assets/logconfig/deepin-terminal.json b/src/assets/logconfig/deepin-terminal.json new file mode 100644 index 000000000..199b50eae --- /dev/null +++ b/src/assets/logconfig/deepin-terminal.json @@ -0,0 +1,8 @@ +{ + "name": "deepin-terminal", + "exec": "/usr/bin/deepin-termnial", + "logType": "journal", + "logPath": "~/.cache/deepin/deepin-termnial/deepin-termnial.log", + "visible": true, + "version": "V1.0" +} \ No newline at end of file diff --git a/src/common/utils.cpp b/src/common/utils.cpp index 78a9aecaf..aca242abb 100644 --- a/src/common/utils.cpp +++ b/src/common/utils.cpp @@ -371,11 +371,11 @@ void Utils::parseCommandLine(QStringList arguments, TermProperties &Properties, // 处理相应参数,当遇到-v -h参数的时候,这里进程会退出。 parser.process(arguments); } else { - qInfo() << "input args:" << qPrintable(arguments.join(" ")); - qInfo() << "arg: optionWorkDirectory" << parser.value(optWorkDirectory); - qInfo() << "arg: optionExecute" << Properties[Execute].toStringList().join(" "); - qInfo() << "arg: optionQuakeMode" << parser.isSet(optQuakeMode); - qInfo() << "arg: optionWindowState" << parser.isSet(optWindowState); + qInfo() << "Command line input args:" << qPrintable(arguments.join(" ")); + qInfo() << "The work directory :" << parser.value(optWorkDirectory); + qInfo() << QString("Execute %1 command in the terminal").arg(Properties[Execute].toStringList().join(" ")); + qInfo() << "Run in quake mode :" << parser.isSet(optQuakeMode); + qInfo() << "Set the window mode on starting :" << parser.isSet(optWindowState); // 这个位置参数解析出来是无法匹配的,可是不带前面标识符,无法准确使用。 } return; @@ -428,11 +428,10 @@ QStringList Utils::parseExecutePara(QStringList &arguments) if (paraList.size() != 0) { for (int i = 0; i < index - startIndex; i++) { arguments.removeAt(startIndex); - qInfo() << arguments.size(); } arguments.removeOne("-e"); arguments.removeOne("--execute"); - qInfo() << opt << paraList << "arguments" << arguments; + qInfo() << "Remove the arguments after '-e',the arguments :" << arguments; } return paraList; @@ -456,7 +455,7 @@ QStringList Utils::parseNestedQString(QString str) //对路径带空格的脚本,右键执行时不进行拆分处理, //./deepin-terminal "-e" "/home/lx777/Desktop/a b/PerfTools_1.9.sh" QFileInfo fi(str); if (fi.isFile()) { - qInfo() << "this is file,not split."; + qWarning() << "this is file,not split."; paraList.append(str); return paraList; } @@ -523,7 +522,7 @@ QList Utils::encodeList() } } if (!bFind) - qInfo() << "encode name :" << name << "not find!"; + qWarning() << "encode (name :" << name << ") not find!"; else encodeList << encodename; @@ -598,8 +597,8 @@ bool Utils::isLoongarch() return false; } m_Arch = QString::fromLocal8Bit(utsbuf.machine); - qInfo() << "m_Arch:" << m_Arch; } + qInfo() << "Current system architecture:" << m_Arch; return "mips64" == m_Arch || "loongarch64" == m_Arch; } @@ -673,7 +672,7 @@ MainWindow *Utils::getMainWindow(QWidget *currWidget) MainWindow *main = nullptr; QWidget *pWidget = currWidget->parentWidget(); while (pWidget != nullptr) { - qInfo() << pWidget->metaObject()->className(); + qInfo() << "Current Window Class Name :" << pWidget->metaObject()->className(); if (("NormalWindow" == pWidget->objectName()) || ("QuakeWindow" == pWidget->objectName())) { qInfo() << "has find MainWindow"; main = static_cast(pWidget); @@ -718,7 +717,7 @@ void FontFilter::handleWidthFont() m_thread->start(); return; } - qInfo() << "m_thread is Running"; + //qInfo() << "m_thread is Running"; } void FontFilter::setStop(bool stop) @@ -805,7 +804,7 @@ void FontFilter::compareWhiteList() else Blacklist.append(sfont); } - qInfo() << "DBUS get font:" << DBUSWhitelist; - qInfo() << "Compare font get font:" << Whitelist; + qInfo() << "Font whitelist obtained through the dbus interface :" << DBUSWhitelist; + qInfo() << "Whitelist of real available fonts :" << Whitelist; } /******** Add by ut001000 renfeixiang 2020-06-15:增加 处理等宽字体的类 End***************/ diff --git a/src/customcommand/customcommandoptdlg.cpp b/src/customcommand/customcommandoptdlg.cpp index edd3758a9..478fec8fd 100644 --- a/src/customcommand/customcommandoptdlg.cpp +++ b/src/customcommand/customcommandoptdlg.cpp @@ -221,10 +221,10 @@ inline void CustomCommandOptDlg::slotShortCutLineEditingFinished(const QKeySeque QString reason; // 判断快捷键是否冲突 if (!ShortcutManager::instance()->checkShortcutValid(checkName, sequence.toString(), reason)) { - qInfo() << "checkShortcutValid"; + qWarning() << "Shortcut key conflict"; // 冲突 if (sequence.toString() != "Esc") { - qInfo() << "sequence != Esc"; + qWarning() << "The current shortcut key is not Esc! ("<< sequence <<")"; showShortcutConflictMsgbox(reason); } m_shortCutLineEdit->clear(); @@ -353,21 +353,21 @@ void CustomCommandOptDlg::slotAddSaveButtonClicked() strName = strName.trimmed();//空格的名称是无效的,剔除名称前后的空格 if (strName.isEmpty()) { - qInfo() << "Name is empty"; + qWarning() << "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) { - qInfo() << "The name should be no more than 32 characters"; + qWarning() << "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()) { - qInfo() << "Command is empty"; + qWarning() << "The custom command is empty"; m_commandLineEdit->showAlertMessage(tr("Please enter a command"), m_commandLineEdit->parentWidget()); return; } @@ -388,14 +388,14 @@ void CustomCommandOptDlg::slotAddSaveButtonClicked() QAction *refreshExitAction = nullptr; refreshExitAction = ShortcutManager::instance()->checkActionIsExist(*m_newAction); if (refreshExitAction) { - qInfo() << "CustomCommand already exists"; + qWarning() << "The custom command already exists"; accept(); return; } } if (strName == m_currItemData->m_cmdName && strCommand == m_currItemData->m_cmdText && keytmp == QKeySequence(m_currItemData->m_cmdShortcut)) { - qInfo() << "CustomCommand don't need to save again"; + qInfo() << "The custom command don't need to save again."; accept(); return; } @@ -403,7 +403,7 @@ void CustomCommandOptDlg::slotAddSaveButtonClicked() existAction = ShortcutManager::instance()->checkActionIsExistForModify(*m_newAction); if (strName != m_currItemData->m_cmdName) { - qInfo() << "CustomCommand is changed"; + qInfo() << "Custom commands have been changed."; QList &customCommandActionList = ShortcutManager::instance()->getCustomCommandActionList(); for (int i = 0; i < customCommandActionList.size(); i++) { QAction *curAction = customCommandActionList[i]; @@ -413,6 +413,7 @@ void CustomCommandOptDlg::slotAddSaveButtonClicked() } } } else { + qInfo() << "It is the add type of custom command operation"; existAction = ShortcutManager::instance()->checkActionIsExist(*m_newAction); } @@ -647,7 +648,7 @@ void CustomCommandOptDlg::closeEvent(QCloseEvent *event) void CustomCommandOptDlg::slotRefreshData(QString oldCmdName, QString newCmdName) { if (CCT_ADD == m_type) { - qInfo() << "Currently is the add operation interface"; + qWarning() << "Currently is the add operation interface"; return; } //不进行刷新操作 @@ -659,7 +660,7 @@ void CustomCommandOptDlg::slotRefreshData(QString oldCmdName, QString newCmdName return; } m_bRefreshCheck = true; - qInfo() << "slotRefreshData---" << m_nameLineEdit->text(); + qInfo() << "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 72b4d866b..f9d57082a 100644 --- a/src/customcommand/customcommandpanel.cpp +++ b/src/customcommand/customcommandpanel.cpp @@ -44,10 +44,10 @@ void CustomCommandPanel::showCurSearchResult() void CustomCommandPanel::showAddCustomCommandDlg() { if (m_pushButton->hasFocus()) { - qInfo() << "------------------------hasFocus"; + qInfo() << "The Add command button has focus to click on!"; m_bpushButtonHaveFocus = true; } else { - qInfo() << "------------------------ not hasFocus"; + qInfo() << "The Add command button has no focus to prohibit clicking!"; m_bpushButtonHaveFocus = false; } @@ -84,13 +84,13 @@ void CustomCommandPanel::onFocusOut(Qt::FocusReason type) // 下一个 或 列表为空, 焦点定位到添加按钮上 m_pushButton->setFocus(); m_cmdListWidget->clearIndex(); - qInfo() << "set focus on add pushButton"; + qInfo() << "Set the focus to the Add command button"; } else if (Qt::BacktabFocusReason == type) { // 判断是否可见,可见设置焦点 if (m_searchEdit->isVisible()) { m_searchEdit->lineEdit()->setFocus(); m_cmdListWidget->clearIndex(); - qInfo() << "set focus on add search edit"; + qInfo() << "Set the focus to the Search edit"; } } } @@ -171,7 +171,7 @@ void CustomCommandPanel::setFocusInPanel() // 添加按钮下 m_pushButton->setFocus(); } else { - qInfo() << "focus error unkown reason"; + qWarning() << "focus error unkown reason"; } } diff --git a/src/customcommand/customcommandplugin.cpp b/src/customcommand/customcommandplugin.cpp index 9ef0922a7..3041d2105 100644 --- a/src/customcommand/customcommandplugin.cpp +++ b/src/customcommand/customcommandplugin.cpp @@ -76,7 +76,7 @@ void CustomCommandPlugin::doShowPlugin(const QString name, bool bSetFocus) if (MainWindow::PLUGIN_TYPE_CUSTOMCOMMAND != name) { // 若插件已经显示,则隐藏 if (m_isShow) { - qInfo() << "Command top panel hide"; + qWarning() << "Command top panel hide"; getCustomCommandTopPanel()->hideAnim(); m_isShow = false; } diff --git a/src/customcommand/customcommandsearchrstpanel.cpp b/src/customcommand/customcommandsearchrstpanel.cpp index 0eced6e4c..574747b0c 100644 --- a/src/customcommand/customcommandsearchrstpanel.cpp +++ b/src/customcommand/customcommandsearchrstpanel.cpp @@ -120,7 +120,7 @@ inline void CustomCommandSearchRstPanel::handleListViewFocusOut(Qt::FocusReason // shift + tab 返回 返回键 // 列表为空,也返回到返回键上 m_rebackButton->setFocus(); m_cmdListWidget->clearIndex(); - qInfo() << "search panel type" << type; + qInfo() << "search panel type (" << type << ")"; } } @@ -144,7 +144,7 @@ void CustomCommandSearchRstPanel::refreshData(const QString &strFilter) void CustomCommandSearchRstPanel::doCustomCommand(const QString &strKey) { - qInfo() << "doCustomCommand,key=" << strKey; + qInfo() << "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 35fdfd685..d58139227 100644 --- a/src/customcommand/customcommandtoppanel.cpp +++ b/src/customcommand/customcommandtoppanel.cpp @@ -61,7 +61,7 @@ void CustomCommandTopPanel::showCustomCommandPanel() if (main != nullptr) { if (main->isFocusOnList()) { m_customCommandPanel->setFocusInPanel(); - qInfo() << "custom command panel has focus"; + qWarning() << "custom command panel has focus"; } } diff --git a/src/encodeplugin/encodelistmodel.cpp b/src/encodeplugin/encodelistmodel.cpp index 6b16f79db..b868ae509 100644 --- a/src/encodeplugin/encodelistmodel.cpp +++ b/src/encodeplugin/encodelistmodel.cpp @@ -87,10 +87,10 @@ void EncodeListModel::initEncodeData() } } if (!bFind) - qInfo() << "encode name :" << name << "not find!"; + qWarning() << "The encoding(" << name << ") in the terminal encoding list is not found in the list of supported encodeings!"; else m_encodeData << encodename; } - qInfo() << "QTextCodec::availableCodecs" << m_encodeData.count(); + qInfo() << "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 b6dfcf834..0d17b0e46 100644 --- a/src/encodeplugin/encodelistview.cpp +++ b/src/encodeplugin/encodelistview.cpp @@ -92,7 +92,8 @@ void EncodeListView::focusInEvent(QFocusEvent *event) // 判断焦点 if (Qt::TabFocusReason == m_foucusReason || Qt::BacktabFocusReason == m_foucusReason) { - qInfo() << __FUNCTION__ << m_foucusReason << "Current Encode:" << m_modelIndexChecked.data().toString(); + qInfo() << "The reason(" << m_foucusReason << ") for the current focus." + << "The encoding format(" << m_modelIndexChecked.data().toString() <<") in which focus is currently obtained."; setCurrentIndex(m_modelIndexChecked); } /** add end by ut001121 zhangmeng 20200718 */ @@ -187,14 +188,15 @@ void EncodeListView::mouseMoveEvent(QMouseEvent *event) void EncodeListView::onListViewClicked(const QModelIndex &index) { if (!index.isValid()) { - qInfo() << __FUNCTION__ << "Error:" << index; + qWarning() << "The current encoding format("<< index << ") is incorrect."; return; } QStandardItemModel *model = qobject_cast(this->model()); if (nullptr == model) return; - qInfo() << __FUNCTION__ << "Old:" << m_modelIndexChecked.data().toString() << "New:" << index.data().toString(); + qInfo() << "The encoding format(" << m_modelIndexChecked.data().toString() << ") selected last time." + << "The encoding format(" << index.data().toString()<< ") selected this time."; //当前Checked子项改为Unchecked状态 DStandardItem *modelItem = dynamic_cast(model->item(m_modelIndexChecked.row())); diff --git a/src/encodeplugin/encodepanelplugin.cpp b/src/encodeplugin/encodepanelplugin.cpp index a07a9abcc..467f5b104 100644 --- a/src/encodeplugin/encodepanelplugin.cpp +++ b/src/encodeplugin/encodepanelplugin.cpp @@ -102,6 +102,7 @@ void EncodePanelPlugin::initEncodePanel() void EncodePanelPlugin::setCurrentTermEncode(TermWidget *term) { QString encode; + qInfo() <<"Whether to link remote?" << term->isConnectRemote(); // 是否连接远程 if (term->isConnectRemote()) { // 远程编码 @@ -112,7 +113,7 @@ void EncodePanelPlugin::setCurrentTermEncode(TermWidget *term) } //更新编码 - qInfo() << __FUNCTION__ << term->isConnectRemote() << encode; + qInfo() << "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 38696221b..6566bc531 100644 --- a/src/main/dbusmanager.cpp +++ b/src/main/dbusmanager.cpp @@ -25,7 +25,7 @@ DBusManager::~DBusManager() QDBusConnection conn = QDBusConnection::sessionBus(); if (conn.registerService(TERMINALSERVER)) { conn.unregisterService(TERMINALSERVER); - qInfo() << "Terminal DBus disconnected!"; + qInfo() << "Deregister the dbus service of the terminal!"; } } @@ -35,12 +35,12 @@ bool DBusManager::initDBus() QDBusConnection conn = QDBusConnection::sessionBus(); if (!conn.registerService(TERMINALSERVER)) { - qInfo() << "Terminal DBus has connected!"; + qWarning() << "The dbus service of the terminal has been registered or failed to be registered!"; return false; } if (!conn.registerObject(TERMINALINTERFACE, this, QDBusConnection::ExportAllSlots)) { - qInfo() << "Terminal DBus creates Object failed!"; + qWarning() << "The dbus service on the terminal fails to create an object!"; return false; } @@ -54,12 +54,12 @@ int DBusManager::callKDECurrentDesktop() QDBusMessage response = QDBusConnection::sessionBus().call(msg); if (response.type() == QDBusMessage::ReplyMessage) { - qInfo() << "call currentDesktop Success!"; + qInfo() << "Calling the 'currentDesktop' interface successded!"; QList list = response.arguments(); return list.value(0).toInt(); } - qInfo() << "call currentDesktop Fail!" << response.errorMessage(); + qWarning() << "Failed to call the 'currentDesktop' interface'. msg: " << response.errorMessage(); return -1; } @@ -72,9 +72,9 @@ void DBusManager::callKDESetCurrentDesktop(int index) QDBusMessage response = QDBusConnection::sessionBus().call(msg); if (response.type() == QDBusMessage::ReplyMessage) - qInfo() << "call setCurrentDesktop Success!"; + qInfo() << "Calling the 'setCurrentDesktop' interface successded!"; else - qInfo() << "call setCurrentDesktop Fail!" << response.errorMessage(); + qWarning() << "Failed to call the 'setCurrentDesktop' interface'. msg: " << response.errorMessage(); } FontDataList DBusManager::callAppearanceFont(QString fontType) @@ -87,7 +87,7 @@ FontDataList DBusManager::callAppearanceFont(QString fontType) QDBusMessage response = QDBusConnection::sessionBus().call(msg); if (QDBusMessage::ReplyMessage == response.type()) { - qInfo() << "call List Success!"; + qInfo() << "Calling the 'List' interface successded!"; QList list = response.arguments(); QString fonts = list.value(list.count() - 1).toString(); // 原本的返回值为QDBusPendingReply => QString @@ -98,7 +98,7 @@ FontDataList DBusManager::callAppearanceFont(QString fontType) QStringList fontList = fonts.split(","); rList = callAppearanceFont(fontList, fontType); } else { - qInfo() << "call List Fail!" << response.errorMessage(); + qWarning() << "Failed to call the 'List' interface'. msg: " << response.errorMessage(); } @@ -114,7 +114,7 @@ FontDataList DBusManager::callAppearanceFont(QStringList fontList, QString fontT msg << fontType << fontList; QDBusMessage response = QDBusConnection::sessionBus().call(msg); if (response.type() == QDBusMessage::ReplyMessage) { - qInfo() << "call Show Success!"; + qInfo() << "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++) { @@ -123,7 +123,7 @@ FontDataList DBusManager::callAppearanceFont(QStringList fontList, QString fontT } qInfo() << "Show value" << retList.values(); } else { - qInfo() << "call Show Fail!" << response.errorMessage(); + qWarning() << "Failed to call the 'Show' interface'. msg: " << response.errorMessage(); } return retList; } @@ -137,9 +137,9 @@ void DBusManager::callTerminalEntry(QStringList args) QDBusMessage response = QDBusConnection::sessionBus().call(msg, QDBus::NoBlock); if (response.type() == QDBusMessage::ReplyMessage) - qInfo() << "call callTerminalEntry Success!"; + qInfo() << "Calling the 'callTerminalEntry' interface successded!"; else - qInfo() << "call callTerminalEntry!" << response.errorMessage(); + qWarning() << "Failed to call the 'callTerminalEntry' interface'. msg: " << response.errorMessage(); } void DBusManager::entry(QStringList args) @@ -221,9 +221,9 @@ void DBusManager::callSystemSound(const QString &sound) { QDBusMessage response = dbusPlaySound(sound); if (response.type() == QDBusMessage::ReplyMessage) - qInfo() << "call dbusPlaySound Success!"; + qInfo() << "Calling the 'dbusPlaySound' interface successded!"; else - qInfo() << "call dbusPlaySound!" << response.errorMessage(); + qWarning() << "Failed to call the 'dbusPlaySound' interface'. msg: " << response.errorMessage(); } void DBusManager::listenTouchPadSignal() @@ -233,7 +233,7 @@ void DBusManager::listenTouchPadSignal() if (isConnect) qInfo() << "connect to Guest, listen touchPad!"; else - qInfo() << "disconnect to Guest, cannot listen touchPad!"; + qWarning() << "disconnect to Guest, cannot listen touchPad!"; } void DBusManager::listenDesktopSwitched() @@ -243,5 +243,5 @@ void DBusManager::listenDesktopSwitched() if (isConnect) qInfo() << "connect to wm, listen workspaceswitched"; else - qInfo() << "disconnect to wm,cannot listen workspaceswitched"; + qWarning() << "disconnect to wm,cannot listen workspaceswitched"; } diff --git a/src/main/main.cpp b/src/main/main.cpp index 4a0779783..bf814e639 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -43,8 +43,16 @@ int main(int argc, char *argv[]) DApplicationSettings set(&app); // 系统日志 +#if !(DTK_VERSION >= DTK_VERSION_CHECK(5,6,5,0)) + DLogManager::registerJournalAppender(); +#ifdef QT_DEBUG + DLogManager::registerConsoleAppender(); +#endif +#else +// DLogManager::registerJournalAppender(); DLogManager::registerConsoleAppender(); DLogManager::registerFileAppender(); +#endif // 参数解析 TermProperties properties; diff --git a/src/main/mainwindow.cpp b/src/main/mainwindow.cpp index 9b336ffc3..7e9906796 100644 --- a/src/main/mainwindow.cpp +++ b/src/main/mainwindow.cpp @@ -124,15 +124,15 @@ MainWindow::MainWindow(TermProperties properties, QWidget *parent) // 主进程的启动时间存在APP中 TerminalApplication *app = static_cast(qApp); m_ReferedAppStartTime = app->getStartTime(); - qInfo() << "[main app] Start Time = " - << QDateTime::fromMSecsSinceEpoch(m_ReferedAppStartTime).toString("yyyy-MM-dd hh:mm:ss:zzz"); + qInfo() << "The time when the main program starts.[Start Time:" + << QDateTime::fromMSecsSinceEpoch(m_ReferedAppStartTime).toString("yyyy-MM-dd hh:mm:ss:zzz") << "]"; } else { - qInfo() << "[sub app] Start Time = " - << QDateTime::fromMSecsSinceEpoch(m_ReferedAppStartTime).toString("yyyy-MM-dd hh:mm:ss:zzz"); + qInfo() << "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(); - qInfo() << "MainWindow Create Time = " - << QDateTime::fromMSecsSinceEpoch(m_CreateWindowTime).toString("yyyy-MM-dd hh:mm:ss:zzz"); + qInfo() << "Time when the main window was created. [ Create Time:" + << QDateTime::fromMSecsSinceEpoch(m_CreateWindowTime).toString("yyyy-MM-dd hh:mm:ss:zzz") << "]";; } void MainWindow::initUI() @@ -265,7 +265,7 @@ inline void MainWindow::slotOptionButtonPressed() inline void MainWindow::slotClickNewWindowTimeout() { // 创建新的窗口 - qInfo() << "menu click new window"; + qInfo() << "Create a new window using the New Window button in the title bar menu."; TermWidgetPage *tabPage = currentPage(); TermWidget *term = tabPage->currentTerminal(); @@ -287,7 +287,7 @@ void MainWindow::initOptionButton() if (dtkbutton != nullptr) dtkbutton->hide(); else - qInfo() << "can not found DTitlebarDWindowQuitFullscreenButton in DTitlebar"; + qWarning() << "can not found DTitlebarDWindowQuitFullscreenButton in DTitlebar"; // option button DIconButton *optionBtn = titlebar()->findChild("DTitlebarDWindowOptionButton"); @@ -295,7 +295,7 @@ void MainWindow::initOptionButton() // mainwindow的设置按钮触发 connect(titlebar()->findChild("DTitlebarDWindowOptionButton"), &DIconButton::pressed, this, &MainWindow::slotOptionButtonPressed); } else { - qInfo() << "can not found DTitlebarDWindowOptionButton in DTitlebar"; + qWarning() << "can not found DTitlebarDWindowOptionButton in DTitlebar"; } } @@ -383,7 +383,7 @@ void MainWindow::singleFlagMove() { if (m_properties[SingleFlag].toBool()) { Dtk::Widget::moveToCenter(this); - qInfo() << "SingleFlag move" ; + qInfo() << "The window moves to the center of the screen" ; } } @@ -401,14 +401,15 @@ void MainWindow::addTab(TermProperties properties, bool activeTab) { qint64 startTime = QDateTime::currentMSecsSinceEpoch(); //如果不允许新建标签,则返回 - if (!beginAddTab()) + if (!beginAddTab()){ + qWarning() << "Cannot create new labels"; return; - + } TermWidgetPage *termPage = new TermWidgetPage(properties, this); // pageID存在 tab中,所以page增删改操作都要由tab发起。 int index = m_tabbar->addTab(termPage->identifier(), termPage->getCurrentTerminalTitle()); - qInfo() << "addTab index" << index; + qInfo() << "The associated index(" << index <<") of the newly added label."; endAddTab(termPage, activeTab, index, startTime); } @@ -427,7 +428,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); - qInfo() << "insertTab index" << index; + qInfo() << "Insert the associated index("<< index << ") of the label"; //拖拽过程中存在一种标签预览模式,此时不需要真实添加 if (!isVirtualAdd) { @@ -479,7 +480,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); - qInfo() << qPrintable(strNewTabTime); + qInfo() << "Add label end.Takes Time: " << qPrintable(strNewTabTime); QString expandThemeStr = ""; expandThemeStr = Settings::instance()->extendColorScheme(); @@ -525,7 +526,7 @@ void MainWindow::closeTab(const QString &identifier, bool hasConfirmed) showExitConfirmDialog(Utils::CloseType_Tab, tabPage->runningTerminalCount(), this); return; } - qInfo() << "Tab closed" << identifier; + qInfo() << "Close tab(" << identifier << ")"; m_tabVisitMap.remove(identifier); m_tabChangeColorMap.remove(identifier); m_tabbar->removeTab(identifier); @@ -540,7 +541,7 @@ void MainWindow::closeTab(const QString &identifier, bool hasConfirmed) focusCurrentPage(); return; } - qInfo() << "mainwindow close"; + qInfo() << "Main window closed!"; close(); } @@ -561,7 +562,7 @@ void MainWindow::removeTermWidgetPage(const QString &identifier, bool isDelete) // 当所有tab标签页都关闭时,关闭整个MainWindow窗口 if (m_termWidgetPageMap.isEmpty()) { - qInfo() << "removeTermWidgetPage mainwindow close"; + qWarning() << "No other tabs exist and the main window is closed!"; /******** Modify by ut000438 王亮 2020-11-23:fix bug 55552:拖动标签页移动窗口过程中异常最大化 ***************/ //当拖动标签过程中销毁窗口时,不保存销毁的窗口大小 m_IfUseLastSize = false; @@ -632,10 +633,10 @@ bool MainWindow::isFocusOnList() qInfo() << "focus on " << objectName; } } else { - qInfo() << "can not found objectName in DIconButton"; + qWarning() << "can not found objectName in DIconButton"; } } - qInfo() << "focus on list : " << isFocus; + qInfo() << "Is focus on list? " << isFocus; return isFocus; } @@ -661,7 +662,7 @@ void MainWindow::closeOtherTab(const QString &identifier, bool hasConfirmed) // 关闭其它窗口,需要检测 for (QString &id : closeTabIdList) { closeTab(id, true); - qInfo() << " close" << id; + qDebug() << "Id(" << id << ") of the close tab? "; } //如果是不关闭当前页的,最后回到当前页来. @@ -681,7 +682,7 @@ void MainWindow::closeAllTab() // 全部关闭时,不再检测了, for (QString &id : closeTabIdList) { closeTab(id, true); - qInfo() << " close" << id; + qDebug() << "Id(" << id << ") of the close tab? "; } return; @@ -695,9 +696,9 @@ inline void MainWindow::slotDDialogFinished(int result) DIconButton *closeBtn = titlebar()->findChild("DTitlebarDWindowCloseButton"); if (closeBtn != nullptr) { closeBtn->setFocus(); - qInfo() << "close button setFocus"; + qInfo() << "Close button to get focus!"; } else { - qInfo() << "can not found DTitlebarDWindowCloseButton in DTitlebar"; + qWarning() << "Can not found DTitlebarDWindowCloseButton in DTitlebar"; } } /********************* Modify by n014361 wangpeili End ************************/ @@ -724,11 +725,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; - qInfo() << "before close window, focus widget is close button. "; + qInfo() << "Before close window, focus widget is close button. "; } if (nullptr == closeBtn) - qInfo() << "can not found DTitlebarDWindowCloseButton in DTitlebar"; + qInfo() << "Can not found DTitlebarDWindowCloseButton in DTitlebar"; /********************* Modify by n014361 wangpeili End ************************/ @@ -898,8 +899,8 @@ void MainWindow::closeEvent(QCloseEvent *event) if ((!m_hasConfirmedClose) && (runningCount != 0)) { // 如果不能马上关闭,并且还在没有最小化. + qInfo() << "Minimal mode or not?" << isMinimized(); if ((runningCount != 0) && isMinimized()) { - qInfo() << "isMinimized........... " << endl; setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive); } @@ -950,7 +951,7 @@ QString MainWindow::getConfigWindowState() // 启动参数配置的状态值优先于 内部配置的状态值 if (m_properties.contains(StartWindowState)) { QString state = m_properties[StartWindowState].toString(); - qInfo() << "use line state set:" << state; + qInfo() << "State(" << state << ") of the start window."; if ("maximum" == state) windowState = "window_maximum"; else if (state == "splitscreen") @@ -960,7 +961,7 @@ QString MainWindow::getConfigWindowState() else if (state == "fullscreen") windowState = state; else - qInfo() << "error line state set:" << state << "ignore it!"; + qWarning() << "Error line state set:" << state << "ignore it!"; } return windowState; } @@ -1098,6 +1099,8 @@ inline void MainWindow::slotShortcutSwitchActivated() { QShortcut *switchShortcut = qobject_cast(sender()); int i = switchShortcut->property("index").toInt(); + qDebug() << "Shortcut key selected label index(" << i - 1 << ")"; + qDebug() << "How many tabs exist in the current window?" << m_tabbar->count(); TermWidgetPage *page = currentPage(); if (page) { assert(m_tabbar); @@ -1107,15 +1110,14 @@ inline void MainWindow::slotShortcutSwitchActivated() } if (i - 1 >= m_tabbar->count()) { - qInfo() << "i - 1 > tabcount" << i - 1 << m_tabbar->count() << endl; + qWarning() <<"The index(" << i -1 << ") of the current tab exceeds the total number of the current windows tabs(" << m_tabbar->count() << ")"; return; } - qInfo() << "index" << i - 1 << endl; m_tabbar->setCurrentIndex(i - 1); return; } - qInfo() << "currentPage nullptr ??"; + qWarning() << "Current Page is Nullptr!"; } inline void MainWindow::slotShortcutNewTab() @@ -1179,7 +1181,7 @@ inline void MainWindow::slotShortcutHorizonzalSplit() } } } - qInfo() << "can't split vertical again"; + qInfo() << "Can't split horizonzal again"; } inline void MainWindow::slotShortcutVerticalSplit() @@ -1198,12 +1200,11 @@ inline void MainWindow::slotShortcutVerticalSplit() } } } - qInfo() << "can't split vertical again"; + qInfo() << "Can't split vertical again"; } inline void MainWindow::slotShortcutSelectUpperWorkspace() { - qInfo() << "Alt+k"; TermWidgetPage *page = currentPage(); if (page) page->focusNavigation(Qt::TopEdge); @@ -1234,7 +1235,7 @@ inline void MainWindow::slotShortcutCloseWorkspace() { TermWidgetPage *page = currentPage(); if (page) { - qInfo() << "CloseWorkspace"; + qInfo() << "Close Works pace"; page->closeSplit(page->currentTerminal()); } } @@ -1308,7 +1309,7 @@ inline void MainWindow::slotShortcutSelectAll() { TermWidgetPage *page = currentPage(); if (page) { - qInfo() << "selectAll"; + qInfo() << "Select all pages using the shortcut keys"; page->selectAll(); } } @@ -1646,7 +1647,6 @@ void MainWindow::displayShortcuts() void MainWindow::createJsonGroup(const QString &keyCategory, QJsonArray &jsonGroups) { - qInfo() << keyCategory; QString strGroupName = ""; if ("tab" == keyCategory) @@ -1791,7 +1791,7 @@ inline void MainWindow::onUploadFileDialogFinished(int code) } remoteUploadFile(strTxt); } else { - qInfo() << "remoteUploadFile file name is Null"; + qWarning() << "remoteUploadFile file name is Null"; } } @@ -1885,7 +1885,7 @@ void MainWindow::OnHandleCloseType(int result, Utils::CloseType type) TermWidgetPage *page = currentPage(); if (nullptr == page) { - qInfo() << "null pointer of currentPage ???"; + qWarning() << "null pointer of currentPage ???"; return; } @@ -2561,37 +2561,37 @@ void NormalWindow::initTitleBar() if (addButton != nullptr) addButton->setFocusPolicy(Qt::TabFocus); else - qInfo() << "can not found AddButton in DIconButton"; + qWarning() << "can not found AddButton in DIconButton"; DIconButton *optionBtn = titlebar()->findChild("DTitlebarDWindowOptionButton"); if (optionBtn != nullptr) optionBtn->setFocusPolicy(Qt::TabFocus); else - qInfo() << "can not found DTitlebarDWindowOptionButton in DTitlebar"; + qWarning() << "can not found DTitlebarDWindowOptionButton in DTitlebar"; QWidget *quitFullscreenBtn = titlebar()->findChild("DTitlebarDWindowQuitFullscreenButton"); if (quitFullscreenBtn != nullptr) quitFullscreenBtn->setFocusPolicy(Qt::TabFocus); else - qInfo() << "can not found DTitlebarDWindowQuitFullscreenButton in DTitlebar"; + qWarning() << "can not found DTitlebarDWindowQuitFullscreenButton in DTitlebar"; DIconButton *minBtn = titlebar()->findChild("DTitlebarDWindowMinButton"); if (minBtn != nullptr) minBtn->setFocusPolicy(Qt::TabFocus); else - qInfo() << "can not found DTitlebarDWindowMinButton in DTitlebar"; + qWarning() << "can not found DTitlebarDWindowMinButton in DTitlebar"; DIconButton *maxBtn = titlebar()->findChild("DTitlebarDWindowMaxButton"); if (maxBtn != nullptr) maxBtn->setFocusPolicy(Qt::TabFocus); else - qInfo() << "can not found DTitlebarDWindowMaxButton in DTitlebar"; + qWarning() << "can not found DTitlebarDWindowMaxButton in DTitlebar"; DIconButton *closeBtn = titlebar()->findChild("DTitlebarDWindowCloseButton"); if (closeBtn != nullptr) closeBtn->setFocusPolicy(Qt::TabFocus); else - qInfo() << "can not found DTitlebarDWindowCloseButton in DTitlebar"; + qWarning() << "can not found DTitlebarDWindowCloseButton in DTitlebar"; if (addButton != nullptr && optionBtn != nullptr && quitFullscreenBtn != nullptr && minBtn != nullptr && maxBtn != nullptr && closeBtn != nullptr) { QWidget::setTabOrder(addButton, optionBtn); @@ -2784,7 +2784,7 @@ void QuakeWindow::initTitleBar() void QuakeWindow::slotWorkAreaResized() { - qInfo() << "workAreaResized" << QApplication::desktop()->availableGeometry(); + qInfo() << "Workspace size change!"; /******** Modify by nt001000 renfeixiang 2020-05-20:修改成只需要设置雷神窗口宽度,根据字体高度设置雷神最小高度 Begin***************/ setMinimumWidth(QApplication::desktop()->availableGeometry().width()); setWindowMinHeightForFont(); @@ -2792,7 +2792,6 @@ void QuakeWindow::slotWorkAreaResized() updateMinHeight(); /******** Modify by nt001000 renfeixiang 2020-05-20:修改成只需要设置雷神窗口宽度,根据字体高度设置雷神最小高度 End***************/ move(QApplication::desktop()->availableGeometry().x(), QApplication::desktop()->availableGeometry().y()); - qInfo() << "size" << size(); setFixedWidth(QApplication::desktop()->availableGeometry().width()); return ; } @@ -2909,7 +2908,7 @@ void QuakeWindow::setWindowMinHeightForFont() /******** Add by nt001000 renfeixiang 2020-05-20:增加雷神窗口根据字体和字体大小设置最小高度函数 End***************/ void QuakeWindow::updateMinHeight() { - qInfo() << "start updateMinHeight"; + qInfo() << "Start update min height"; bool hasHorizontalSplit = false; int count = m_termStackWidget->count(); for (int i = 0; i < count; i++) { diff --git a/src/main/service.cpp b/src/main/service.cpp index 5bb89f112..a79e00e23 100644 --- a/src/main/service.cpp +++ b/src/main/service.cpp @@ -129,7 +129,7 @@ void Service::showHideOpacityAndBlurOptions(bool isShow) { QWidget *rightFrame = m_settingDialog->findChild("RightFrame"); if (nullptr == rightFrame) { - qInfo() << "can not found RightFrame in QWidget"; + qWarning() << "can not found RightFrame in QWidget"; return; } @@ -213,10 +213,10 @@ bool Service::isWindowEffectEnabled() return true; } } else { - qInfo() << "call CurrentWM Fail!" << response.errorMessage(); + qWarning() << "call CurrentWM Fail!" << response.errorMessage(); } - qInfo() << "The window effects is off"; + qWarning() << "The window effects is off"; return false; } @@ -264,7 +264,7 @@ QMap Service::getShells() } } while (!shellLine.isNull()); } else { - qInfo() << "read /etc/shells fail! error : " << shellsInfo.error(); + qWarning() << "read /etc/shells fail! error : " << shellsInfo.error(); } // 关闭文件 shellsInfo.close(); @@ -311,7 +311,7 @@ void Service::showSettingDialog(MainWindow *pOwner) Settings::instance()->reloadShellOptions(); m_settingDialog->show(); } else { - qInfo() << "No setting dialog."; + qWarning() << "No setting dialog."; return; } // 激活窗口 @@ -431,7 +431,7 @@ void Service::EntryTerminal(QStringList arguments, bool isMain) return; // 超出最大窗口数量 if(WindowsManager::instance()->widgetCount() >= MAXWIDGETCOUNT) { - qInfo() << QString("terminal cannot be created: %1/%2 ") + qWarning() << QString("terminal cannot be created: %1/%2 ") .arg(WindowsManager::instance()->widgetCount()) .arg(MAXWIDGETCOUNT) ; diff --git a/src/main/terminalapplication.cpp b/src/main/terminalapplication.cpp index 1c4fcbccc..6b55bb2bf 100644 --- a/src/main/terminalapplication.cpp +++ b/src/main/terminalapplication.cpp @@ -53,7 +53,7 @@ qint64 TerminalApplication::getStartTime() void TerminalApplication::handleQuitAction() { - qInfo() << "handleQuitAction"; + qInfo() << "Handle quit action"; activeWindow()->close(); } @@ -151,7 +151,6 @@ bool TerminalApplication::notify(QObject *object, QEvent *event) /***add begin by ut001121 zhangmeng 20200825 模拟发送ContextMenu事件 修复BUG44282***/ QPoint pos; QContextMenuEvent menuEvent(QContextMenuEvent::Keyboard, pos); - qInfo() << "------------" << menuEvent.type(); QApplication::sendEvent(object, &menuEvent); /***add end by ut001121***/ @@ -164,7 +163,6 @@ bool TerminalApplication::notify(QObject *object, QEvent *event) #if 0 // 快捷键检测 bool spont = event->spontaneous(); - //qInfo() <type()<< spont<metaObject()->className(); if ((event->type() == QEvent::KeyPress || event->type() == QEvent::Shortcut) /*&& QString(object->metaObject()->className()) == "MainWindow"*/) { @@ -177,7 +175,6 @@ bool TerminalApplication::notify(QObject *object, QEvent *event) if (event->type() == QEvent::Shortcut) { QShortcutEvent *sevent = static_cast(event); keyString = QKeySequence(sevent->key()).toString(QKeySequence::PortableText); - // qInfo()<<"Shortcut"<key(); } int uKey = keyevent->key(); @@ -200,8 +197,6 @@ bool TerminalApplication::notify(QObject *object, QEvent *event) uKey += Qt::ALT; QString keyString2 = QKeySequence(uKey).toString(QKeySequence::PortableText); - qInfo() << keyevent->type() << keyString2 << keyString << object << keyevent->spontaneous() << classname << keyevent->key() - << keyevent->nativeScanCode() << keyevent->nativeVirtualKey() << keyevent->nativeModifiers(); } #endif diff --git a/src/main/windowsmanager.cpp b/src/main/windowsmanager.cpp index f8a8f9f31..e83192858 100644 --- a/src/main/windowsmanager.cpp +++ b/src/main/windowsmanager.cpp @@ -20,7 +20,7 @@ WindowsManager *WindowsManager::instance() void WindowsManager::runQuakeWindow(TermProperties properties) { if (nullptr == m_quakeWindow) { - qInfo() << "runQuakeWindow :create"; + qInfo() << "Create QuakeWindow!"; m_quakeWindow = new QuakeWindow(properties); //Add by ut001000 renfeixiang 2020-11-16 设置开始雷神动画效果标志 m_quakeWindow->setAnimationFlag(false); @@ -90,7 +90,7 @@ void WindowsManager::createNormalWindow(TermProperties properties, bool isShow) newWindow->show(); qint64 newMainWindowTime = newWindow->createNewMainWindowTime(); QString strNewMainWindowTime = GRAB_POINT + LOGO_TYPE + CREATE_NEW_MAINWINDOE + QString::number(newMainWindowTime); - qInfo() << qPrintable(strNewMainWindowTime); + qInfo() << "Create NormalWindow Time:" << qPrintable(strNewMainWindowTime); } void WindowsManager::onMainwindowClosed(MainWindow *window) @@ -110,7 +110,7 @@ void WindowsManager::onMainwindowClosed(MainWindow *window) m_normalWindowList.removeOne(window); } else { //Q_ASSERT(false); - qInfo() << "unkown windows closed " << window; + qWarning() << "unkown windows closed " << window; } window->deleteLater(); diff --git a/src/remotemanage/remotemanagementplugn.cpp b/src/remotemanage/remotemanagementplugn.cpp index 936558f81..02492a54c 100644 --- a/src/remotemanage/remotemanagementplugn.cpp +++ b/src/remotemanage/remotemanagementplugn.cpp @@ -129,7 +129,7 @@ void RemoteManagementPlugin::doCennectServer(ServerConfig *curServer) // 判断是否连接服务器 if (!term->isInRemoteServer()) { // 没有连接上 - qInfo() << "disconnect to server"; + qWarning() << "disconnect to server"; return; } // 标记此term连接远程 diff --git a/src/remotemanage/remotemanagementtoppanel.cpp b/src/remotemanage/remotemanagementtoppanel.cpp index a0d38a2e3..a3ad9e1a1 100644 --- a/src/remotemanage/remotemanagementtoppanel.cpp +++ b/src/remotemanage/remotemanagementtoppanel.cpp @@ -104,7 +104,7 @@ void RemoteManagementTopPanel::showSearchPanel(const QString &strFilter) connect(animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater); } else { animation1->deleteLater(); - qInfo() << "unknow current panel!"; + qWarning() << "unknow current panel!"; return; } // 执行动画 @@ -149,7 +149,7 @@ void RemoteManagementTopPanel::showGroupPanel(const QString &strGroupName, bool connect(animation, &QPropertyAnimation::finished, m_remoteManagementPanel, &QWidget::hide); connect(animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater); } else { - qInfo() << "unknow current panel!"; + qWarning() << "unknow current panel!"; animation1->deleteLater(); return; } @@ -203,7 +203,7 @@ void RemoteManagementTopPanel::showPrevPanel() // 获取前一个界面的类型,此界面为现在要显示的界面 state = m_prevPanelStack.pop(); prevType = state.m_type; - qInfo() << "prevType" << prevType; + qInfo() << "Gets the reality type of the previous interface: " << prevType; } // 动画效果 要隐藏的界面 @@ -219,7 +219,7 @@ void RemoteManagementTopPanel::showPrevPanel() connect(animation, &QPropertyAnimation::finished, m_serverConfigGroupPanel, &QWidget::hide); connect(animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater); } else { - qInfo() << "unknow panel to hide!" << m_currentPanelType; + qWarning() << "unknow panel to hide!" << m_currentPanelType; } // 动画效果 要显示的界面 @@ -250,7 +250,7 @@ void RemoteManagementTopPanel::showPrevPanel() case ServerConfigManager::PanelType_Search: { // 刷新列表 => 搜索框能被返回,只能是全局搜索 if (m_filterStack.isEmpty()) { - qInfo() << "error: filter stack is empty!"; + qWarning() << "error: filter stack is empty!"; return; } // 取最上一个 @@ -268,7 +268,7 @@ void RemoteManagementTopPanel::showPrevPanel() break; } if (nullptr == animation || nullptr == animation1) { - qInfo() << "do not has animation"; + qWarning() << "do not has animation"; if (nullptr != animation1) animation1->deleteLater(); @@ -301,7 +301,7 @@ void RemoteManagementTopPanel::showPrevPanel() m_remoteManagementSearchPanel->setFocusBack(m_group, state.m_isFocusOn, state.m_currentListIndex); } } else { - qInfo() << "unknow panel"; + qWarning() << "unknow panel"; } } diff --git a/src/remotemanage/serverconfiggrouppanel.cpp b/src/remotemanage/serverconfiggrouppanel.cpp index f6a675f26..14a2530eb 100644 --- a/src/remotemanage/serverconfiggrouppanel.cpp +++ b/src/remotemanage/serverconfiggrouppanel.cpp @@ -103,7 +103,6 @@ inline void ServerConfigGroupPanel::onListViewFocusOut(Qt::FocusReason type) int count = ServerConfigManager::instance()->getServerCount(m_groupName); if (0 == count) { emit rebackPrevPanel(); - qInfo() << "showRemoteManagementPanel" << isFocus << count; m_isShow = false; return; } @@ -127,7 +126,7 @@ inline void ServerConfigGroupPanel::onRefreshList() void ServerConfigGroupPanel::refreshData(const QString &groupName) { - qInfo() << __FUNCTION__; + qInfo() << "Refresh Data!"; m_groupName = groupName; m_listWidget->clearData(); ServerConfigManager::instance()->refreshServerList(ServerConfigManager::PanelType_Group, m_listWidget, "", groupName); @@ -136,7 +135,6 @@ void ServerConfigGroupPanel::refreshData(const QString &groupName) void ServerConfigGroupPanel::setFocusBack() { - qInfo() << __FUNCTION__; // 设置焦点到搜索框 if (m_searchEdit->isVisible()) { // 显示搜索框 @@ -188,5 +186,5 @@ void ServerConfigGroupPanel::onItemClicked(const QString &key) if (nullptr != remote) emit doConnectServer(remote); else - qInfo() << "can't connect to remote" << key; + qWarning() << "can't connect to remote" << key; } diff --git a/src/remotemanage/serverconfigmanager.cpp b/src/remotemanage/serverconfigmanager.cpp index 617afcf9d..c3e3ce3f8 100644 --- a/src/remotemanage/serverconfigmanager.cpp +++ b/src/remotemanage/serverconfigmanager.cpp @@ -165,7 +165,7 @@ void ServerConfigManager::initServerConfig() QStringList strList = serverName.split("@"); ServerConfig *pServerConfig = new ServerConfig(); if (strList.count() < 3) { - qInfo() << __FUNCTION__ << serverName << strList.count() << "error"; + qWarning() << "An unknoew error exists on the current server(" << serverName << ")"; continue; } // 新版数据的读取方式 @@ -271,7 +271,7 @@ void ServerConfigManager::saveServerConfig(ServerConfig *config) // 添加密码 remoteStoreSecreats(config); - qInfo() << "append success!" << config->m_group << config->m_serverName; + qInfo() << "The server configuration is added successfully.The Config group: " << config->m_group << ".The Server name:"<< config->m_serverName; } @@ -386,7 +386,7 @@ void ServerConfigManager::removeDialog(ServerConfigOptDlg *dlg) void ServerConfigManager::SyncData(QString key, ServerConfig *newConfig) { - qInfo() << key << newConfig->m_serverName; + qInfo() <<"Sync Data! Key: " << key << ";Server Name:" << newConfig->m_serverName; //前提是key唯一 // serverName被修改 if (key != newConfig->m_serverName) { @@ -407,17 +407,17 @@ void ServerConfigManager::SyncData(QString key, ServerConfig *newConfig) void ServerConfigManager::closeAllDialog(QString key) { - qInfo() << __FUNCTION__ << "remote name : " << key << m_serverConfigDialogMap.count(); + qInfo() << "Close ALL Dialogs for the remote server! Remote name : " << key ; // 判读此时这个key是否存在 if (!m_serverConfigDialogMap.contains(key)) { // 不存在退出 - qInfo() << __FUNCTION__ << "not contains " << key; + qWarning() << "The current remote(" << key <<") server does not exist!"; return; } for (auto &item : m_serverConfigDialogMap[key]) { if (item != nullptr) { - qInfo() << __FUNCTION__ << "reject : " << item; + qInfo() << "Reject the current remote window(" << item << ")!"; // reject就会把当前的窗口删除 item->reject(); } @@ -427,7 +427,7 @@ void ServerConfigManager::closeAllDialog(QString key) int ServerConfigManager::getServerCount(const QString &strGroupName) { if (strGroupName.isEmpty() || strGroupName.isNull()) { - qInfo() << "enter error group name:" << strGroupName << "! please confirm again!"; + qWarning() << "enter error group name:" << strGroupName << "! please confirm again!"; return -1; } if (m_serverConfigs.contains(strGroupName)) { @@ -450,7 +450,7 @@ ServerConfig *ServerConfigManager::getServerConfig(const QString &key) } } // 没找到返回空 - qInfo() << "can't find remote key : " << key; + qWarning() << "can't find remote key : " << key; return nullptr; } @@ -476,7 +476,7 @@ static void on_password_lookup(GObject *source, GAsyncResult *result, gpointer u if (error != NULL) { /* ... handle the failure here */ - qInfo() << error->message; + qWarning() << "Failed to get password! error msg:" << error->message; g_error_free(error); emit reback->manager->lookupSerceats(reback->key, ""); } else if (password == NULL) { @@ -528,7 +528,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 */ - qInfo() << error->message; + qWarning() << "Failed to store password! error msg:" << error->message; g_error_free(error); } else { /* ... do something now that the password has been stored */ @@ -566,7 +566,7 @@ static void on_password_cleared(GObject *source, GAsyncResult *result, gpointer if (error != NULL) { /* ... handle the failure here */ - qInfo() << __FUNCTION__ << error->message; + qWarning() << "Failed to clear password! error msg:" << error->message; g_error_free(error); } else { diff --git a/src/remotemanage/serverconfigoptdlg.cpp b/src/remotemanage/serverconfigoptdlg.cpp index 6bf966b5a..e2f88b844 100644 --- a/src/remotemanage/serverconfigoptdlg.cpp +++ b/src/remotemanage/serverconfigoptdlg.cpp @@ -560,7 +560,7 @@ void ServerConfigOptDlg::slotAddSaveButtonClicked() ServerConfigManager::instance()->modifyServerConfig(config, m_curServer); } accept(); - qInfo() << __FUNCTION__ << "add or save remote config finish"; + qInfo() << "Add or save remote config finish"; } void ServerConfigOptDlg::slotFileChooseDialog() diff --git a/src/settings/settings.cpp b/src/settings/settings.cpp index 2ebe374a1..6d09c53ee 100644 --- a/src/settings/settings.cpp +++ b/src/settings/settings.cpp @@ -128,7 +128,7 @@ void Settings::init() windowState->setData("items", windowStateMap); for (QString &key : settings->keys()) - qInfo() << key << settings->value(key); + qDebug() <<"Config' Key: " << key << " Config' Value: " << settings->value(key); /********************* Modify by n014361 wangpeili End ************************/ initConnection(); @@ -139,7 +139,6 @@ void Settings::init() m_Watcher = new QFileSystemWatcher(); m_Watcher->addPath(m_configPath); connect(m_Watcher, &QFileSystemWatcher::fileChanged, this, [this](QString file) { - qInfo() << "fileChanged" << file; reload(); //监控完一次就不再监控了,所以要再添加 m_Watcher->addPath(m_configPath); @@ -393,12 +392,10 @@ bool Settings::OutputtingScroll() // for (QString &key : newSettings.childGroups()) { // // 当系统变更键值的时候,配置文件中会有一些"垃圾"配置,删除他 // if (!settings->keys().contains(key)) { -// qInfo() << "reload failed: system not found " << key << "now remove it"; // newSettings.remove(key); // continue; // } // if (settings->value(key) != newSettings.value(key + "/value")) { -// qInfo() << "reload update:" << key << settings->value(key); // settings->option(key)->setValue(newSettings.value(key + "/value")); // } // } @@ -502,7 +499,6 @@ void Settings::setExtendColorScheme(const QString &name) // if (name != m_EncodeName) { // m_EncodeName = name; // emit encodeSettingChanged(name); -// qInfo() << "encode changed to" << name; // } //} @@ -556,7 +552,7 @@ void Settings::handleWidthFont() int ret = base.addApplicationFont(fontpath); if (-1 == ret) - qInfo() << "load " << name << " font faild"; + qWarning() << "load " << name << " font faild"; } } @@ -753,7 +749,8 @@ QPair Settings::createShortcutEditOptionHandle(/*DSettings // 配置修改 option->connect(option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, rightWidget, [ = ](const QVariant & value) { QString keyseq = value.toString(); - qInfo() << "valueChanged" << rightWidget->option()->key() << keyseq; + qInfo() << "Current configuration modification! Config's Key: " << rightWidget->option()->key() + << "Config's Value: " << keyseq; if (SHORTCUT_VALUE == keyseq || keyseq.isEmpty()) { rightWidget->clear(); return; @@ -863,7 +860,7 @@ void Settings::setConsoleShell(const QString shellName) { QMap shellMap = Service::instance()->getShells(); for (auto itr = shellMap.begin(); itr != shellMap.end(); ++itr) { - qDebug() << itr.key() << itr.value() << shellName; + qDebug() <<"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 77649d9f3..77a3d934a 100644 --- a/src/settings/shortcutmanager.cpp +++ b/src/settings/shortcutmanager.cpp @@ -257,7 +257,6 @@ bool ShortcutManager::checkShortcutValid(const QString &Name, const QString &Key } /********************* Modify by ut000610 daizhengwen End ************************/ QString style = QString("%1").arg(key); - qInfo() << style; // 单键 if (0 == Key.count("+")) { diff --git a/src/views/customthemesettingdialog.cpp b/src/views/customthemesettingdialog.cpp index 75a29b909..a1265cdc8 100644 --- a/src/views/customthemesettingdialog.cpp +++ b/src/views/customthemesettingdialog.cpp @@ -128,7 +128,6 @@ void ColorPushButton::focusOutEvent(QFocusEvent *event) { // 焦点Tab出 if ((Qt::TabFocusReason == event->reason()) || (Qt::BacktabFocusReason == event->reason())) { - qInfo() << "ColorPushButton::focusOutEvent-------163" ; m_isFocus = false; } DPushButton::focusOutEvent(event); @@ -442,7 +441,6 @@ void CustomThemeSettingDialog::addCancelConfirmButtons() connect(m_cancelBtn, &DPushButton::clicked, this, [ = ]() { m_confirmBtn->setFocus(); - qInfo() << "------------reject()-------------"; loadConfiguration(); reject(); }); @@ -528,13 +526,12 @@ void CustomThemeSettingDialog::loadConfiguration() QPalette palette; QStringList strList = Settings::instance()->themeSetting->value("Foreground/Color").toStringList(); + qInfo() << "Foreground color list number: " << strList.size(); if (strList.size() != 3) { - qInfo() << "strList.size()!=3"; palette.setColor(QPalette::Background, QColor(0, 255, 0)); foregroundColorParameter = QColor(0, 255, 0); } else { palette.setColor(QPalette::Background, QColor(strList[0].toInt(), strList[1].toInt(), strList[2].toInt())); - qInfo() << strList[0] << strList[1] << strList[2]; foregroundColorParameter = QColor(strList[0].toInt(), strList[1].toInt(), strList[2].toInt()); } m_foregroundButton->setBackGroundColor(foregroundColorParameter); @@ -542,8 +539,8 @@ void CustomThemeSettingDialog::loadConfiguration() QColor backgroundColorParameter; strList.clear(); strList = Settings::instance()->themeSetting->value("Background/Color").toStringList(); + qInfo() << "Background color list number: " << strList.size(); if (strList.size() != 3) { - qInfo() << "strList.size()!=3"; palette.setColor(QPalette::Background, QColor(37, 37, 37)); backgroundColorParameter = QColor(37, 37, 37); } else { @@ -555,8 +552,8 @@ void CustomThemeSettingDialog::loadConfiguration() QColor ps1ColorParameter; strList.clear(); strList = Settings::instance()->themeSetting->value("Color2Intense/Color").toStringList(); + qInfo() << "Color2Intense color list number: " << strList.size(); if (strList.size() != 3) { - qInfo() << "strList.size()!=3"; palette.setColor(QPalette::Background, QColor(133, 153, 0)); ps1ColorParameter = QColor(133, 153, 0); } else { @@ -568,8 +565,8 @@ void CustomThemeSettingDialog::loadConfiguration() QColor ps2ColorParameter; strList.clear(); strList = Settings::instance()->themeSetting->value("Color4Intense/Color").toStringList(); + qInfo() << "Color4Intense color list number: " << strList.size(); if (strList.size() != 3) { - qInfo() << "strList.size()!=3"; palette.setColor(QPalette::Background, QColor(52, 101, 164)); ps2ColorParameter = QColor(52, 101, 164); } else { diff --git a/src/views/itemwidget.cpp b/src/views/itemwidget.cpp index 0ccba9979..14a696dfe 100644 --- a/src/views/itemwidget.cpp +++ b/src/views/itemwidget.cpp @@ -101,7 +101,7 @@ void ItemWidget::setText(const QString &firstline, const QString &secondline) // 第二行 组内服务器个数 int serverCount = ServerConfigManager::instance()->getServerCount(firstline); if (serverCount <= 0) { - qInfo() << "get error count " << serverCount; + qWarning() << "get error count " << serverCount; serverCount = 0; } m_secondText = QString("%1 server").arg(serverCount); @@ -467,7 +467,7 @@ void ItemWidget::setFontColor(DLabel *label, ItemTextColor colorType) fontPalette.setBrush(DPalette::Text, color); label->setPalette(fontPalette); } else { - qInfo() << __FUNCTION__ << "can't get text color"; + qWarning() << "Can't get text color"; } } diff --git a/src/views/listview.cpp b/src/views/listview.cpp index a6c3c3b0d..18c552886 100644 --- a/src/views/listview.cpp +++ b/src/views/listview.cpp @@ -172,7 +172,7 @@ int ListView::getNextIndex(int index) { if (index < 0) { // 输入错误的index - qInfo() << __FUNCTION__ << "input wrong index" << index; + qWarning() << "input wrong index" << index; return -1; } int count = m_itemList.count(); @@ -195,12 +195,11 @@ void ListView::setCurrentIndex(int currentIndex) // 首先判断currentIndex的有效性 if (!indexIsValid(currentIndex)) { // 无效,返回 - qInfo() << "index : " << currentIndex << " is wrong"; + qInfo() << "index(" << currentIndex << ") is wrong"; emit focusOut(Qt::NoFocusReason); m_focusState = false; return; } - qInfo() << __FUNCTION__ << currentIndex; // 之前的焦点丢失 if (currentIndex != m_currentIndex) lostFocus(m_currentIndex); @@ -223,7 +222,6 @@ void ListView::setCurrentIndex(int currentIndex) void ListView::clearIndex() { m_currentIndex = -1; - qInfo() << __FUNCTION__ << "clear index to -1"; } void ListView::onItemModify(const QString &key, bool isFocusOn) @@ -246,7 +244,7 @@ void ListView::onRemoteItemModify(const QString &key, bool isFocusOn) m_currentIndex = curIndex; // 弹窗显示 ServerConfig *curItemServer = ServerConfigManager::instance()->getServerConfig(key); - qInfo() << __FUNCTION__ << "modify remote " << curItemServer->m_serverName; + qInfo() << "modify remote " << curItemServer->m_serverName; // 弹窗显示 Service::instance()->setIsDialogShow(window(), true); // 根据点击事件还是键盘事件设置焦点状态 @@ -279,7 +277,6 @@ inline void ListView::onServerConfigOptDlgFinished(int result) // 判断是否需要删除 if (m_configDialog->isDelServer()) { // 弹出删除弹窗 - qInfo() << "delete " << m_configDialog->getCurServer()->m_serverName << m_configDialog; DDialog *deleteDialog = new DDialog(tr("Delete Server"), tr("Are you sure you want to delete %1?").arg(m_configDialog->getServerName()), this); deleteDialog->setObjectName("RemoteDeleteDialog"); deleteDialog->setAttribute(Qt::WA_DeleteOnClose); @@ -397,7 +394,6 @@ void ListView::onCustomItemModify(const QString &key, bool isFocusOn) // 弹窗显示 Service::instance()->setIsDialogShow(window(), true); - qInfo() << "this->count()=" << this->count(); // 根据点击事件还是键盘事件设置焦点状态 if (isFocusOn) { // 键盘 @@ -429,7 +425,7 @@ inline void ListView::onCustomCommandOptDlgFinished(int result) if (QDialog::Accepted == result) { //确认修改处理 - qInfo() << __FUNCTION__ << __LINE__ << ":mod Custom Command"; + qInfo() << "Modify Custom Command"; QAction *newAction = m_pdlg->getCurCustomCmd(); CustomCommandData itemData = *(m_pdlg->m_currItemData); CustomCommandData itemDel = itemData; @@ -451,7 +447,6 @@ inline void ListView::onCustomCommandOptDlgFinished(int result) emit Service::instance()->refreshCommandPanel(itemDel.m_cmdName, itemData.m_cmdName); int index = indexFromString(itemData.m_cmdName); - qInfo() << "-------------------------------------------index=" << index << ",itemData.m_cmdName=" << itemData.m_cmdName; if (m_focusState) { // 将焦点落回 m_currentIndex = index; @@ -466,7 +461,7 @@ inline void ListView::onCustomCommandOptDlgFinished(int result) //Delete custom command 删除自定义命令处理 if (m_pdlg->isDelCurCommand()) { - qInfo() << __FUNCTION__ << __LINE__ << ":del Custom Command"; + qInfo() << "Delete Custom Command"; DDialog *dlgDelete = new DDialog(this); dlgDelete->setObjectName("CustomDeleteDialog"); dlgDelete->setAttribute(Qt::WA_DeleteOnClose); @@ -493,22 +488,20 @@ inline void ListView::onCustomCommandOptDlgFinished(int result) // fix bug#65109焦点在自定义编辑按钮上,enter键进入后按esc退出,焦点不在编辑按钮上 if (QDialog::Rejected == result) { - qInfo() << "QDialog::Rejected"; ItemWidget *itemWidget = m_itemList.at(m_currentIndex); itemWidget->getFocus(); } else { - qInfo() << "QDialog::Accepted result is:" << result; + qInfo() << "QDialog accepted result is:" << result; if (-1 != result) { setFocus(); } else { - qInfo() << "QDialog::Rejected"; + qInfo() << "QDialog Rejected"; ItemWidget *itemWidget = m_itemList.at(m_currentIndex); itemWidget->getFocus(); } } } - qInfo() << "================================tempResult=" << tempResult; } inline void ListView::onDeleteCustomCommandFinished(int result) @@ -566,7 +559,6 @@ void ListView::keyPressEvent(QKeyEvent *event) void ListView::focusInEvent(QFocusEvent *event) { - qInfo() << __FUNCTION__ << event->reason(); if (m_currentIndex == -1) m_currentIndex = 0; @@ -692,9 +684,7 @@ void ListView::setFocusFromeIndex(int currentIndex, ListFocusType focusType) else if (ListFocusEnd == focusType) index = this->count() - 1; else - qInfo() << "index:" << index << endl; - - qInfo() << "focus index:" << index << endl; + qInfo() << "Type of current focus:" << focusType ; // index >= 0 < 最大数量 // 最上 @@ -722,11 +712,6 @@ void ListView::setFocusFromeIndex(int currentIndex, ListFocusType focusType) if (widget != nullptr) { // 设置焦点 widget->setFocus(); - int widget_y1 = widget->y(); - int widget_y2 = widget->y() + widget->height(); - qInfo() << "y1" << widget_y1; - qInfo() << "y2" << widget_y2; - qInfo() << "height" << height(); // 设置滚动条 上下移动 if (widget->y() + widget->height() < height()) { verticalScrollBar()->setValue(0); @@ -742,7 +727,6 @@ void ListView::setFocusFromeIndex(int currentIndex, ListFocusType focusType) m_scrollPostion += (count - 1) * listItemHeight; } else { m_scrollPostion = verticalScrollBar()->value(); - qInfo() << "m_scrollPostion" << m_scrollPostion << endl; } } } @@ -784,7 +768,6 @@ void ListView::setScroll(int currentIndex) QLayoutItem *item = m_mainLayout->itemAt(currentIndex); if (item != nullptr) { int postion = currentIndex * 70; - qInfo() << "postion : " << postion; if ((postion + 60) < height()) { verticalScrollBar()->setValue(0); m_scrollPostion = 0; @@ -799,13 +782,11 @@ void ListView::setScroll(int currentIndex) } verticalScrollBar()->setValue(m_scrollPostion); } - qInfo() << "scrollPostion " << m_scrollPostion; } } bool ListView::indexIsValid(int index) { - qInfo() << index << m_itemList.count(); return ((index >= 0) && (index < m_itemList.count())); } diff --git a/src/views/pagesearchbar.cpp b/src/views/pagesearchbar.cpp index ded23b318..b09eb09cb 100644 --- a/src/views/pagesearchbar.cpp +++ b/src/views/pagesearchbar.cpp @@ -179,7 +179,7 @@ void PageSearchBar::initSearchEdit() } } } else { - qInfo() << "can not found _q_qlineeditclearaction in QAction"; + qWarning() << "can not found _q_qlineeditclearaction in QAction"; } // 需求不让自动查找,这个接口预留 diff --git a/src/views/tabbar.cpp b/src/views/tabbar.cpp index 250a0dab7..eedf616d3 100644 --- a/src/views/tabbar.cpp +++ b/src/views/tabbar.cpp @@ -468,7 +468,6 @@ inline bool TabBar::handleRightButtonClick(QMouseEvent *mouseEvent) break; } } - qInfo() << "currIndex" << m_rightClickTab << endl; // 弹出tab标签的右键菜单 if (m_rightClickTab >= 0) { @@ -699,7 +698,7 @@ void TabBar::handleTabReleased(int index) if (index < 0) index = 0; - qInfo() << "handleTabReleased: index: " << index; + qInfo() << "Indicates the index(" << index << ") of the released label!"; const QString tabName = tabText(index); MainWindow *window = static_cast(this->window()); @@ -715,7 +714,7 @@ void TabBar::handleTabReleased(int index) //从原窗口中移除TermWidgetPage。 window->removeTermWidgetPage(termIdentifer, false); - qInfo() << "removeTermWidgetPage: termIdentifer: " << termIdentifer; + qInfo() << "Remove Term Widget Page termIdentifer: " << termIdentifer; updateTabDragMoveStatus(); } @@ -787,7 +786,6 @@ void TabBar::handleTabIsRemoved(int index) MainWindow *window = static_cast(this->window()); window->removeTermWidgetPage(removeId, false); - qInfo() << "handleTabIsRemoved: identifier: " << removeId; updateTabDragMoveStatus(); } @@ -803,12 +801,11 @@ void TabBar::handleTabDroped(int index, Qt::DropAction dropAction, QObject *targ { Q_UNUSED(dropAction) - qInfo() << "handleTabDroped index:" << index << ", target:" << target << endl; + qInfo() << "Handle Tab Droped! index:" << index << ", target:" << target << endl; TabBar *tabbar = qobject_cast(target); //拖出的标签--需要新建窗口 if (nullptr == tabbar) { - qInfo() << "tabbar == nullptr " << index << endl; MainWindow *window = static_cast(this->window()); //窗口不为雷神模式才允许移动 if (!window->isQuakeMode()) @@ -818,7 +815,6 @@ void TabBar::handleTabDroped(int index, Qt::DropAction dropAction, QObject *targ window->activateWindow(); } else { //拖入的标签--需要关闭拖入窗口的标签页 - qInfo() << "tabbar != nullptr " << index << endl; closeTab(index); } diff --git a/src/views/termwidget.cpp b/src/views/termwidget.cpp index 7be315b5b..917f81320 100644 --- a/src/views/termwidget.cpp +++ b/src/views/termwidget.cpp @@ -41,7 +41,6 @@ TermWidget::TermWidget(const TermProperties &properties, QWidget *parent) : QTer // 窗口数量加1 WindowsManager::instance()->terminalCountIncrease(); initTabTitle(); - //qInfo() << " TermWidgetparent " << parentWidget(); m_page = static_cast(parentWidget()); setContextMenuPolicy(Qt::CustomContextMenu); @@ -154,7 +153,6 @@ TermWidget::TermWidget(const TermProperties &properties, QWidget *parent) : QTer setFocusPolicy(Qt::NoFocus); TermWidgetPage *parentPage = qobject_cast(parent); - //qInfo() << parentPage << endl; connect(this, &QTermWidget::uninstallTerminal, parentPage, &TermWidgetPage::uninstallTerminal); } @@ -303,7 +301,7 @@ inline void TermWidget::onUrlActivated(const QUrl &url, bool fromContextMenu) inline void TermWidget::onThemeTypeChanged(DGuiApplicationHelper::ColorType builtInTheme) { - qInfo() << "themeChanged" << builtInTheme; + qInfo() << "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************************/ @@ -347,7 +345,6 @@ inline void TermWidget::onTitleChanged() inline void TermWidget::onCopyAvailable(bool enable) { if (Settings::instance()->IsPasteSelection() && enable) { - qInfo() << "hasCopySelection"; QString strSelected = selectedText(); QApplication::clipboard()->setText(strSelected, QClipboard::Clipboard); } @@ -672,7 +669,7 @@ inline QString TermWidget::getFormatFileName(QString selectedText) || (fileName.startsWith("\"") && fileName.endsWith("\""))) { fileName = fileName.remove(0, 1); fileName = fileName.remove(fileName.length() - 1, 1); - qInfo() << "fileName is :" << fileName; + qInfo() << "Format fileName is " << fileName; } return fileName; @@ -795,7 +792,6 @@ int TermWidget::getTermLayer() layer++; currentW = currentW->parentWidget(); } - qInfo() << "getTermLayer = " << layer; return layer; } @@ -1057,7 +1053,7 @@ void TermWidget::selectEncode(QString encode) void TermWidget::onSettingValueChanged(const QString &keyName) { - qInfo() << "onSettingValueChanged:" << keyName; + qInfo() << "Setting Value Changed! Current Config's key:" << keyName; if ("basic.interface.opacity" == keyName) { setTermOpacity(Settings::instance()->opacity()); return; @@ -1139,7 +1135,6 @@ void TermWidget::onDropInUrls(const char *urls) inline void TermWidget::onTouchPadSignal(QString name, QString direction, int fingers) { - qInfo() << name << direction << fingers; // 当前窗口被激活,且有焦点 if (isActiveWindow() && hasFocus()) { if (name == "pinch" && fingers == 2) { diff --git a/src/views/termwidgetpage.cpp b/src/views/termwidgetpage.cpp index c6f07637d..50683929d 100644 --- a/src/views/termwidgetpage.cpp +++ b/src/views/termwidgetpage.cpp @@ -193,7 +193,7 @@ void TermWidgetPage::closeSplit(TermWidget *term, bool hasConfirmed) } // 上级不是分屏控件,就是布局在控制了 else { - qInfo() << "TermWidgetPage only one term exist!"; + qWarning() << "TermWidgetPage only one term exist!"; m_layout->addWidget(brother); } @@ -202,7 +202,7 @@ void TermWidgetPage::closeSplit(TermWidget *term, bool hasConfirmed) qInfo() << "nextTerm change" << m_currentTerm->getSessionId(); nextTerm->setFocus(); } else { - qInfo() << "can not found nextTerm in TermWidget"; + qWarning() << "can not found nextTerm in TermWidget"; } // 释放控件,并隐藏term、upSplit,避免出现闪现窗口bug#80809 @@ -322,7 +322,6 @@ void TermWidgetPage::focusNavigation(Qt::Edge dir) //QMap mapTermRect; for (TermWidget *term : qAsConst(termList)) { if (GetRect(term).contains(comparPoint)) { - qInfo() << "yes!" << comparPoint.x() << comparPoint.y(); dst = term; break; } @@ -598,7 +597,6 @@ void TermWidgetPage::onTermGetFocus() TermWidget *term = qobject_cast(sender()); setCurrentTerminal(term); emit Service::instance()->currentTermChange(m_currentTerm); - qInfo() << "onTermGetFocus" << m_currentTerm->getSessionId(); emit termGetFocus(); } @@ -606,7 +604,7 @@ void TermWidgetPage::onTermClosed() { TermWidget *w = qobject_cast(sender()); if (!w) { - qInfo() << "TermWidgetPage::onTermClosed: Unknown object to handle" << w; + qWarning() << "TermWidgetPage::onTermClosed: Unknown object to handle" << w; return; } closeSplit(w); @@ -614,7 +612,6 @@ void TermWidgetPage::onTermClosed() void TermWidgetPage::handleFindNext() { - qInfo() << m_findBar->searchKeytxt(); setMismatchAlert(false); m_currentTerm->search(m_findBar->searchKeytxt(), true, true); } @@ -709,7 +706,7 @@ void TermWidgetPage::setCurrentTerminal(TermWidget *term) m_currentTerm = term; if (oldTerm != m_currentTerm) { // 当前界面切换 - qInfo() << "m_currentTerm change" << m_currentTerm->getSessionId(); + qInfo() << "Current terminal change" << m_currentTerm->getSessionId(); QString tabTitle = term->getTabTitle(); // 当前标签为空,标签格式不为空 => 未得到term参数,暂不上传数据 if ((tabTitle == DEFAULT_TAB_TITLE) && !term->getCurrentTabTitleFormat().trimmed().isEmpty())