dhcpcd-qt: switch to qt5

This commit is contained in:
maxice8 2018-09-18 17:42:53 -03:00 committed by maxice8
parent fb6d274014
commit 2651204838
2 changed files with 138 additions and 3 deletions

View File

@ -0,0 +1,126 @@
From a22159aa57ad5eb0bfb203529a16e2392daab49a Mon Sep 17 00:00:00 2001
From: mir3x <mlewczuk80@gmail.com>
Date: Fri, 20 Oct 2017 18:32:37 +0100
Subject: [PATCH] Qt5 update
---
src/dhcpcd-qt/dhcpcd-preferences.cpp | 8 ++++----
src/dhcpcd-qt/dhcpcd-qt.cpp | 7 +++++--
src/dhcpcd-qt/dhcpcd-qt.pro | 3 ++-
src/dhcpcd-qt/dhcpcd-ssidmenuwidget.cpp | 2 +-
src/dhcpcd-qt/dhcpcd-wi.cpp | 2 +-
src/dhcpcd-qt/main.cpp | 2 +-
6 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/dhcpcd-qt/dhcpcd-preferences.cpp b/src/dhcpcd-qt/dhcpcd-preferences.cpp
index 7366a06..5331e7e 100644
--- a/src/dhcpcd-qt/dhcpcd-preferences.cpp
+++ b/src/dhcpcd-qt/dhcpcd-preferences.cpp
@@ -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;
diff --git a/src/dhcpcd-qt/dhcpcd-qt.cpp b/src/dhcpcd-qt/dhcpcd-qt.cpp
index 178e7d8..32242d4 100644
--- a/src/dhcpcd-qt/dhcpcd-qt.cpp
+++ b/src/dhcpcd-qt/dhcpcd-qt.cpp
@@ -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
}
diff --git a/src/dhcpcd-qt/dhcpcd-qt.pro b/src/dhcpcd-qt/dhcpcd-qt.pro
index 38c37da..36b0f1b 100644
--- a/src/dhcpcd-qt/dhcpcd-qt.pro
+++ b/src/dhcpcd-qt/dhcpcd-qt.pro
@@ -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 \
diff --git a/src/dhcpcd-qt/dhcpcd-ssidmenuwidget.cpp b/src/dhcpcd-qt/dhcpcd-ssidmenuwidget.cpp
index 71ff1aa..dabf17a 100644
--- a/src/dhcpcd-qt/dhcpcd-ssidmenuwidget.cpp
+++ b/src/dhcpcd-qt/dhcpcd-ssidmenuwidget.cpp
@@ -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);
diff --git a/src/dhcpcd-qt/dhcpcd-wi.cpp b/src/dhcpcd-qt/dhcpcd-wi.cpp
index aeec282..d950289 100644
--- a/src/dhcpcd-qt/dhcpcd-wi.cpp
+++ b/src/dhcpcd-qt/dhcpcd-wi.cpp
@@ -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);
diff --git a/src/dhcpcd-qt/main.cpp b/src/dhcpcd-qt/main.cpp
index f2ffebd..7cbfce7 100644
--- a/src/dhcpcd-qt/main.cpp
+++ b/src/dhcpcd-qt/main.cpp
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-#include <QtGui>
+#include <QApplication>
#include "dhcpcd-qt.h"
#include "dhcpcd-singleton.h"

View File

@ -1,12 +1,13 @@
# Template file for 'dhcpcd-qt'
pkgname=dhcpcd-qt
version=0.7.5
revision=3
revision=4
patch_args="-Np1"
wrksrc="dhcpcd-ui-${version}"
build_style=gnu-configure
configure_args="--with-qt --without-dhcpcd-online --without-icons --with-notification"
hostmakedepends="pkg-config"
makedepends="qt-devel"
makedepends="qt5-devel"
depends="dhcpcd dhcpcd-icons desktop-file-utils"
short_desc="Qt system tray monitor for dhcpcd"
homepage="http://roy.marples.name/projects/dhcpcd-ui"
@ -15,11 +16,19 @@ maintainer="Juan RP <xtraeme@voidlinux.eu>"
distfiles="http://roy.marples.name/downloads/dhcpcd/dhcpcd-ui-$version.tar.bz2"
checksum=2dae2108605867aba78d98cc9e56e22d7b751eedc3f7e6d689d42d08e706aaf3
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" qt5-devel qt5-host-tools"
fi
post_configure() {
sed -i src/dhcpcd-qt/Makefile \
-e "s;^\(CC .*=\).*;\1 ${CC};" \
-e "s;^\(CXX .*=\).*;\1 ${CXX};" \
-e "s;^\(CFLAGS.*=.*\);& ${CFLAGS};" \
-e "s;^\(CXXFLAGS.*=.*\);& ${CXXFLAGS};" \
-e "s;^\(LFLAGS.*=.*\);& ${LDFLAGS};"
-e "s;^\(LFLAGS.*=.*\);& ${LDFLAGS};" \
-e "s;^\(LINK .*=\).*;\1 ${CXX};" \
-e "/STRIP/d"
}
do_install() {