Am 14.04.2018 um 14:07 schrieb Michael Biebl:
> Am 14.04.2018 um 14:01 schrieb Michael Biebl:
>> On Wed, 20 Dec 2017 09:58:16 +0100 Lubomir Rintel <lkund...@v3.sk> wrote:
>>> This doesn't seem to build with current libnm and glib, perhaps because
>>> "signals" is a reserved word in MOC?
> 
>>
>> That said, I'm not really familiar with Qt, so not sure if using
>> -DQT_NO_KEYWORDS + macros like Q_EMIT are consider a proper solution for
>> this kind of problem.
>>
>> KDE maintainers, any suggestions?
> 
> Also related
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=622176
> 
> Seems like using QT_NO_KEYWORDS + the macros is the way to go then

I tried updating solid-networkstartus to use QT_NO_KEYWORDS and the Q_
macros, but ran into a problem. The QNtrack headers use the slots
keyword, so if I set -DQT_NO_KEYWORDS,
solid-networkstatus/kded/ntracknetworkstate.cpp fails to compile.

So while I could get the networkmanager backend compile successfully
with the attached patch, I had to disable QNtrack support.

Would be great to have some feedback from the KDE maintainers on how to
proceed, i.e. if we simply disable the NM support (and keep support for
QNtrack enabled), or apply the attached patch which uses libnm but drops
support QNtrack.

