mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: remove useless code
This commit is contained in:
parent
6e6949f213
commit
c0294d4eb9
@ -11,7 +11,6 @@
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDesktopServices>
|
||||
#include <QLoggingCategory>
|
||||
#include <QMetaEnum>
|
||||
|
||||
#include "xToolsCrcInterface.h"
|
||||
@ -156,7 +155,10 @@ void xToolsCRCAssistant::textFormatControl()
|
||||
if (m_asciiRadioBt->isChecked()) {
|
||||
return;
|
||||
}
|
||||
disconnect(m_inputTextEdit, &QTextEdit::textChanged, this, &xToolsCRCAssistant::textFormatControl);
|
||||
disconnect(m_inputTextEdit,
|
||||
&QTextEdit::textChanged,
|
||||
this,
|
||||
&xToolsCRCAssistant::textFormatControl);
|
||||
|
||||
QString strTemp;
|
||||
QString plaintext = m_inputTextEdit->toPlainText();
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
**************************************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
#include <QApplication>
|
||||
#include <QDesktopServices>
|
||||
#include <QStandardPaths>
|
||||
#include <QUrl>
|
||||
#include <QStyle>
|
||||
#include <QUrl>
|
||||
|
||||
static const QString fileName()
|
||||
{
|
||||
@ -52,9 +52,9 @@ QString xToolsSettings::settingsPath()
|
||||
int xToolsSettings::hdpiPolicy()
|
||||
{
|
||||
#ifdef X_TOOLS_ENABLE_HIGH_DPI_POLICY
|
||||
auto var = value(mSettingsKey.hdpiPolicy);
|
||||
auto var = value(m_settingsKey.hdpiPolicy);
|
||||
if (var.isValid()) {
|
||||
return value(mSettingsKey.hdpiPolicy).toInt();
|
||||
return value(m_settingsKey.hdpiPolicy).toInt();
|
||||
}
|
||||
|
||||
return int(QGuiApplication::highDpiScaleFactorRoundingPolicy());
|
||||
@ -66,7 +66,7 @@ int xToolsSettings::hdpiPolicy()
|
||||
void xToolsSettings::setHdpiPolicy(int policy)
|
||||
{
|
||||
#ifdef X_TOOLS_ENABLE_HIGH_DPI_POLICY
|
||||
setValue(mSettingsKey.hdpiPolicy, policy);
|
||||
setValue(m_settingsKey.hdpiPolicy, policy);
|
||||
emit hdpiPolicyChanged();
|
||||
#else
|
||||
Q_UNUSED(policy)
|
||||
@ -75,9 +75,9 @@ void xToolsSettings::setHdpiPolicy(int policy)
|
||||
|
||||
QString xToolsSettings::appStyle()
|
||||
{
|
||||
auto var = value(mSettingsKey.appStyle);
|
||||
auto var = value(m_settingsKey.appStyle);
|
||||
if (var.isValid()) {
|
||||
return value(mSettingsKey.appStyle).toString();
|
||||
return value(m_settingsKey.appStyle).toString();
|
||||
}
|
||||
|
||||
if (QApplication::instance()) {
|
||||
@ -89,38 +89,38 @@ QString xToolsSettings::appStyle()
|
||||
|
||||
void xToolsSettings::setAppStyle(const QString& style)
|
||||
{
|
||||
setValue(mSettingsKey.appStyle, style);
|
||||
setValue(m_settingsKey.appStyle, style);
|
||||
}
|
||||
|
||||
QString xToolsSettings::language()
|
||||
{
|
||||
return value(mSettingsKey.language).toString();
|
||||
return value(m_settingsKey.language).toString();
|
||||
}
|
||||
|
||||
void xToolsSettings::setLanguage(const QString& lan)
|
||||
{
|
||||
setValue(mSettingsKey.language, lan);
|
||||
setValue(m_settingsKey.language, lan);
|
||||
}
|
||||
|
||||
bool xToolsSettings::clearSettings()
|
||||
{
|
||||
return value(mSettingsKey.clearSettings).toBool();
|
||||
return value(m_settingsKey.clearSettings).toBool();
|
||||
}
|
||||
|
||||
void xToolsSettings::setClearSettings(bool clear)
|
||||
{
|
||||
setValue(mSettingsKey.clearSettings, clear);
|
||||
setValue(m_settingsKey.clearSettings, clear);
|
||||
emit clearSettingsChanged();
|
||||
}
|
||||
|
||||
QString xToolsSettings::palette()
|
||||
{
|
||||
return value(mSettingsKey.palette).toString();
|
||||
return value(m_settingsKey.palette).toString();
|
||||
}
|
||||
|
||||
void xToolsSettings::setPalette(const QString& fileName)
|
||||
{
|
||||
setValue(mSettingsKey.palette, fileName);
|
||||
setValue(m_settingsKey.palette, fileName);
|
||||
emit paletteChanged();
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
**************************************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QSettings>
|
||||
#include <Qt>
|
||||
|
||||
@ -69,7 +68,5 @@ private:
|
||||
const QString isTextBesideIcon{"isTextBesideIcon"};
|
||||
const QString palette{"palette"};
|
||||
const QString customPalette{"customPalette"};
|
||||
} mSettingsKey;
|
||||
|
||||
QLoggingCategory mLoggingCategory{"sak.settings"};
|
||||
} m_settingsKey;
|
||||
};
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
#include <QFileDialog>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QLoggingCategory>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QMessageBox>
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
#include <QActionGroup>
|
||||
#include <QApplication>
|
||||
#include <QLoggingCategory>
|
||||
#include <QMainWindow>
|
||||
#include <QMenu>
|
||||
#include <QStyleFactory>
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
#include <QButtonGroup>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QLoggingCategory>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QMetaEnum>
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
#include <QIcon>
|
||||
#include <QList>
|
||||
#include <QLoggingCategory>
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
**************************************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QMenu>
|
||||
#include <QTextDocument>
|
||||
|
||||
@ -27,9 +26,6 @@ public:
|
||||
|
||||
void initialize(xToolsToolBox *toolBox, const QString &settingsGroup);
|
||||
|
||||
private:
|
||||
const QLoggingCategory mLoggingCategory{"SAK.CustomBoxUiParameters"};
|
||||
|
||||
private:
|
||||
Ui::xToolsToolBoxUiCommunicationMenu *ui;
|
||||
};
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
#include <atomic>
|
||||
#include <QJsonObject>
|
||||
#include <QLoggingCategory>
|
||||
#include <QThread>
|
||||
|
||||
class xToolsBaseTool : public QThread
|
||||
|
||||
@ -40,7 +40,7 @@ void xToolsAnalyzerToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool, const Q
|
||||
static QByteArray tips("invalid SAKAnalyzerTool");
|
||||
Q_ASSERT_X(cookedTool, __FUNCTION__, tips.constData());
|
||||
if (!cookedTool) {
|
||||
qCWarning((*mLoggingCategory)) << QString::fromLatin1(tips);
|
||||
qWarning() << QString::fromLatin1(tips);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -18,15 +18,8 @@ void xToolsBaseToolUi::initialize(xToolsBaseTool *tool,
|
||||
const char *loggingCategory)
|
||||
{
|
||||
m_tool = tool;
|
||||
if (mLoggingCategory) {
|
||||
delete mLoggingCategory;
|
||||
mLoggingCategory = nullptr;
|
||||
}
|
||||
|
||||
mLoggingCategory = new QLoggingCategory(loggingCategory);
|
||||
|
||||
if (!tool) {
|
||||
qCWarning((*mLoggingCategory)) << "The value of tool is nullptr!";
|
||||
qWarning() << "The value of tool is nullptr!";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
**************************************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QWidget>
|
||||
|
||||
class xToolsBaseTool;
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#include "xToolsApplication.h"
|
||||
|
||||
xToolsEmitterToolUi::xToolsEmitterToolUi(QWidget *parent)
|
||||
: xToolsTableModelToolUi{"sak.emittertoolui", parent}
|
||||
: xToolsTableModelToolUi{parent}
|
||||
{
|
||||
mEditor = new xToolsEmitterToolUiEditor(xToolsApplication::mainWindow());
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ void xToolsMaskerToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool, const QSt
|
||||
|
||||
xToolsMaskerTool *cookedTool = qobject_cast<xToolsMaskerTool *>(tool);
|
||||
if (!cookedTool) {
|
||||
qCWarning((*mLoggingCategory)) << "Invalid tool type!";
|
||||
qWarning() << "Invalid tool type!";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include "xToolsApplication.h"
|
||||
|
||||
xToolsPrestorerToolUi::xToolsPrestorerToolUi(QWidget *parent)
|
||||
: xToolsTableModelToolUi{"SAK.PrestorerToolUi", parent}
|
||||
: xToolsTableModelToolUi(parent)
|
||||
{
|
||||
mEditor = new xToolsPrestorerToolUiEditor(xToolsApplication::mainWindow());
|
||||
mMenu = new xToolsMenu();
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
#include "xToolsApplication.h"
|
||||
|
||||
xToolsResponserToolUi::xToolsResponserToolUi(QWidget *parent)
|
||||
: xToolsTableModelToolUi{"sak.responsertoolui", parent}
|
||||
: xToolsTableModelToolUi{parent}
|
||||
{
|
||||
mEditor = new xToolsResponserToolUiEditor(xToolsApplication::mainWindow());
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "xToolsCommunicationToolUi.h"
|
||||
#include <QLoggingCategory>
|
||||
|
||||
namespace Ui {
|
||||
class xToolsSerialPortToolUi;
|
||||
@ -26,7 +25,6 @@ public:
|
||||
|
||||
private:
|
||||
xToolsSerialPortTool *m_tool{nullptr};
|
||||
const QLoggingCategory mLoggingCategory{"sak.serialporttoolui"};
|
||||
|
||||
private:
|
||||
void checkInitializingStatus();
|
||||
|
||||
@ -11,9 +11,9 @@
|
||||
#include "xToolsApplication.h"
|
||||
|
||||
xToolsSerialPortTransmitterToolUi::xToolsSerialPortTransmitterToolUi(QWidget *parent)
|
||||
: xToolsTransmitterToolUi("SAK.SerialPortTransmitterToolUi", parent)
|
||||
: xToolsTransmitterToolUi(parent)
|
||||
{
|
||||
mEditor = new xToolsSerialPortTransmitterToolUiEditor(xToolsApplication::mainWindow());
|
||||
m_Editor = new xToolsSerialPortTransmitterToolUiEditor(xToolsApplication::mainWindow());
|
||||
}
|
||||
|
||||
void xToolsSerialPortTransmitterToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool,
|
||||
@ -25,5 +25,5 @@ void xToolsSerialPortTransmitterToolUi::onBaseToolUiInitialized(xToolsBaseTool *
|
||||
|
||||
QDialog *xToolsSerialPortTransmitterToolUi::itemEditor()
|
||||
{
|
||||
return mEditor;
|
||||
return m_Editor;
|
||||
}
|
||||
|
||||
@ -22,5 +22,5 @@ protected:
|
||||
virtual QDialog *itemEditor() override;
|
||||
|
||||
private:
|
||||
xToolsSerialPortTransmitterToolUiEditor *mEditor;
|
||||
xToolsSerialPortTransmitterToolUiEditor *m_Editor;
|
||||
};
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "xToolsCommunicationToolUi.h"
|
||||
#include <QLoggingCategory>
|
||||
|
||||
namespace Ui {
|
||||
class xToolsSocketClientToolUi;
|
||||
|
||||
@ -10,15 +10,15 @@
|
||||
|
||||
#include "xToolsApplication.h"
|
||||
|
||||
xToolsSocketClientTransmitterToolUi::xToolsSocketClientTransmitterToolUi(const char *lg, QWidget *parent)
|
||||
: xToolsTransmitterToolUi(lg, parent)
|
||||
xToolsSocketClientTransmitterToolUi::xToolsSocketClientTransmitterToolUi(QWidget *parent)
|
||||
: xToolsTransmitterToolUi(parent)
|
||||
{
|
||||
mEditor = new xToolsSocketClientTransmitterToolUiEditor(xToolsApplication::mainWindow());
|
||||
m_editor = new xToolsSocketClientTransmitterToolUiEditor(xToolsApplication::mainWindow());
|
||||
}
|
||||
|
||||
QDialog *xToolsSocketClientTransmitterToolUi::itemEditor()
|
||||
{
|
||||
return mEditor;
|
||||
return m_editor;
|
||||
}
|
||||
|
||||
void xToolsSocketClientTransmitterToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool,
|
||||
@ -27,5 +27,5 @@ void xToolsSocketClientTransmitterToolUi::onBaseToolUiInitialized(xToolsBaseTool
|
||||
xToolsTransmitterToolUi::onBaseToolUiInitialized(tool, settingGroup);
|
||||
setColumnVisible(4, false);
|
||||
setSectionResizeModeToStretch();
|
||||
mEditor->setWebSocketContextVisible(false);
|
||||
m_editor->setWebSocketContextVisible(false);
|
||||
}
|
||||
|
||||
@ -14,12 +14,12 @@
|
||||
class xToolsSocketClientTransmitterToolUi : public xToolsTransmitterToolUi
|
||||
{
|
||||
public:
|
||||
xToolsSocketClientTransmitterToolUi(const char *lg, QWidget *parent = nullptr);
|
||||
xToolsSocketClientTransmitterToolUi(QWidget *parent = nullptr);
|
||||
virtual QDialog *itemEditor() override;
|
||||
|
||||
protected:
|
||||
virtual void onBaseToolUiInitialized(xToolsBaseTool *tool, const QString &settingGroup) override;
|
||||
|
||||
protected:
|
||||
xToolsSocketClientTransmitterToolUiEditor *mEditor{nullptr};
|
||||
xToolsSocketClientTransmitterToolUiEditor *m_editor{nullptr};
|
||||
};
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "xToolsCommunicationToolUi.h"
|
||||
#include <QLoggingCategory>
|
||||
|
||||
namespace Ui {
|
||||
class xToolsSocketServerToolUi;
|
||||
@ -27,7 +26,6 @@ public:
|
||||
|
||||
private:
|
||||
xToolsSocketServerTool *m_tool{nullptr};
|
||||
const QLoggingCategory mLoggingCategory{"sak.socketservertoolui"};
|
||||
|
||||
private:
|
||||
Ui::xToolsSocketServerToolUi *ui{nullptr};
|
||||
|
||||
@ -33,13 +33,13 @@ xToolsStorerToolUi::~xToolsStorerToolUi()
|
||||
void xToolsStorerToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool, const QString &settingsGroup)
|
||||
{
|
||||
if (!tool) {
|
||||
qCWarning((*mLoggingCategory)) << "The tool value is nullptr!";
|
||||
qWarning() << "The tool value is nullptr!";
|
||||
return;
|
||||
}
|
||||
|
||||
xToolsStorerTool *cookedTool = qobject_cast<xToolsStorerTool *>(tool);
|
||||
if (!cookedTool) {
|
||||
qCWarning((*mLoggingCategory)) << "The cookedTool value is nullptr!";
|
||||
qWarning() << "The cookedTool value is nullptr!";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -21,9 +21,8 @@
|
||||
#include "xToolsTableModelTool.h"
|
||||
#include "xToolsApplication.h"
|
||||
|
||||
xToolsTableModelToolUi::xToolsTableModelToolUi(const char *lg, QWidget *parent)
|
||||
xToolsTableModelToolUi::xToolsTableModelToolUi(QWidget *parent)
|
||||
: xToolsBaseToolUi{parent}
|
||||
, mLoggingCategory{lg}
|
||||
, ui(new Ui::xToolsTableModelToolUi)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
#include <QAbstractTableModel>
|
||||
#include <QActionGroup>
|
||||
#include <QJsonObject>
|
||||
#include <QLoggingCategory>
|
||||
#include <QMenu>
|
||||
#include <QModelIndex>
|
||||
#include <QWidget>
|
||||
@ -27,7 +26,7 @@ class xToolsTableModelToolUi : public xToolsBaseToolUi
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit xToolsTableModelToolUi(const char *lg, QWidget *parent = nullptr);
|
||||
explicit xToolsTableModelToolUi(QWidget *parent = nullptr);
|
||||
~xToolsTableModelToolUi();
|
||||
void setStretchSections(QList<int> columns);
|
||||
void setSectionResizeModeToStretch();
|
||||
@ -40,7 +39,6 @@ protected:
|
||||
virtual QDialog *itemEditor() = 0;
|
||||
|
||||
protected:
|
||||
const QLoggingCategory mLoggingCategory;
|
||||
QAbstractTableModel *mTableModel{nullptr};
|
||||
xToolsTableModelTool *mTableModelTool{nullptr};
|
||||
|
||||
|
||||
@ -9,5 +9,5 @@
|
||||
#include "xToolsTcpTransmitterToolUi.h"
|
||||
|
||||
xToolsTcpTransmitterToolUi::xToolsTcpTransmitterToolUi(QWidget *parent)
|
||||
: xToolsSocketClientTransmitterToolUi{"SAK.TcpTransmitterToolUi", parent}
|
||||
: xToolsSocketClientTransmitterToolUi{parent}
|
||||
{}
|
||||
|
||||
@ -10,8 +10,8 @@
|
||||
|
||||
#include "xToolsTransmitterTool.h"
|
||||
|
||||
xToolsTransmitterToolUi::xToolsTransmitterToolUi(const char *lg, QWidget *parent)
|
||||
: xToolsTableModelToolUi{lg, parent}
|
||||
xToolsTransmitterToolUi::xToolsTransmitterToolUi(QWidget *parent)
|
||||
: xToolsTableModelToolUi{parent}
|
||||
{}
|
||||
|
||||
void xToolsTransmitterToolUi::afterRowEdited(int row)
|
||||
|
||||
@ -14,7 +14,7 @@ class xToolsTransmitterToolUi : public xToolsTableModelToolUi
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
xToolsTransmitterToolUi(const char *lg, QWidget *parent = nullptr);
|
||||
xToolsTransmitterToolUi(QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
virtual void afterRowEdited(int row) override;
|
||||
|
||||
@ -9,5 +9,5 @@
|
||||
#include "xToolsUdpTransmitterToolUi.h"
|
||||
|
||||
xToolsUdpTransmitterToolUi::xToolsUdpTransmitterToolUi(QWidget *parent)
|
||||
: xToolsSocketClientTransmitterToolUi("SAK.SocketClientTransmitterToolUi", parent)
|
||||
: xToolsSocketClientTransmitterToolUi(parent)
|
||||
{}
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "xToolsBaseToolUi.h"
|
||||
#include <QLoggingCategory>
|
||||
|
||||
namespace Ui {
|
||||
class xToolsVelometerToolUi;
|
||||
@ -26,6 +25,5 @@ protected:
|
||||
virtual void onBaseToolUiInitialized(xToolsBaseTool *tool, const QString &settingsGroup) final;
|
||||
|
||||
private:
|
||||
const QLoggingCategory mLoggingCategory{"sak.velometertoolui"};
|
||||
Ui::xToolsVelometerToolUi *ui;
|
||||
};
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
#include "xToolsWebSocketTransmitterToolUi.h"
|
||||
|
||||
xToolsWebSocketTransmitterToolUi::xToolsWebSocketTransmitterToolUi(QWidget *parent)
|
||||
: xToolsSocketClientTransmitterToolUi("SAK.WebSocketTransmitterToolUi", parent)
|
||||
: xToolsSocketClientTransmitterToolUi(parent)
|
||||
{}
|
||||
|
||||
void xToolsWebSocketTransmitterToolUi::onBaseToolUiInitialized(xToolsBaseTool *tool,
|
||||
@ -18,5 +18,5 @@ void xToolsWebSocketTransmitterToolUi::onBaseToolUiInitialized(xToolsBaseTool *t
|
||||
xToolsSocketClientTransmitterToolUi::onBaseToolUiInitialized(tool, settingGroup);
|
||||
|
||||
setColumnVisible(4, true);
|
||||
mEditor->setWebSocketContextVisible(true);
|
||||
m_editor->setWebSocketContextVisible(true);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user