Qt5 update
authormir3x <mlewczuk80@gmail.com>
Fri, 20 Oct 2017 17:32:37 +0000 (18:32 +0100)
committerRoy Marples <roy@marples.name>
Fri, 20 Oct 2017 17:32:37 +0000 (18:32 +0100)
src/dhcpcd-qt/dhcpcd-preferences.cpp
src/dhcpcd-qt/dhcpcd-qt.cpp
src/dhcpcd-qt/dhcpcd-qt.pro
src/dhcpcd-qt/dhcpcd-ssidmenuwidget.cpp
src/dhcpcd-qt/dhcpcd-wi.cpp
src/dhcpcd-qt/main.cpp

index 7366a06877a7e74814da3635b9ddaaf4e333df77..5331e7e7a910aea405c8850a2830b35019720be1 100644 (file)
@@ -182,10 +182,10 @@ void DhcpcdPreferences::listBlocks(const QString &txt)
        blocks->disconnect(this);
 
        free(eWhat);
-       eWhat = strdup(txt.toLower().toAscii());
+       eWhat = strdup(txt.toLower().toLatin1());
 
        list = dhcpcd_config_blocks(parent->getConnection(),
-           txt.toLower().toAscii());
+           txt.toLower().toLatin1());
 
        if (txt == "interface") {
                char **ifaces, **i;
@@ -294,7 +294,7 @@ const char *DhcpcdPreferences::getString(QLineEdit *le)
 {
        if (le->text().isEmpty())
                return NULL;
-       return le->text().trimmed().toAscii();
+       return le->text().trimmed().toLatin1();
 }
 
 bool DhcpcdPreferences::setOption(const char *opt, const char *val, bool *ret)
@@ -405,7 +405,7 @@ void DhcpcdPreferences::showBlock(const QString &txt)
        if (txt.isEmpty())
                eBlock = NULL;
        else
-               eBlock = strdup(txt.toAscii());
+               eBlock = strdup(txt.toLatin1());
 
        dhcpcd_config_free(config);
        iface = NULL;
index 178e7d877c6552050f1021ad6138b083ad979fb0..32242d4cdd13466e3d180bced3e6b3247d10b8e4 100644 (file)
@@ -224,9 +224,9 @@ void DhcpcdQt::updateOnline(bool showIf)
                        if (showIf)
                                qDebug() << msg;
                        if (msgs.isEmpty())
-                               msgs = QString::fromAscii(msg);
+                               msgs = QString::fromLatin1(msg);
                        else
-                               msgs += '\n' + QString::fromAscii(msg);
+                               msgs += '\n' + QString::fromLatin1(msg);
                        free(msg);
                } else if (showIf)
                        qDebug() << i->ifname << i->reason;
@@ -540,6 +540,9 @@ void DhcpcdQt::notify(QString &title, QString &msg,
        n->setText(msg);
        n->sendEvent();
 #else
+    Q_UNUSED(title)
+    Q_UNUSED(msg)
+    Q_UNUSED(icon)
        //trayIcon->showMessage(title, msg, icon);
 #endif
 }
index 38c37da7ee447fe1b522f7db77dcbdc1f412cc59..36b0f1bcd20ef81e62cb4a3eae4d94b32cdbc8f3 100644 (file)
@@ -1,4 +1,5 @@
-CONFIG+=               qt gui c++11 debug
+CONFIG+=               qt c++11 debug
+QT       += gui core widgets
 QMAKE_CXXFLAGS+=       -std=c++11 -O2
 
 HEADERS=               dhcpcd-qt.h dhcpcd-about.h dhcpcd-preferences.h \
index 71ff1aaa212ac3faccc39693a31db29aa0e4a165..dabf17a25949cf452232e072fc929d8dcb8aff3f 100644 (file)
@@ -132,7 +132,7 @@ void DhcpcdSsidMenuWidget::setScan(DHCPCD_WI_SCAN *scan)
                selicon->setPixmap(picon);
                ssid->setStyleSheet("font:bold;");
        } else {
-               selicon->setPixmap(NULL);
+               selicon->setPixmap(QPixmap());
                ssid->setStyleSheet(NULL);
        }
        ssid->setText(scan->ssid);
index aeec2826bd765e53cb920b0b2f7a09237c45035a..d9502890c76b5eb8227b5e935522a0b1efc61baa 100644 (file)
@@ -314,7 +314,7 @@ void DhcpcdWi::connectSsid(DHCPCD_WI_SCAN *scan)
                if (pwd.isNull() || pwd.isEmpty())
                        err = dhcpcd_wpa_select(wpa, &s);
                else
-                       err = dhcpcd_wpa_configure(wpa, &s, pwd.toAscii());
+                       err = dhcpcd_wpa_configure(wpa, &s, pwd.toLatin1());
        } else
                err = dhcpcd_wpa_configure(wpa, &s, NULL);
 
index f2ffebd79328b3aaebb8dcc1236ca13b63eb5194..7cbfce74dc8f04ba9c9b9a9990705a92de34df80 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  */
 
-#include <QtGui>
+#include <QApplication>
 
 #include "dhcpcd-qt.h"
 #include "dhcpcd-singleton.h"