Regards,
Michael



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
diff -Nru kde-runtime-17.08.3/debian/changelog 
kde-runtime-17.08.3/debian/changelog
--- kde-runtime-17.08.3/debian/changelog        2018-01-11 08:22:25.000000000 
+0000
+++ kde-runtime-17.08.3/debian/changelog        2018-04-14 13:02:04.000000000 
+0000
@@ -1,3 +1,12 @@
+kde-runtime (4:17.08.3-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Update solid-networkstatus to use libnm. (Closes: #862883)
+    This requires the use of -DQT_NO_KEYWORDS which is not compatible with
+    QNtrack, so disable support for that backend.
+
+ -- Michael Biebl <bi...@debian.org>  Sat, 14 Apr 2018 13:02:04 +0000
+
 kde-runtime (4:17.08.3-1) unstable; urgency=medium
 
   * Team upload.
diff -Nru kde-runtime-17.08.3/debian/control kde-runtime-17.08.3/debian/control
--- kde-runtime-17.08.3/debian/control  2018-01-06 10:49:18.000000000 +0000
+++ kde-runtime-17.08.3/debian/control  2018-04-14 12:48:57.000000000 +0000
@@ -24,8 +24,7 @@
                libjpeg-dev,
                libkactivities-dev,
                liblzma-dev,
-               libnm-util-dev (>= 0.7) [linux-any],
-               libntrack-qt4-dev [linux-any],
+               libnm-dev (>= 1.0.0) [linux-any],
                libopenexr-dev,
                libphonon-dev (>= 4:4.6.0really4.4.3),
                libpulse-dev (>= 0.9.16),
@@ -35,7 +34,6 @@
                libwebp-dev,
                libx11-dev,
                libxcursor-dev,
-               network-manager-dev (>= 0.7.0) [linux-any],
                pkg-config,
                pkg-kde-tools (>= 0.12),
                shared-mime-info,
diff -Nru 
kde-runtime-17.08.3/debian/patches/cmake-add-NetworkManager-module.patch 
kde-runtime-17.08.3/debian/patches/cmake-add-NetworkManager-module.patch
--- kde-runtime-17.08.3/debian/patches/cmake-add-NetworkManager-module.patch    
1970-01-01 00:00:00.000000000 +0000
+++ kde-runtime-17.08.3/debian/patches/cmake-add-NetworkManager-module.patch    
2018-04-14 12:48:27.000000000 +0000
@@ -0,0 +1,56 @@
+From 5711ab8b4b053e5d2f4f0b5831ff2a1d37cdf9fa Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkund...@v3.sk>
+Date: Tue, 19 Dec 2017 19:45:23 +0100
+Subject: [PATCH] cmake: add NetworkManager module
+
+This one looks for libnm as opposed to the deprecated libnm-glib.
+---
+ cmake/modules/FindNetworkManager.cmake | 40 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+ create mode 100644 cmake/modules/FindNetworkManager.cmake
+
+Index: kde-runtime-17.08.3/cmake/modules/FindNetworkManager.cmake
+===================================================================
+--- /dev/null
++++ kde-runtime-17.08.3/cmake/modules/FindNetworkManager.cmake
+@@ -0,0 +1,40 @@
++# - Try to find NetworkManager
++# Once done this will define
++#
++#  NETWORKMANAGER_FOUND - system has NetworkManager
++#  NETWORKMANAGER_INCLUDE_DIRS - the NetworkManager include directories
++#  NETWORKMANAGER_LIBRARIES - the libraries needed to use NetworkManager
++#  NETWORKMANAGER_CFLAGS - Compiler switches required for using NetworkManager
++#  NETWORKMANAGER_VERSION - version number of NetworkManager
++
++# Copyright (c) 2006, Alexander Neundorf, <neund...@kde.org>
++# Copyright (c) 2007, Will Stephenson, <wstephen...@kde.org>
++#
++# Redistribution and use is allowed according to the terms of the BSD license.
++# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
++
++
++IF (NETWORKMANAGER_INCLUDE_DIRS)
++   # in cache already
++   SET(NetworkManager_FIND_QUIETLY TRUE)
++ENDIF (NETWORKMANAGER_INCLUDE_DIRS)
++
++IF (NOT WIN32)
++   # use pkg-config to get the directories and then use these values
++   # in the FIND_PATH() and FIND_LIBRARY() calls
++   find_package(PkgConfig)
++   PKG_SEARCH_MODULE( NETWORKMANAGER libnm )
++ENDIF (NOT WIN32)
++
++IF (NETWORKMANAGER_FOUND)
++   IF (NOT NetworkManager_FIND_QUIETLY)
++      MESSAGE(STATUS "Found libnm ${NETWORKMANAGER_VERSION}: 
${NETWORKMANAGER_LIBRARY_DIRS}")
++   ENDIF (NOT NetworkManager_FIND_QUIETLY)
++ELSE (NETWORKMANAGER_FOUND)
++   IF (NetworkManager_FIND_REQUIRED)
++      MESSAGE(FATAL_ERROR "Could NOT find libnm, check FindPkgConfig output 
above!")
++   ENDIF (NetworkManager_FIND_REQUIRED)
++ENDIF (NETWORKMANAGER_FOUND)
++
++MARK_AS_ADVANCED(NETWORKMANAGER_INCLUDE_DIRS)
++
diff -Nru kde-runtime-17.08.3/debian/patches/libnm-1.0.0.patch 
kde-runtime-17.08.3/debian/patches/libnm-1.0.0.patch
--- kde-runtime-17.08.3/debian/patches/libnm-1.0.0.patch        1970-01-01 
00:00:00.000000000 +0000
+++ kde-runtime-17.08.3/debian/patches/libnm-1.0.0.patch        2018-04-14 
13:01:38.000000000 +0000
@@ -0,0 +1,168 @@
+Index: kde-runtime-17.08.3/solid-networkstatus/kded/networkmanagerstatus.cpp
+===================================================================
+--- kde-runtime-17.08.3.orig/solid-networkstatus/kded/networkmanagerstatus.cpp
++++ kde-runtime-17.08.3/solid-networkstatus/kded/networkmanagerstatus.cpp
+@@ -30,10 +30,6 @@
+ 
+ #include <NetworkManager.h>
+ 
+-#if !defined(NM_CHECK_VERSION)
+-    #define NM_CHECK_VERSION(x,y,z) 0
+-#endif
+-
+ NetworkManagerStatus::NetworkManagerStatus( QObject *parent )
+     : SystemStatusInterface( parent ),
+       m_manager( NM_DBUS_SERVICE,
+@@ -71,7 +67,7 @@ QString NetworkManagerStatus::serviceNam
+ void NetworkManagerStatus::nmStateChanged( uint nmState )
+ {
+     m_status = convertNmState( nmState );
+-    emit statusChanged( m_status );
++    Q_EMIT statusChanged( m_status );
+ }
+ 
+ Solid::Networking::Status NetworkManagerStatus::convertNmState( uint nmState )
+@@ -85,23 +81,17 @@ Solid::Networking::Status NetworkManager
+     case NM_STATE_CONNECTING:
+         status = Solid::Networking::Connecting;
+         break;
+-#if NM_CHECK_VERSION(0,8,992)
+     case NM_STATE_CONNECTED_LOCAL:
+     case NM_STATE_CONNECTED_SITE:
+     case NM_STATE_CONNECTED_GLOBAL:
+-#else
+-    case NM_STATE_CONNECTED:
+-#endif
+         status = Solid::Networking::Connected;
+         break;
+     case NM_STATE_DISCONNECTED:
+         status = Solid::Networking::Unconnected;
+         break;
+-#if NM_CHECK_VERSION(0,8,992)
+     case NM_STATE_DISCONNECTING:
+         status = Solid::Networking::Disconnecting;
+         break;
+-#endif
+     }
+ 
+     return status;
+Index: kde-runtime-17.08.3/solid-networkstatus/kded/networkmanagerstatus.h
+===================================================================
+--- kde-runtime-17.08.3.orig/solid-networkstatus/kded/networkmanagerstatus.h
++++ kde-runtime-17.08.3/solid-networkstatus/kded/networkmanagerstatus.h
+@@ -38,7 +38,7 @@ public:
+     /* reimp */ bool isSupported() const;
+     /* reimp */ QString serviceName() const;
+ 
+-private slots:
++private Q_SLOTS:
+     void nmStateChanged( uint nmState );
+ 
+ private:
+Index: kde-runtime-17.08.3/solid-networkstatus/kded/networkstatus.cpp
+===================================================================
+--- kde-runtime-17.08.3.orig/solid-networkstatus/kded/networkstatus.cpp
++++ kde-runtime-17.08.3/solid-networkstatus/kded/networkstatus.cpp
+@@ -122,14 +122,14 @@ void NetworkStatusModule::updateStatus()
+         if (d->status == Solid::Networking::Connected) {
+             QTimer::singleShot(2000, this, SLOT(delayedStatusChanged()));
+         } else {
+-            emit statusChanged( (uint)d->status );
++            Q_EMIT statusChanged( (uint)d->status );
+         }
+     }
+ }
+ 
+ void NetworkStatusModule::delayedStatusChanged()
+ {
+-    emit statusChanged( (uint)d->status );
++    Q_EMIT statusChanged( (uint)d->status );
+ }
+ 
+ void NetworkStatusModule::serviceUnregistered( const QString & name )
+Index: kde-runtime-17.08.3/solid-networkstatus/kded/systemstatusinterface.h
+===================================================================
+--- kde-runtime-17.08.3.orig/solid-networkstatus/kded/systemstatusinterface.h
++++ kde-runtime-17.08.3/solid-networkstatus/kded/systemstatusinterface.h
+@@ -37,7 +37,7 @@ public:
+     virtual bool isSupported() const = 0;
+     virtual QString serviceName() const = 0;
+ 
+-signals:
++Q_SIGNALS:
+     void statusChanged( Solid::Networking::Status status );
+ };
+ 
+Index: kde-runtime-17.08.3/solid-networkstatus/kded/wicdstatus.cpp
+===================================================================
+--- kde-runtime-17.08.3.orig/solid-networkstatus/kded/wicdstatus.cpp
++++ kde-runtime-17.08.3/solid-networkstatus/kded/wicdstatus.cpp
+@@ -66,12 +66,12 @@ void WicdStatus::wicdStateChanged()
+     QDBusMessage message = m_wicd.call("GetConnectionStatus");
+ 
+     if (message.arguments().count() == 0) {
+-        emit statusChanged( status );
++        Q_EMIT statusChanged( status );
+         return;
+     }
+ 
+     if (!message.arguments().at(0).isValid()) {
+-        emit statusChanged( status );
++        Q_EMIT statusChanged( status );
+         return;
+     }
+ 
+@@ -96,7 +96,7 @@ void WicdStatus::wicdStateChanged()
+         break;
+     }
+ 
+-    emit statusChanged( status );
++    Q_EMIT statusChanged( status );
+ }
+ 
+ #include "wicdstatus.moc"
+Index: kde-runtime-17.08.3/solid-networkstatus/kded/wicdstatus.h
+===================================================================
+--- kde-runtime-17.08.3.orig/solid-networkstatus/kded/wicdstatus.h
++++ kde-runtime-17.08.3/solid-networkstatus/kded/wicdstatus.h
+@@ -36,7 +36,7 @@ public:
+     /* reimp */ bool isSupported() const;
+     /* reimp */ QString serviceName() const;
+ 
+-private slots:
++private Q_SLOTS:
+     void wicdStateChanged();
+ 
+ private:
+Index: kde-runtime-17.08.3/solid-networkstatus/kded/CMakeLists.txt
+===================================================================
+--- kde-runtime-17.08.3.orig/solid-networkstatus/kded/CMakeLists.txt
++++ kde-runtime-17.08.3/solid-networkstatus/kded/CMakeLists.txt
+@@ -8,7 +8,7 @@ set(kded_networkstatus_PART_SRCS
+    wicdcustomtypes.cpp
+ )
+ 
+-macro_optional_find_package(NetworkManager)
++macro_optional_find_package(NetworkManager 1.0.0)
+ set_package_properties(NetworkManager PROPERTIES DESCRIPTION "The 
NetworkManager headers"
+                        URL "http://projects.gnome.org/NetworkManager";
+                        TYPE OPTIONAL
+@@ -22,13 +22,11 @@ if(NETWORKMANAGER_FOUND)
+     if (GLIB_PKG_FOUND)
+        include_directories(${GLIB_PKG_INCLUDE_DIRS})
+     endif()
+-    macro_ensure_version("0.7.0" ${NETWORKMANAGER_VERSION} NM_0_7)
+-    if(NM_0_7)
+-        MESSAGE(STATUS "Adding in-process NetworkManager service-wart to kded 
module")
+-        set(kded_networkstatus_PART_SRCS ${kded_networkstatus_PART_SRCS} 
networkmanagerstatus.cpp)
+-        include_directories(${NETWORKMANAGER_INCLUDE_DIRS})
+-        add_definitions(-DNM_BACKEND_ENABLED)
+-    endif(NM_0_7)
++    MESSAGE(STATUS "Adding in-process NetworkManager service-wart to kded 
module")
++    set(kded_networkstatus_PART_SRCS ${kded_networkstatus_PART_SRCS} 
networkmanagerstatus.cpp)
++    include_directories(${NETWORKMANAGER_INCLUDE_DIRS})
++    add_definitions(-DNM_BACKEND_ENABLED)
++    add_definitions(-DQT_NO_KEYWORDS)
+ endif(NETWORKMANAGER_FOUND)
+ 
+ macro_optional_find_package(QNtrack)
diff -Nru kde-runtime-17.08.3/debian/patches/series 
kde-runtime-17.08.3/debian/patches/series
--- kde-runtime-17.08.3/debian/patches/series   2017-05-22 17:34:05.000000000 
+0000
+++ kde-runtime-17.08.3/debian/patches/series   2018-04-14 12:49:40.000000000 
+0000
@@ -8,3 +8,5 @@
 add_glib_for_nm
 hurd.diff
 Make-sure-people-are-not-trying-to-sneak-invisible-charac.patch
+cmake-add-NetworkManager-module.patch
+libnm-1.0.0.patch

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to