UI: ConfUtil: Simplify setErrorMessage()

This commit is contained in:
Nodir Temirkhodjaev 2024-04-06 10:12:19 +03:00
parent 4697615cb0
commit 51474af376
2 changed files with 1 additions and 13 deletions

View File

@ -79,14 +79,6 @@ void writeConfFlags(const FirewallConf &conf, PFORT_CONF_FLAGS confFlags)
ConfUtil::ConfUtil(QObject *parent) : QObject(parent) { } ConfUtil::ConfUtil(QObject *parent) : QObject(parent) { }
void ConfUtil::setErrorMessage(const QString &errorMessage)
{
if (m_errorMessage != errorMessage) {
m_errorMessage = errorMessage;
emit errorMessageChanged();
}
}
int ConfUtil::ruleMaxCount() int ConfUtil::ruleMaxCount()
{ {
return FORT_CONF_RULE_MAX; return FORT_CONF_RULE_MAX;

View File

@ -24,7 +24,6 @@ using chars_arr_t = QVector<qint8>;
class ConfUtil : public QObject class ConfUtil : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString errorMessage READ errorMessage NOTIFY errorMessageChanged)
public: public:
explicit ConfUtil(QObject *parent = nullptr); explicit ConfUtil(QObject *parent = nullptr);
@ -36,9 +35,6 @@ public:
static int ruleMaxCount(); static int ruleMaxCount();
static int zoneMaxCount(); static int zoneMaxCount();
signals:
void errorMessageChanged();
public slots: public slots:
int writeVersion(QByteArray &buf); int writeVersion(QByteArray &buf);
int writeServices( int writeServices(
@ -56,7 +52,7 @@ public slots:
bool loadZone(const QByteArray &buf, IpRange &ipRange); bool loadZone(const QByteArray &buf, IpRange &ipRange);
private: private:
void setErrorMessage(const QString &errorMessage); void setErrorMessage(const QString &errorMessage) { m_errorMessage = errorMessage; }
bool parseAddressGroups(const QList<AddressGroup *> &addressGroups, bool parseAddressGroups(const QList<AddressGroup *> &addressGroups,
addrranges_arr_t &addressRanges, longs_arr_t &addressGroupOffsets, addrranges_arr_t &addressRanges, longs_arr_t &addressGroupOffsets,