diff --git a/wireless.cpp b/wireless.cpp index 4d90ae9..c1efd38 100644 --- a/wireless.cpp +++ b/wireless.cpp @@ -13,7 +13,6 @@ extern "C" { #include "utils.h" #include #include -#include #define BIT(x) (1ULL<<(x)) @@ -95,6 +94,8 @@ struct nl_interfaceCallback { \brief The Wireless class is used to manage 802.11 wireless information associated with an interface. Currently this class makes the assumption that it will only be used within the United States FCC regulatory domain. Only drivers supporting the Linux kernel nl80211 interface are supported. */ +static QRegularExpression s_noDigitRegex("[^\\d]"); + /*! Constructs a Wireless object. All operations will be limited to the specified \a interface. */ @@ -103,7 +104,6 @@ QObject(0), m_interface(interface), m_interfaceType(), m_bands(), -m_noDigitRegex("[^\\d]"), m_isValid(false), m_isNL80211(false), m_iftype(NL80211_IFTYPE_UNSPECIFIED) @@ -406,7 +406,7 @@ int Wireless::ChanToFreq(int channel) { */ QString Wireless::ChanToFreq(QString channel, QString outputFormat) { QString freq; - channel = channel.replace(m_noDigitRegex, ""); + channel = channel.replace(s_noDigitRegex, ""); if(outputFormat.isEmpty()) { bool ok = false; @@ -442,7 +442,7 @@ int Wireless::FreqToChan(int frequency) { */ QString Wireless::FreqToChan(QString frequency, QString outputFormat) { QString chan; - frequency = frequency.replace(m_noDigitRegex, ""); + frequency = frequency.replace(s_noDigitRegex, ""); if(frequency.length() < 4) { for(int i = frequency.length() + 1; i <= 4; ++i) { diff --git a/wireless.h b/wireless.h index 6094364..144670a 100644 --- a/wireless.h +++ b/wireless.h @@ -5,6 +5,7 @@ #include #include "libip_global.h" #include +#include class LIBIP_EXPORT Wireless : public QObject { Q_OBJECT @@ -97,7 +98,6 @@ private: QString m_interface; QString m_interfaceType; QList m_bands; - QRegularExpression m_noDigitRegex; bool m_isValid; bool m_isNL80211; nl80211_iftype m_iftype;