@@ -40,7 +40,7 @@ class EventHistory : public QDialog, public Ui::EventHistory
public:
EventHistory(QWidget *parent = 0, const char *name = 0,
- bool modal = false, Qt::WindowFlags fl = 0);
+ bool modal = false, Qt::WindowFlags fl = Qt::Widget);
~EventHistory();
public slots:
@@ -40,9 +40,9 @@ int main(int argc, char *argv[])
int ret;
locale = QLocale::system().name();
- resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
+ resourceDir = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
if (!translator.load("wpa_gui_" + locale, resourceDir))
- translator.load("wpa_gui_" + locale, "lang");
+ (void)translator.load("wpa_gui_" + locale, "lang");
app.installTranslator(&translator);
WpaGui w(&app);
@@ -8,6 +8,7 @@
#include <cstdio>
#include <QMessageBox>
+#include <QRegExp>
#include "networkconfig.h"
#include "wpagui.h"
@@ -20,7 +20,7 @@ class NetworkConfig : public QDialog, public Ui::NetworkConfig
public:
NetworkConfig(QWidget *parent = 0, const char *name = 0,
- bool modal = false, Qt::WindowFlags fl = 0);
+ bool modal = false, Qt::WindowFlags fl = Qt::Widget);
~NetworkConfig();
virtual void paramsFromScanResults(QTreeWidgetItem *sel);
@@ -9,6 +9,7 @@
#include <cstdio>
#include <QImageReader>
#include <QMessageBox>
+#include <QRegExp>
#include "common/wpa_ctrl.h"
#include "wpagui.h"
@@ -403,7 +404,7 @@ void Peers::ctx_p2p_start_group()
void Peers::add_station(QString info)
{
- QStringList lines = info.split(QRegExp("\\n"));
+ QStringList lines = QRegExp("\\n").splitString(info);
QString name;
for (QStringList::Iterator it = lines.begin();
@@ -518,7 +519,7 @@ void Peers::add_p2p_group_client(QStandardItem * /*parent*/, QString params)
*/
QStringList items =
- params.split(QRegExp(" (?=[^']*('[^']*'[^']*)*$)"));
+ QRegExp(" (?=[^']*('[^']*'[^']*)*$)").splitString(params);
QString addr = "";
QString name = "";
int config_methods = 0;
@@ -591,7 +592,7 @@ bool Peers::add_bss(const char *cmd)
QString ssid, bssid, flags, wps_name, pri_dev_type;
int id = -1;
- QStringList lines = bss.split(QRegExp("\\n"));
+ QStringList lines = QRegExp("\\n").splitString(bss);
for (QStringList::Iterator it = lines.begin();
it != lines.end(); it++) {
int pos = (*it).indexOf('=') + 1;
@@ -643,7 +644,7 @@ bool Peers::add_bss(const char *cmd)
item->setData(ssid, peer_role_ssid);
model.appendRow(item);
- lines = bss.split(QRegExp("\\n"));
+ lines = QRegExp("\\n").splitString(bss);
for (QStringList::Iterator it = lines.begin();
it != lines.end(); it++) {
if ((*it).startsWith("p2p_group_client:"))
@@ -903,7 +904,7 @@ void Peers::event_notify(WpaMsg msg)
* group_capab=0x0
*/
QStringList items =
- text.split(QRegExp(" (?=[^']*('[^']*'[^']*)*$)"));
+ QRegExp(" (?=[^']*('[^']*'[^']*)*$)").splitString(text);
QString addr = items[1];
QString name = "";
QString pri_dev_type;
@@ -22,7 +22,7 @@ class Peers : public QDialog, public Ui::Peers
public:
Peers(QWidget *parent = 0, const char *name = 0,
- bool modal = false, Qt::WindowFlags fl = 0);
+ bool modal = false, Qt::WindowFlags fl = Qt::Widget);
~Peers();
void setWpaGui(WpaGui *_wpagui);
void event_notify(WpaMsg msg);
@@ -7,6 +7,7 @@
*/
#include <cstdio>
+#include <QRegExp>
#include "scanresults.h"
#include "signalbar.h"
@@ -77,7 +78,7 @@ void ScanResults::updateResults()
QString ssid, bssid, freq, signal, flags;
- QStringList lines = bss.split(QRegExp("\\n"));
+ QStringList lines = QRegExp("\\n").splitString(bss);
for (QStringList::Iterator it = lines.begin();
it != lines.end(); it++) {
int pos = (*it).indexOf('=') + 1;
@@ -20,7 +20,7 @@ class ScanResults : public QDialog, public Ui::ScanResults
public:
ScanResults(QWidget *parent = 0, const char *name = 0,
- bool modal = false, Qt::WindowFlags fl = 0);
+ bool modal = false, Qt::WindowFlags fl = Qt::Widget);
~ScanResults();
public slots:
@@ -20,7 +20,7 @@ class UserDataRequest : public QDialog, public Ui::UserDataRequest
public:
UserDataRequest(QWidget *parent = 0, const char *name = 0,
- bool modal = false, Qt::WindowFlags fl = 0);
+ bool modal = false, Qt::WindowFlags fl = Qt::Widget);
~UserDataRequest();
int setParams(WpaGui *_wpagui, const char *reqMsg);
@@ -2,6 +2,7 @@ TEMPLATE = app
LANGUAGE = C++
TRANSLATIONS = lang/wpa_gui_de.ts
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
CONFIG += qt warn_on release
@@ -18,6 +18,7 @@
#include <QCloseEvent>
#include <QImageReader>
#include <QSettings>
+#include <QRegExp>
#include "wpagui.h"
#include "dirent.h"
@@ -1078,7 +1079,7 @@ void WpaGui::selectNetwork( const QString &sel )
char reply[10];
size_t reply_len = sizeof(reply);
- if (cmd.contains(QRegExp("^\\d+:")))
+ if (QRegExp("^\\d+:").indexIn(cmd))
cmd.truncate(cmd.indexOf(':'));
else
cmd = "any";
@@ -1095,7 +1096,7 @@ void WpaGui::enableNetwork(const QString &sel)
char reply[10];
size_t reply_len = sizeof(reply);
- if (cmd.contains(QRegExp("^\\d+:")))
+ if (QRegExp("^\\d+:").indexIn(cmd))
cmd.truncate(cmd.indexOf(':'));
else if (!cmd.startsWith("all")) {
debug("Invalid editNetwork '%s'",
@@ -1114,7 +1115,7 @@ void WpaGui::disableNetwork(const QString &sel)
char reply[10];
size_t reply_len = sizeof(reply);
- if (cmd.contains(QRegExp("^\\d+:")))
+ if (QRegExp("^\\d+:").indexIn(cmd))
cmd.truncate(cmd.indexOf(':'));
else if (!cmd.startsWith("all")) {
debug("Invalid editNetwork '%s'",
@@ -1132,7 +1133,7 @@ void WpaGui::editNetwork(const QString &sel)
QString cmd(sel);
int id = -1;
- if (cmd.contains(QRegExp("^\\d+:"))) {
+ if (QRegExp("^\\d+:").indexIn(cmd)) {
cmd.truncate(cmd.indexOf(':'));
id = cmd.toInt();
}
@@ -1204,7 +1205,7 @@ void WpaGui::removeNetwork(const QString &sel)
char reply[10];
size_t reply_len = sizeof(reply);
- if (cmd.contains(QRegExp("^\\d+:")))
+ if (QRegExp("^\\d+:").indexIn(cmd))
cmd.truncate(cmd.indexOf(':'));
else if (!cmd.startsWith("all")) {
debug("Invalid editNetwork '%s'",
@@ -1476,7 +1477,7 @@ void WpaGui::showTrayStatus()
QString msg, status(buf);
- QStringList lines = status.split(QRegExp("\\n"));
+ QStringList lines = QRegExp("\\n").splitString(status);
for (QStringList::Iterator it = lines.begin();
it != lines.end(); it++) {
int pos = (*it).indexOf('=') + 1;
@@ -49,7 +49,7 @@ public:
};
WpaGui(QApplication *app, QWidget *parent = 0, const char *name = 0,
- Qt::WindowFlags fl = 0);
+ Qt::WindowFlags fl = Qt::Widget);
~WpaGui();
virtual int ctrlRequest(const char *cmd, char *buf, size_t *buflen);