[network/kio-extras] /: Drop network: KIO slave
Friedrich W. H. Kossebau
null at kde.org
Tue Jun 29 13:29:23 BST 2021
Git commit a5e17084e5ec97add7dea94934e02d0feaa98ad5 by Friedrich W. H. Kossebau.
Committed on 29/06/2021 at 12:23.
Pushed by kossebau into branch 'master'.
Drop network: KIO slave
Never really left the stage of being a prototype for a hardware-centric
meta-protocol KIO slave, also not just file system centric, and
its presence is confusing compared to the remote KIO slave, which also
is tighter integrated with Dolpin & Co.
It had 12 years of chance* to take over, but did not, so time to take it
back from the playing field.
* https://frinring.wordpress.com/2009/04/20/network-kioslave-entered-kdereview/
M +0 -3 CMakeLists.txt
M +0 -1 doc/kioslave/CMakeLists.txt
D +0 -1 doc/kioslave/network/CMakeLists.txt
D +0 -61 doc/kioslave/network/index.docbook
D +0 -14 network/CMakeLists.txt
D +0 -2 network/Messages.sh
D +0 -37 network/README
D +0 -26 network/ioslave/CMakeLists.txt
D +0 -37 network/ioslave/main.cpp
D +0 -157 network/ioslave/mimetypes.cpp
D +0 -24 network/ioslave/mimetypes.h
D +0 -98 network/ioslave/network.desktop
D +0 -18 network/ioslave/network.json
D +0 -30 network/ioslave/networkdbusinterface.cpp
D +0 -60 network/ioslave/networkdbusinterface.h
D +0 -9 network/ioslave/networkinitwatcher.cpp
D +0 -57 network/ioslave/networkinitwatcher.h
D +0 -307 network/ioslave/networkslave.cpp
D +0 -48 network/ioslave/networkslave.h
D +0 -70 network/ioslave/networkthread.cpp
D +0 -45 network/ioslave/networkthread.h
D +0 -9 network/ioslave/networkuri.cpp
D +0 -89 network/ioslave/networkuri.h
D +0 -103 network/ioslave/virtualfolder_network.desktop
D +0 -28 network/kded/CMakeLists.txt
D +0 -185 network/kded/kioslavenotifier.cpp
D +0 -55 network/kded/kioslavenotifier.h
D +0 -51 network/kded/networkdbusadaptor.cpp
D +0 -51 network/kded/networkdbusadaptor.h
D +0 -107 network/kded/networkwatcher.cpp
D +0 -145 network/kded/networkwatcher.desktop
D +0 -44 network/kded/networkwatcher.h
D +0 -14 network/kded/org.kde.network.kioslavenotifier.xml
D +0 -11 network/kded/org.kde.network.xml
D +0 -6 network/mimetypes/CMakeLists.txt
D +0 -499 network/mimetypes/network.xml
D +0 -45 network/network/CMakeLists.txt
D +0 -44 network/network/README
D +0 -97 network/network/TODO
D +0 -9 network/network/builder/abstractnetsystemfactory.cpp
D +0 -34 network/network/builder/abstractnetsystemfactory.h
D +0 -9 network/network/builder/abstractnetworkbuilder.cpp
D +0 -53 network/network/builder/abstractnetworkbuilder.h
D +0 -53 network/network/builder/dnssd/dnssdnetsystemable.h
D +0 -303 network/network/builder/dnssd/dnssdnetworkbuilder.cpp
D +0 -79 network/network/builder/dnssd/dnssdnetworkbuilder.h
D +0 -257 network/network/builder/simpleitemfactory.cpp
D +0 -50 network/network/builder/simpleitemfactory.h
D +0 -102 network/network/builder/upnp/cagibidbuscodec.cpp
D +0 -26 network/network/builder/upnp/cagibidbuscodec.h
D +0 -56 network/network/builder/upnp/cagibidevice.cpp
D +0 -73 network/network/builder/upnp/cagibidevice.h
D +0 -87 network/network/builder/upnp/cagibidevice_p.h
D +0 -45 network/network/builder/upnp/upnpnetsystemable.h
D +0 -337 network/network/builder/upnp/upnpnetworkbuilder.cpp
D +0 -79 network/network/builder/upnp/upnpnetworkbuilder.h
D +0 -78 network/network/netdevice.cpp
D +0 -83 network/network/netdevice.h
D +0 -64 network/network/netdevice_p.cpp
D +0 -71 network/network/netdevice_p.h
D +0 -65 network/network/netservice.cpp
D +0 -79 network/network/netservice.h
D +0 -31 network/network/netservice_p.cpp
D +0 -57 network/network/netservice_p.h
D +0 -43 network/network/network.cpp
D +0 -63 network/network/network.h
D +0 -59 network/network/network_p.cpp
D +0 -63 network/network/network_p.h
D +0 -92 network/network/networkdbus.cpp
D +0 -38 network/network/networkdbus.h
https://invent.kde.org/network/kio-extras/commit/a5e17084e5ec97add7dea94934e02d0feaa98ad5
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ada518c5..ea3122f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,9 +167,6 @@ if(Phonon4Qt5_FOUND)
endif()
add_subdirectory( info )
add_subdirectory( archive )
-if(NOT WIN32)
- add_subdirectory( network )
-endif()
add_subdirectory( recentdocuments )
if (NOT WIN32)
# does not compile: fish.cpp(41): fatal error C1083: Cannot open include file: 'sys/resource.h': No such file or directory
diff --git a/doc/kioslave/CMakeLists.txt b/doc/kioslave/CMakeLists.txt
index 0ffe1d71..d9347dde 100644
--- a/doc/kioslave/CMakeLists.txt
+++ b/doc/kioslave/CMakeLists.txt
@@ -6,7 +6,6 @@ add_subdirectory(fish)
add_subdirectory(gzip)
add_subdirectory(info)
add_subdirectory(man)
-add_subdirectory(network)
add_subdirectory(nfs)
add_subdirectory(recentdocuments)
add_subdirectory(sftp)
diff --git a/doc/kioslave/network/CMakeLists.txt b/doc/kioslave/network/CMakeLists.txt
deleted file mode 100644
index ef43b8e6..00000000
--- a/doc/kioslave/network/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR kioslave5/network)
diff --git a/doc/kioslave/network/index.docbook b/doc/kioslave/network/index.docbook
deleted file mode 100644
index 15975b2d..00000000
--- a/doc/kioslave/network/index.docbook
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" ?>
-<!DOCTYPE article PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN"
-"dtd/kdedbx45.dtd" [
-<!ENTITY % addindex "IGNORE">
-<!ENTITY % English "INCLUDE" > <!-- change language only here -->
-]>
-
-<article lang="&language;" id="network">
-
-<title>network</title>
-
-<articleinfo>
- <authorgroup>
- <author>
- <personname><firstname>Friedrich W. H.</firstname><surname>Kossebau</surname></personname>
- <email>kossebau at kde.org</email>
- </author>
- <!-- TRANS:ROLES_OF_TRANSLATORS -->
- </authorgroup>
-
- <date>2016-12-11</date>
- <releaseinfo>Applications 16.12</releaseinfo>
-
-</articleinfo>
-
-
-<para>
- The network ioslave enables the user to browse the devices connected to the local network
- and the services running on them. It it also possible to start programs for services
- whose type is known.
-</para>
-
-<para>
- To see all the devices found, enter
- <userinput><command>network://</command></userinput>.
-</para>
-
-<para>
- <userinput><command>network://</command><replaceable>hostname_of_device</replaceable></userinput>
- will list the services found to be running on a device.
-</para>
-
-<para>
- Selecting a service will forward to a url which matches the service, given there is a suitable, e.g.
- <userinput><command>ssh://</command>hostname_of_device:port/</userinput> for a <acronym>SSH</acronym> service.
- Each known service type has a mimetype assigned to it, so a user can assign new handlers
- for the resulting urls. This is done with the control module
- <menuchoice><guimenuitem>File Associations</guimenuitem></menuchoice> in &systemsettings;.
- The mimetypes of the services are currently all named <userinput>inode/vnd.kde.service.*</userinput>.
-</para>
-
-<note>
- <para>
- The network kioslave currently only finds and displays devices and services which are
- actively advertising themselves using the service discovery framework
- <ulink url="http://www.dns-sd.org/">DNS-SD</ulink>.
- </para>
-</note>
-
-</article>
-
diff --git a/network/CMakeLists.txt b/network/CMakeLists.txt
deleted file mode 100644
index c31bfd40..00000000
--- a/network/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-include(GenerateExportHeader)
-
-add_definitions(-DTRANSLATION_DOMAIN=\"kio5_network\")
-
-add_definitions(
- -DQT_USE_FAST_OPERATOR_PLUS
- -DQT_NO_CAST_TO_ASCII
- -DQT_NO_CAST_FROM_ASCII
-)
-
-add_subdirectory( network )
-add_subdirectory( ioslave )
-add_subdirectory( kded )
-add_subdirectory( mimetypes )
diff --git a/network/Messages.sh b/network/Messages.sh
deleted file mode 100644
index 2f820722..00000000
--- a/network/Messages.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#! /usr/bin/env bash
-$XGETTEXT $(find . -name *.cpp) -o $podir/kio5_network.pot
diff --git a/network/README b/network/README
deleted file mode 100644
index 4d5eaba1..00000000
--- a/network/README
+++ /dev/null
@@ -1,37 +0,0 @@
-networkkio
-==========
-
-This is an experimental kioslave which presents the network.
-It also includes a library which models the network, the devices, and services,
-and could be reused by other code.
-
-Please contact the author Friedrich W. H. Kossebau <kossebau at kde.org> for any further questions.
-Cooperation in this area is welcome :)
-
-
-ioslave
--------
-The ioslave lists the local network as represented by the
-The protocol name is "network", so enter "network:/" to see your local network.
-Currently, due to synchronisation problems, the network data is fetched from the
-kded network module via D-Bus, instead of using the network library directly.
-
-
-kded
-----
-A kded module to emit KDirNotify signals as needed if the network structure changes.
-
-That way all users of the network kioslave and listening to KDirNotify can update the view,
-e.g. Dolphin, Konqueror and the KDElibs file dialogs.
-It also offers the data of the network structure over D-Bus, as currently used by the ioslave.
-
-
-network
--------
-A library which models the network with all its devices and the services offered by them.
-
-Currently it uses KDNSSD, the KDElibs interface to the zeroconf service discovery system,
-as the engine to find about the content of network structure. Later on this library should
-support different backends concurrently (also UPnP, Windows related stuff like smb,
-including undiscoverable/hidden but user/admin entered ones).
-If this works out this library might end in KDElibs solid module.
diff --git a/network/ioslave/CMakeLists.txt b/network/ioslave/CMakeLists.txt
deleted file mode 100644
index bc2d8aa3..00000000
--- a/network/ioslave/CMakeLists.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-add_library(kio_network MODULE)
-
-set_target_properties(kio_network PROPERTIES OUTPUT_NAME "network")
-
-target_sources(kio_network PRIVATE
- networkdbusinterface.cpp
- networkinitwatcher.cpp
- networkthread.cpp
- networkuri.cpp
- mimetypes.cpp
- networkslave.cpp
- main.cpp
-)
-
-# qt5_add_dbus_interface( kio_network_SRCS ../kded/org.kde.network.xml networkdbusproxy )
-
-target_link_libraries(kio_network
- molletnetwork5
- KF5::KIOCore
- KF5::I18n
-)
-
-install( TARGETS kio_network DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
-
-install( FILES network.desktop DESTINATION ${KDE_INSTALL_DATADIR}/remoteview)
-install( FILES virtualfolder_network.desktop DESTINATION ${KDE_INSTALL_DATADIR}/konqsidebartng/virtual_folders/remote)
diff --git a/network/ioslave/main.cpp b/network/ioslave/main.cpp
deleted file mode 100644
index 669bdb5d..00000000
--- a/network/ioslave/main.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "networkslave.h"
-
-// Qt
-#include <QCoreApplication>
-
-// Pseudo plugin class to embed meta data
-class KIOPluginForMetaData : public QObject
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.kde.kio.slave.network" FILE "network.json")
-};
-
-extern "C"
-{
-
- int Q_DECL_EXPORT kdemain( int argc, char** argv )
- {
- QCoreApplication app( argc, argv );
- app.setApplicationName(QLatin1String("kio_network"));
-
- NetworkSlave slave( argv[1], argv[2], argv[3] );
- slave.dispatchLoop();
-
- return 0;
- }
-
-}
-
-#include "main.moc"
diff --git a/network/ioslave/mimetypes.cpp b/network/ioslave/mimetypes.cpp
deleted file mode 100644
index c06f719b..00000000
--- a/network/ioslave/mimetypes.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "mimetypes.h"
-
-// Qt
-#include <QString>
-
-
-const char Mimetypes::NetworkMimetype[] = "inode/vnd.kde.network";
-
-// keep in sync with Mollet::NetDevice::Type
-const char* const Mimetypes::DeviceMimetype[] =
-{
- "inode/vnd.kde.device.unknown",
- "inode/vnd.kde.device.scanner",
- "inode/vnd.kde.device.printer",
- "inode/vnd.kde.device.server",
- "inode/vnd.kde.device.router",
- "inode/vnd.kde.device.workstation"
-};
-
-
-struct MimetypePair {
- const char* typeName;
- const char* mimetype;
-};
-
-
-// keep in sync with network.xml
-static const char* const SimpleServiceMimetype[] =
-{
- "ftp",
- "sftp-ssh",
- "ftps",
- "nfs",
- "afpovertcp",
- "smb",
- "webdav",
- "webdavs",
-
- "svn",
- "rsync",
-
- "pop3",
- "imap",
-
- "ssh",
- "telnet",
- "rfb",
- "rdp",
-
- "http",
- "ntp",
- "ldap",
-
- "xmpp-server",
- "presence",
- "lobby",
- "giver",
- "sip",
- "h323",
- "skype",
-
- "ipp",
- "printer",
- "pdl-datastream",
-
- "plasma",
-
- "kbattleship",
- "lskat",
- "kfourinline",
- "ksirk",
-
- "pulse-server",
- "pulse-source",
- "pulse-sink",
- "udisks-ssh",
- "libvirt",
- "airmouse",
-
- "postgresql",
- "couchdb_location",
-
- "realplayfavs",
- "acrobat-server",
- "adobe-vc",
- "ggz",
-
- "pgpkey-ldap",
- "pgpkey-hkp",
- "pgpkey-https",
-
- "maemo-inf",
-
- "airport",
- "daap",
- "dacp",
- "eppc",
- "net-assistant",
- "odisk",
- "raop",
- "touch-able",
- "workstation",
- "sleep-proxy",
- "nssocketport",
- "home-sharing",
- "appletv-itunes",
- "appletv-pair",
-
- "upnp.BasicDevice1",
- "upnp.WLANAccessPointDevice1",
- "upnp.InternetGatewayDevice1",
- "upnp.PrinterBasic1",
- "upnp.PrinterEnhanced1",
- "upnp.Scanner1",
- "upnp.MediaServer1",
- "upnp.MediaRenderer1",
- "upnp.MediaServer2",
- "upnp.MediaRenderer2",
- "upnp.MediaServer3",
- "upnp.SolarProtectionBlind1",
- "upnp.DigitalSecurityCamera1",
- "upnp.HVAC1",
- "upnp.LightingControls1",
- "upnp.RemoteUIClientDevice1",
- "upnp.RemoteUIServerDevice1",
- "upnp.RAClient1",
- "upnp.RAServer1",
- "upnp.RADiscoveryAgent1",
- "upnp.LANDevice1",
- "upnp.WANDevice1",
- "upnp.WANConnectionDevice1",
- "upnp.WFADevice1",
- "upnp.Unknown"
-};
-static const int SimpleServiceMimetypeCount = sizeof(SimpleServiceMimetype) / sizeof(SimpleServiceMimetype[0]);
-
-QString Mimetypes::mimetypeForServiceType( const QString& serviceTypeName )
-{
- QString subType = QLatin1String("unknown");
- for( int i=0; i<SimpleServiceMimetypeCount; ++i )
- {
- if( serviceTypeName == QLatin1String(SimpleServiceMimetype[i]) )
- {
- subType = serviceTypeName;
- break;
- }
- }
- return QLatin1String("inode/vnd.kde.service.") + subType;
-}
diff --git a/network/ioslave/mimetypes.h b/network/ioslave/mimetypes.h
deleted file mode 100644
index fb7ce5cb..00000000
--- a/network/ioslave/mimetypes.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef MIMETYPES_H
-#define MIMETYPES_H
-
-class QString;
-
-
-class Mimetypes
-{
-public:
- static const char NetworkMimetype[];
- static const char* const DeviceMimetype[];
-
- static QString mimetypeForServiceType( const QString& serviceTypeName );
-};
-
-#endif
diff --git a/network/ioslave/network.desktop b/network/ioslave/network.desktop
deleted file mode 100644
index 1f19126c..00000000
--- a/network/ioslave/network.desktop
+++ /dev/null
@@ -1,98 +0,0 @@
-[Desktop Entry]
-Type=Link
-
-URL=network:/
-
-Icon=network-workgroup
-Name=Network
-Name[af]=Netwerk
-Name[ar]=الشّبكة
-Name[as]=নে'টৱৰ্ক
-Name[be]=Сетка
-Name[be at latin]=Sietka
-Name[bg]=Мрежа
-Name[bn]=নেটওয়ার্ক
-Name[bn_IN]=নেটওয়ার্ক
-Name[br]=Rouedad
-Name[bs]=Mreža
-Name[ca]=Xarxa
-Name[ca at valencia]=Xarxa
-Name[cs]=Síť
-Name[csb]=Séc
-Name[cy]=Rhwydwaith
-Name[da]=Netværk
-Name[de]=Netzwerk
-Name[el]=Δίκτυο
-Name[en_GB]=Network
-Name[eo]=Reto
-Name[es]=Red
-Name[et]=Võrk
-Name[eu]=Sarea
-Name[fa]=شبکه
-Name[fi]=Verkko
-Name[fr]=Réseau
-Name[fy]=Netwurk
-Name[ga]=Líonra
-Name[gl]=Rede
-Name[gu]=નેટવર્ક
-Name[he]=רשת
-Name[hi]=नेटवर्क
-Name[hne]=नेटवर्क
-Name[hr]=Mreža
-Name[hsb]=Syć
-Name[hu]=Hálózat
-Name[ia]=Rete
-Name[id]=Jaringan
-Name[is]=Netkerfi
-Name[it]=Rete
-Name[ja]=ネットワーク
-Name[ka]=ქსელი
-Name[kk]=Желі
-Name[km]=បណ្ដាញ
-Name[kn]=ಜಾಲ
-Name[ko]=네트워크
-Name[ku]=Tor
-Name[lt]=Tinklas
-Name[lv]=Tīkls
-Name[mai]=नेटवर्क
-Name[mk]=Мрежа
-Name[ml]=ശൃംഖല
-Name[mr]=संजाळ
-Name[ms]=Rangkaian
-Name[nb]=Nettverk
-Name[nds]=Nettwark
-Name[ne]=सञ्जाल
-Name[nl]=Netwerk
-Name[nn]=Nettverk
-Name[oc]=Ret
-Name[or]=ନେଟୱର୍କ
-Name[pa]=ਨੈੱਟਵਰਕ
-Name[pl]=Sieć
-Name[pt]=Rede
-Name[pt_BR]=Rede
-Name[ro]=Rețea
-Name[ru]=Сеть
-Name[se]=Fierbmi
-Name[si]=ජාලය
-Name[sk]=Sieť
-Name[sl]=Omrežje
-Name[sr]=Мрежа
-Name[sr at ijekavian]=Мрежа
-Name[sr at ijekavianlatin]=Mreža
-Name[sr at latin]=Mreža
-Name[sv]=Nätverk
-Name[ta]=பிணையம்
-Name[te]=నెట్ వర్క్
-Name[tg]=Шабакаи Интернет
-Name[th]=เครือข่าย
-Name[tr]=Ağ
-Name[ug]=تور
-Name[uk]=Мережа
-Name[uz]=Tarmoq
-Name[uz at cyrillic]=Тармоқ
-Name[vi]=Mạng
-Name[wa]=Rantoele
-Name[xh]=Umsebenzi womnatha
-Name[x-test]=xxNetworkxx
-Name[zh_CN]=网络
-Name[zh_TW]=網路
diff --git a/network/ioslave/network.json b/network/ioslave/network.json
deleted file mode 100644
index 883a1a8a..00000000
--- a/network/ioslave/network.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "KDE-KIO-Protocols": {
- "network": {
- "Class": ":internet",
- "Icon": "network-workgroup",
- "X-DocPath": "kioslave5/network/index.html",
- "determineMimetypeFromExtension": false,
- "exec": "kf5/kio/network",
- "input": "none",
- "listing": [
- "Name"
- ],
- "output": "filesystem",
- "protocol": "network",
- "reading": true
- }
- }
-}
diff --git a/network/ioslave/networkdbusinterface.cpp b/network/ioslave/networkdbusinterface.cpp
deleted file mode 100644
index fb60e41f..00000000
--- a/network/ioslave/networkdbusinterface.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "networkdbusinterface.h"
-
-// Qt
-#include <QDBusMetaType>
-
-
-static const char NetworkDBusInterfaceName[] = "org.kde.network";
-
-NetworkDBusInterface::NetworkDBusInterface( const QString& service, const QString& path, const QDBusConnection& connection, QObject* parent )
- : QDBusAbstractInterface( service, path, NetworkDBusInterfaceName, connection, parent )
-{
- // TODO: best place to do this?
- qDBusRegisterMetaType<Mollet::NetDevice>();
- qDBusRegisterMetaType<Mollet::NetService>();
- qDBusRegisterMetaType<Mollet::NetDeviceList>();
- qDBusRegisterMetaType<Mollet::NetServiceList>();
-}
-
-NetworkDBusInterface::~NetworkDBusInterface()
-{
-}
-
diff --git a/network/ioslave/networkdbusinterface.h b/network/ioslave/networkdbusinterface.h
deleted file mode 100644
index 2bb9ac6e..00000000
--- a/network/ioslave/networkdbusinterface.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORKDBUSINTERFACE_H
-#define NETWORKDBUSINTERFACE_H
-
-
-// network
-#include <networkdbus.h>
-// Qt
-#include <QDBusAbstractInterface>
-#include <QDBusReply>
-
-
-// TODO: see file networkdbus.h
-class NetworkDBusInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-
-public:
- NetworkDBusInterface( const QString& service, const QString& path, const QDBusConnection& connection, QObject* parent = nullptr );
- ~NetworkDBusInterface() override;
-
-public Q_SLOTS:
- QDBusReply<Mollet::NetDevice> deviceData( const QString& hostAddress );
- QDBusReply<Mollet::NetService> serviceData( const QString& hostAddress, const QString& serviceName, const QString& serviceType );
- QDBusReply<Mollet::NetDeviceList> deviceDataList();
- QDBusReply<Mollet::NetServiceList> serviceDataList( const QString& hostAddress );
-};
-
-// TODO: is QDBus::Block the right solution here?
-inline QDBusReply<Mollet::NetDevice> NetworkDBusInterface::deviceData( const QString& hostAddress )
-{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(hostAddress);
- return callWithArgumentList( QDBus::Block, QString::fromLatin1("deviceData"), argumentList );
-}
-inline QDBusReply<Mollet::NetService> NetworkDBusInterface::serviceData( const QString& hostAddress, const QString& serviceName, const QString& serviceType )
-{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(hostAddress) << QVariant::fromValue(serviceName) << QVariant::fromValue(serviceType);
- return callWithArgumentList( QDBus::Block, QString::fromLatin1("serviceData"), argumentList );
-}
-inline QDBusReply<Mollet::NetDeviceList> NetworkDBusInterface::deviceDataList()
-{
- return call( QString::fromLatin1("deviceDataList") );
-}
-inline QDBusReply<Mollet::NetServiceList> NetworkDBusInterface::serviceDataList( const QString& hostAddress )
-{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(hostAddress);
- return callWithArgumentList( QDBus::Block, QString::fromLatin1("serviceDataList"), argumentList );
-}
-
-#endif
diff --git a/network/ioslave/networkinitwatcher.cpp b/network/ioslave/networkinitwatcher.cpp
deleted file mode 100644
index adbe1f07..00000000
--- a/network/ioslave/networkinitwatcher.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "networkinitwatcher.h"
diff --git a/network/ioslave/networkinitwatcher.h b/network/ioslave/networkinitwatcher.h
deleted file mode 100644
index 39157451..00000000
--- a/network/ioslave/networkinitwatcher.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORKINITWATCHER_H
-#define NETWORKINITWATCHER_H
-
-// network
-#include "network.h"
-//Qt
-#include <QObject>
-#include <QMutex>
-#include <QDebug>
-
-using namespace Mollet;
-
-
-class NetworkInitWatcher : public QObject
-{
- Q_OBJECT
-
-public:
- NetworkInitWatcher( Network* network, QMutex* mutex );
- ~NetworkInitWatcher() override;
-
-public Q_SLOTS:
- void onNetworkInitDone();
-
-private:
- QMutex* mMutex;
-};
-
-
-inline NetworkInitWatcher::NetworkInitWatcher( Network* network, QMutex* mutex )
- : mMutex( mutex )
-{
- connect( network, SIGNAL(initDone()), SLOT(onNetworkInitDone()) );
-}
-inline NetworkInitWatcher::~NetworkInitWatcher()
-{
- qDebug();
-}
-
-inline void NetworkInitWatcher::onNetworkInitDone()
-{
- qDebug()<<"before unlock";
- mMutex->unlock();
- qDebug()<<"after unlock";
- deleteLater();
- qDebug()<<"after deleteLater";
-}
-
-#endif
diff --git a/network/ioslave/networkslave.cpp b/network/ioslave/networkslave.cpp
deleted file mode 100644
index 022183a1..00000000
--- a/network/ioslave/networkslave.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "networkslave.h"
-
-// ioslave
-#include "networkuri.h"
-#include "mimetypes.h"
-#include "networkdbusinterface.h"
-// network
-#include <netdevice.h>
-#include <netservice.h>
-// KF
-#include <KLocalizedString>
-// Qt
-#include <QEventLoop>
-#include <QDebug>
-
-#ifdef Q_OS_WIN
-#include <sys/stat.h>
-#endif
-
-// static const char NetworkIconName[] = "network-workgroup";
-
-
-NetworkSlave::NetworkSlave( const QByteArray& name, const QByteArray& poolSocket, const QByteArray& programSocket )
- : SlaveBase( name, poolSocket, programSocket )
-{
- mNetworkDBusProxy = new NetworkDBusInterface( QLatin1String("org.kde.kded5"),
- QLatin1String("/modules/networkwatcher"),
- QDBusConnection::sessionBus() );
-}
-
-void NetworkSlave::get( const QUrl& url )
-{
- const NetworkUri networkUri( url );
-
- bool successfulGetting = false;
-
- const NetworkUri::Type type = networkUri.type();
- if( type == NetworkUri::Service )
- {
- const QString hostAddress = networkUri.hostAddress();
- const QString serviceName = networkUri.serviceName();
- const QString serviceType = networkUri.serviceType();
- QDBusReply<Mollet::NetService> reply = mNetworkDBusProxy->serviceData( hostAddress, serviceName, serviceType );
-
- if( reply.isValid() ) // TODO: find how a not found service can be expressed in the reply
- {
- Mollet::NetService serviceData = reply.value();
- if( serviceData.isValid() )
- {
- const QUrl url(serviceData.url());
- redirection( url );
- finished();
- successfulGetting = true;
- }
- }
- }
-
- if( ! successfulGetting )
- error( KIO::ERR_DOES_NOT_EXIST, url.toDisplayString() );
-}
-
-void NetworkSlave::mimetype( const QUrl& url )
-{
- const NetworkUri networkUri( url );
-
- bool successfulMimetyping = false;
- NetworkUri::Type type = networkUri.type();
- if( type == NetworkUri::Domain )
- {
- mimeType( QLatin1String(Mimetypes::NetworkMimetype) );
- finished();
- successfulMimetyping = true;
- }
- else
- {
- const QString hostAddress = networkUri.hostAddress();
- if( type == NetworkUri::Device )
- {
- QDBusReply<Mollet::NetDevice> reply = mNetworkDBusProxy->deviceData( hostAddress );
-
- if( reply.isValid() ) // TODO: find how a not found service can be expressed in the reply
- {
- Mollet::NetDevice deviceData = reply.value();
-
- mimeType( QLatin1String(Mimetypes::DeviceMimetype[deviceData.type()]) );
- finished();
- successfulMimetyping = true;
- }
- }
- else if( type == NetworkUri::Service )
- {
- const QString serviceName = networkUri.serviceName();
- const QString serviceType = networkUri.serviceType();
- QDBusReply<Mollet::NetService> reply = mNetworkDBusProxy->serviceData( hostAddress, serviceName, serviceType );
-
- if( reply.isValid() ) // TODO: find how a not found service can be expressed in the reply
- {
- Mollet::NetService serviceData = reply.value();
- if( serviceData.isValid() )
- {
- const QUrl url(serviceData.url());
- redirection( url );
- //mimeType( Mimetypes::mimetypeForServiceType(serviceData.type()) );
- finished();
- successfulMimetyping = true;
- }
- }
- }
- }
-
- if( !successfulMimetyping )
- error( KIO::ERR_DOES_NOT_EXIST, url.toDisplayString() );
-}
-
-
-void NetworkSlave::stat( const QUrl& url )
-{
- const NetworkUri networkUri( url );
-
- bool successfulStating = false;
- NetworkUri::Type type = networkUri.type();
-
- if( type == NetworkUri::Domain )
- {
- KIO::UDSEntry entry;
- feedEntryAsNetwork( &entry );
- statEntry( entry );
- finished();
- successfulStating = true;
- }
- else
- {
- const QString hostAddress = networkUri.hostAddress();
- if( type == NetworkUri::Device )
- {
- QDBusReply<Mollet::NetDevice> reply = mNetworkDBusProxy->deviceData( hostAddress );
-
- if( reply.isValid() ) // TODO: find how a not found service can be expressed in the reply
- {
- Mollet::NetDevice deviceData = reply.value();
-
- KIO::UDSEntry entry;
- feedEntryAsDevice( &entry, deviceData );
- statEntry( entry );
- finished();
- successfulStating = true;
- }
- }
- else if( type == NetworkUri::Service )
- {
- const QString serviceName = networkUri.serviceName();
- const QString serviceType = networkUri.serviceType();
- QDBusReply<Mollet::NetService> reply = mNetworkDBusProxy->serviceData( hostAddress, serviceName, serviceType );
-
- if( reply.isValid() ) // TODO: find how a not found service can be expressed in the reply
- {
- Mollet::NetService serviceData = reply.value();
- if( serviceData.isValid() )
- {
- const QUrl url( serviceData.url() );
- redirection( url );
- //KIO::UDSEntry entry;
- //feedEntryAsService( &entry, serviceData );
- //statEntry( entry );
- finished();
- successfulStating = true;
- }
- }
- }
- }
-
- if( !successfulStating )
- error( KIO::ERR_DOES_NOT_EXIST, url.toDisplayString() );
-}
-
-void NetworkSlave::listDir( const QUrl& url )
-{
- const NetworkUri networkUri( url );
-
- bool successfulListing = false;
- NetworkUri::Type networkUriType = networkUri.type();
-
- if( networkUriType != NetworkUri::InvalidUrl )
- {
- if( networkUriType == NetworkUri::Domain )
- {
- QDBusReply<Mollet::NetDeviceList> reply = mNetworkDBusProxy->deviceDataList();
-
- if( reply.isValid() ) // TODO: find how a not found service can be expressed in the reply
- {
- const Mollet::NetDeviceList deviceDataList = reply.value();
-
- for (const Mollet::NetDevice& deviceData : deviceDataList) {
- KIO::UDSEntry entry;
- feedEntryAsDevice( &entry, deviceData );
- listEntry( entry );
- }
- finished();
- successfulListing = true;
- }
- }
- else
- {
- const QString hostAddress = networkUri.hostAddress();
- if( networkUriType == NetworkUri::Device )
- {
- QDBusReply<Mollet::NetServiceList> reply = mNetworkDBusProxy->serviceDataList( hostAddress );
-
- if( reply.isValid() ) // TODO: find how a not found service can be expressed in the reply
- {
- const Mollet::NetServiceList serviceDataList = reply.value();
-
- for (const Mollet::NetService& serviceData : serviceDataList) {
- KIO::UDSEntry entry;
- feedEntryAsService( &entry, serviceData );
- listEntry( entry );
- }
- finished();
- successfulListing = true;
- }
- }
- else if( networkUriType == NetworkUri::Service )
- {
- const QString serviceName = networkUri.serviceName();
- const QString serviceType = networkUri.serviceType();
- QDBusReply<Mollet::NetService> reply = mNetworkDBusProxy->serviceData( hostAddress, serviceName, serviceType );
-
- if( reply.isValid() ) // TODO: find how a not found service can be expressed in the reply
- {
- Mollet::NetService serviceData = reply.value();
- if( serviceData.isValid() )
- {
- const QUrl url( serviceData.url() );
- redirection( url );
- finished();
- successfulListing = true;
- }
- }
- }
- }
- }
-
- if( ! successfulListing )
- error( KIO::ERR_DOES_NOT_EXIST, url.toDisplayString() );
-}
-
-
-void NetworkSlave::feedEntryAsNetwork( KIO::UDSEntry* entry )
-{
- entry->reserve(4);
- entry->fastInsert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR );
- entry->fastInsert( KIO::UDSEntry::UDS_DISPLAY_NAME, i18n("Network"));
-// entry->fastInsert( KIO::UDSEntry::UDS_ICON_NAME, NetworkIconName );
- entry->fastInsert( KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String(Mimetypes::NetworkMimetype) );
-#ifdef Q_OS_WIN
- entry->fastInsert( KIO::UDSEntry::UDS_ACCESS, _S_IREAD );
-#else
- entry->fastInsert( KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR );
-#endif
-}
-
-void NetworkSlave::feedEntryAsDevice( KIO::UDSEntry* entry, const Mollet::NetDevice& deviceData )
-{
- entry->reserve(5);
- entry->fastInsert( KIO::UDSEntry::UDS_NAME, deviceData.hostAddress() );
- entry->fastInsert( KIO::UDSEntry::UDS_DISPLAY_NAME, deviceData.name() );
- entry->fastInsert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFDIR );
-#ifdef Q_OS_WIN
- entry->fastInsert( KIO::UDSEntry::UDS_ACCESS, _S_IREAD );
-#else
- entry->fastInsert( KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IXUSR );
-#endif
-// entry->fastInsert( KIO::UDSEntry::UDS_ICON_NAME, NetDevice::iconName(deviceData.type()) );
- entry->fastInsert( KIO::UDSEntry::UDS_MIME_TYPE, QLatin1String(Mimetypes::DeviceMimetype[deviceData.type()]) );
-}
-
-void NetworkSlave::feedEntryAsService( KIO::UDSEntry* entry, const Mollet::NetService& serviceData )
-{
- entry->reserve(7);
- entry->fastInsert( KIO::UDSEntry::UDS_NAME, serviceData.name()+QLatin1Char('.')+serviceData.type() );
- entry->fastInsert( KIO::UDSEntry::UDS_DISPLAY_NAME, serviceData.name() );
- entry->fastInsert( KIO::UDSEntry::UDS_FILE_TYPE, S_IFLNK );
- entry->fastInsert( KIO::UDSEntry::UDS_ACCESS, S_IRWXU|S_IRWXG|S_IRWXO );
- entry->fastInsert( KIO::UDSEntry::UDS_ICON_NAME, serviceData.iconName() );
- entry->fastInsert( KIO::UDSEntry::UDS_MIME_TYPE, Mimetypes::mimetypeForServiceType(serviceData.type()) );
- if( !serviceData.url().isEmpty() )
- entry->fastInsert( KIO::UDSEntry::UDS_TARGET_URL, serviceData.url() );
-}
-
-void NetworkSlave::reportError( const NetworkUri& networkUri, int errorId )
-{
- Q_UNUSED( networkUri )
- Q_UNUSED( errorId )
-}
-
-NetworkSlave::~NetworkSlave()
-{
- delete mNetworkDBusProxy;
-}
diff --git a/network/ioslave/networkslave.h b/network/ioslave/networkslave.h
deleted file mode 100644
index 8e2185ad..00000000
--- a/network/ioslave/networkslave.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORKSLAVE_H
-#define NETWORKSLAVE_H
-
-// KF
-#include <KIO/SlaveBase>
-
-class NetworkDBusInterface;
-class NetworkUri;
-namespace Mollet {
-class NetDevice;
-class NetService;
-}
-namespace KIO {
-class UDSEntry;
-}
-
-class NetworkSlave : public KIO::SlaveBase
-{
-public:
- NetworkSlave( const QByteArray& name, const QByteArray& poolSocket, const QByteArray& programSocket );
- ~NetworkSlave() override;
-
-public: // KIO::SlaveBase API
- void mimetype( const QUrl& url ) override;
- void get( const QUrl& url ) override;
- void stat( const QUrl& url ) override;
- void listDir( const QUrl& url ) override;
-
-private:
- void feedEntryAsNetwork( KIO::UDSEntry* entry );
- void feedEntryAsDevice( KIO::UDSEntry* entry, const Mollet::NetDevice& deviceData );
- void feedEntryAsService( KIO::UDSEntry* entry, const Mollet::NetService& serviceData );
-
- void reportError( const NetworkUri& networkUri, int errorId );
-
-private: // data
- NetworkDBusInterface* mNetworkDBusProxy;
-};
-
-#endif
diff --git a/network/ioslave/networkthread.cpp b/network/ioslave/networkthread.cpp
deleted file mode 100644
index 069a9136..00000000
--- a/network/ioslave/networkthread.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "networkthread.h"
-
-// ioslave
-#include "networkinitwatcher.h"
-// network
-#include "network.h"
-#include "netdevice.h"
-#include "netservice.h"
-//Qt
-#include <QCoreApplication>
-
-#include <QDebug>
-
-NetworkThread::NetworkThread()
- : QThread()
- , mNetwork( nullptr )
- , mContinue( true )
-{
-}
-
-Mollet::Network* NetworkThread::network() const {
- return mNetwork;
-}
-
-void NetworkThread::pause()
-{
- mMutex.lock();
- exit();
-}
-
-
-void NetworkThread::unpause()
-{
- mMutex.unlock();
-}
-
-void NetworkThread::finish()
-{
- mContinue = false;
- exit();
-}
-
-
-void NetworkThread::run()
-{
- mNetwork = Mollet::Network::network();
-
- mMutex.lock();
- new NetworkInitWatcher( mNetwork, &mMutex );
-
- do
- {
- exec();
- mMutex.lock();
- mMutex.unlock();
- }
- while( mContinue );
-}
-
-NetworkThread::~NetworkThread()
-{
-}
diff --git a/network/ioslave/networkthread.h b/network/ioslave/networkthread.h
deleted file mode 100644
index 11f1b65e..00000000
--- a/network/ioslave/networkthread.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORKTHREAD_H
-#define NETWORKTHREAD_H
-
-// Qt
-#include <QThread>
-#include <QMutex>
-
-namespace Mollet {
-class Network;
-}
-
-
-class NetworkThread : public QThread
-{
-public:
- NetworkThread();
- ~NetworkThread() override;
-
-public:
- Mollet::Network* network() const;
-
-public:
- void pause();
- void unpause();
- void finish();
-
-protected: // QThread API
- void run() override;
-
-private:
- QMutex mMutex;
- Mollet::Network* mNetwork;
-
- bool mContinue;
-};
-
-#endif
diff --git a/network/ioslave/networkuri.cpp b/network/ioslave/networkuri.cpp
deleted file mode 100644
index c325f76a..00000000
--- a/network/ioslave/networkuri.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "networkuri.h"
diff --git a/network/ioslave/networkuri.h b/network/ioslave/networkuri.h
deleted file mode 100644
index 234375bb..00000000
--- a/network/ioslave/networkuri.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORKURI_H
-#define NETWORKURI_H
-
-// KF
-#include <QUrl>
-// // Qt
-// #include <QDataStream>
-
-
-// network://domain/hostname/servicename
-class NetworkUri
-{
-// friend QDataStream& operator<<( QDataStream& stream, const NetworkUri& networkUri );
-
-public:
- enum Type { InvalidUrl, Domain, Device, Service };
-public:
- explicit NetworkUri( const QUrl &url );
-
-public:
- const QString& hostAddress() const;
- const QString& serviceName() const;
- const QString& serviceType() const;
- NetworkUri::Type type() const;
-
-private:
-
-private: // data
- QString mHostAddress;
- QString mServiceName;
- QString mServiceType;
-};
-
-
-inline NetworkUri::NetworkUri( const QUrl &url )
-{
- mHostAddress = url.path().mid( 1 );
- const int slashIndex = mHostAddress.indexOf( QLatin1Char('/') );
- if( slashIndex != -1 )
- {
- // servicetype is currently appended as .type to the name
- const int serviceTypeIndex = mHostAddress.lastIndexOf( QLatin1Char('.') ) + 1;
- mServiceType = mHostAddress.mid( serviceTypeIndex );
-
- const int serviceNameLength = (serviceTypeIndex-1) - (slashIndex+1);
- mServiceName = mHostAddress.mid( slashIndex + 1, serviceNameLength );
- mHostAddress.resize( slashIndex );
- }
-}
-
-inline const QString& NetworkUri::hostAddress() const {
- return mHostAddress;
-}
-inline const QString& NetworkUri::serviceName() const {
- return mServiceName;
-}
-inline const QString& NetworkUri::serviceType() const {
- return mServiceType;
-}
-
-inline NetworkUri::Type NetworkUri::type() const
-{
- Type result =
- mHostAddress.isEmpty() ? Domain :
- mServiceName.isEmpty() ? Device :
- /*else*/ Service;
-
- return result;
-}
-
-/*
-inline QDataStream& operator<<( QDataStream& stream, const NetworkUri& networkUri )
-{
- stream << "NetworkUri(host:"<<networkUri.mHostAddress
- << ",service:"<<networkUri.mServiceName
- << ",type:"<<static_cast<int>(networkUri.type())<<")";
- return stream;
-}
-*/
-
-#endif
diff --git a/network/ioslave/virtualfolder_network.desktop b/network/ioslave/virtualfolder_network.desktop
deleted file mode 100644
index c5b9ff1b..00000000
--- a/network/ioslave/virtualfolder_network.desktop
+++ /dev/null
@@ -1,103 +0,0 @@
-[Desktop Entry]
-Type=Link
-
-URL=network:/
-
-Icon=network-workgroup
-Name=Network
-Name[af]=Netwerk
-Name[ar]=الشّبكة
-Name[as]=নে'টৱৰ্ক
-Name[be]=Сетка
-Name[be at latin]=Sietka
-Name[bg]=Мрежа
-Name[bn]=নেটওয়ার্ক
-Name[bn_IN]=নেটওয়ার্ক
-Name[br]=Rouedad
-Name[bs]=Mreža
-Name[ca]=Xarxa
-Name[ca at valencia]=Xarxa
-Name[cs]=Síť
-Name[csb]=Séc
-Name[cy]=Rhwydwaith
-Name[da]=Netværk
-Name[de]=Netzwerk
-Name[el]=Δίκτυο
-Name[en_GB]=Network
-Name[eo]=Reto
-Name[es]=Red
-Name[et]=Võrk
-Name[eu]=Sarea
-Name[fa]=شبکه
-Name[fi]=Verkko
-Name[fr]=Réseau
-Name[fy]=Netwurk
-Name[ga]=Líonra
-Name[gl]=Rede
-Name[gu]=નેટવર્ક
-Name[he]=רשת
-Name[hi]=नेटवर्क
-Name[hne]=नेटवर्क
-Name[hr]=Mreža
-Name[hsb]=Syć
-Name[hu]=Hálózat
-Name[ia]=Rete
-Name[id]=Jaringan
-Name[is]=Netkerfi
-Name[it]=Rete
-Name[ja]=ネットワーク
-Name[ka]=ქსელი
-Name[kk]=Желі
-Name[km]=បណ្ដាញ
-Name[kn]=ಜಾಲ
-Name[ko]=네트워크
-Name[ku]=Tor
-Name[lt]=Tinklas
-Name[lv]=Tīkls
-Name[mai]=नेटवर्क
-Name[mk]=Мрежа
-Name[ml]=ശൃംഖല
-Name[mr]=संजाळ
-Name[ms]=Rangkaian
-Name[nb]=Nettverk
-Name[nds]=Nettwark
-Name[ne]=सञ्जाल
-Name[nl]=Netwerk
-Name[nn]=Nettverk
-Name[oc]=Ret
-Name[or]=ନେଟୱର୍କ
-Name[pa]=ਨੈੱਟਵਰਕ
-Name[pl]=Sieć
-Name[pt]=Rede
-Name[pt_BR]=Rede
-Name[ro]=Rețea
-Name[ru]=Сеть
-Name[se]=Fierbmi
-Name[si]=ජාලය
-Name[sk]=Sieť
-Name[sl]=Omrežje
-Name[sr]=Мрежа
-Name[sr at ijekavian]=Мрежа
-Name[sr at ijekavianlatin]=Mreža
-Name[sr at latin]=Mreža
-Name[sv]=Nätverk
-Name[ta]=பிணையம்
-Name[te]=నెట్ వర్క్
-Name[tg]=Шабакаи Интернет
-Name[th]=เครือข่าย
-Name[tr]=Ağ
-Name[ug]=تور
-Name[uk]=Мережа
-Name[uz]=Tarmoq
-Name[uz at cyrillic]=Тармоқ
-Name[vi]=Mạng
-Name[wa]=Rantoele
-Name[xh]=Umsebenzi womnatha
-Name[x-test]=xxNetworkxx
-Name[zh_CN]=网络
-Name[zh_TW]=網路
-# Comment=
-
-# Open=false
-X-KDE-TreeModule=Directory
-X-KDE-KonqSidebarModule=konqsidebar_tree
diff --git a/network/kded/CMakeLists.txt b/network/kded/CMakeLists.txt
deleted file mode 100644
index dd50cccb..00000000
--- a/network/kded/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-add_library(kded_networkwatcher MODULE)
-
-set_target_properties(kded_networkwatcher PROPERTIES OUTPUT_NAME networkwatcher)
-kcoreaddons_desktop_to_json(kded_networkwatcher networkwatcher.desktop)
-
-set(kded_networkwatcher_dbus_SRCS)
-qt5_add_dbus_adaptor(kded_networkwatcher_dbus_SRCS org.kde.network.kioslavenotifier.xml kioslavenotifier.h Mollet::KioSlaveNotifier)
-
-target_sources(kded_networkwatcher PRIVATE
- networkdbusadaptor.cpp
- kioslavenotifier.cpp
- networkwatcher.cpp
- ${kded_networkwatcher_dbus_SRCS}
-)
-
-target_include_directories(kded_networkwatcher PRIVATE
- ../ioslave
-)
-
-target_link_libraries(kded_networkwatcher PRIVATE
- molletnetwork5
- KF5::DBusAddons
- KF5::KIOCore
-)
-
-install( TARGETS kded_networkwatcher DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kded )
-
-install( FILES org.kde.network.kioslavenotifier.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} RENAME kf5_org.kde.network.kioslavenotifier.xml )
diff --git a/network/kded/kioslavenotifier.cpp b/network/kded/kioslavenotifier.cpp
deleted file mode 100644
index 46f6495d..00000000
--- a/network/kded/kioslavenotifier.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "kioslavenotifier.h"
-
-// module
-#include "kioslavenotifieradaptor.h"
-// kioslave
-#include <networkuri.h>
-// network
-#include <network.h>
-#include <netdevice.h>
-#include <netservice.h>
-// KF
-#include <KDirNotify>
-// Qt
-#include <QStringList>
-
-#include <QDebug>
-
-
-namespace Mollet
-{
-
-static inline QString idFrom( const NetworkUri& networkUri )
-{
- return networkUri.hostAddress().isEmpty() ? QString() :
- networkUri.serviceName().isEmpty() ? networkUri.hostAddress() :
- /*else*/ networkUri.hostAddress()+QLatin1Char('/')+networkUri.serviceName();
-}
-
-static inline QString dirIdFor( const NetDevice& device )
-{
- Q_UNUSED( device )
- return QString();
-}
-static inline QString pathFor( const NetDevice& device )
-{
- return device.hostAddress();
-}
-
-static inline QString dirIdFor( const NetService& service )
-{
- return service.device().hostAddress();
-}
-
-static inline QString pathFor( const NetService& service )
-{
- return service.device().hostAddress() + QLatin1Char('/') + service.name()+QLatin1Char('.')+service.type();
-}
-
-
-KioSlaveNotifier::KioSlaveNotifier( Network* network, QObject* parent )
- : QObject( parent )
-{
- QDBusConnection sessionBus = QDBusConnection::sessionBus();
- const QString allServices;
- const QString allPaths;
- const QString interface = QLatin1String( "org.kde.KDirNotify" );
- sessionBus.connect( allServices, allPaths, interface, QLatin1String("enteredDirectory"),
- this, SLOT(onDirectoryEntered(QString)) );
- sessionBus.connect( allServices, allPaths, interface, QLatin1String("leftDirectory"),
- this, SLOT(onDirectoryLeft(QString)) );
-
- new KioSlaveNotifierAdaptor( this );
-
- connect( network, SIGNAL(devicesAdded(QList<NetDevice>)), SLOT(onDevicesAdded(QList<NetDevice>)) );
- connect( network, SIGNAL(devicesRemoved(QList<NetDevice>)), SLOT(onDevicesRemoved(QList<NetDevice>)) );
- connect( network, SIGNAL(servicesAdded(QList<NetService>)), SLOT(onServicesAdded(QList<NetService>)) );
- connect( network, SIGNAL(servicesRemoved(QList<NetService>)), SLOT(onServicesRemoved(QList<NetService>)) );
-}
-
-QStringList KioSlaveNotifier::watchedDirectories() const
-{
- return mWatchedDirs.keys();
-}
-
-
-void KioSlaveNotifier::onDirectoryEntered( const QString& directory )
-{
- if( !directory.startsWith(QLatin1String("network:/")) )
- return;
-
- const NetworkUri networkUri(( QUrl(directory) ));
- const QString id = idFrom( networkUri );
-
- QHash<QString, int>::Iterator it = mWatchedDirs.find( id );
-
- if( it == mWatchedDirs.end() )
- {
- mWatchedDirs.insert( id, 1 );
- }
- else
- (*it)++;
-}
-
-
-void KioSlaveNotifier::onDirectoryLeft( const QString& directory )
-{
- if( !directory.startsWith(QLatin1String("network:/")) )
- return;
-
- const NetworkUri networkUri(( QUrl(directory) ));
- const QString id = idFrom( networkUri );
-
- QHash<QString, int>::Iterator it = mWatchedDirs.find( id );
-
- if( it == mWatchedDirs.end() )
- return;
-
- if( *it == 1 )
- mWatchedDirs.erase( it );
- else
- (*it)--;
-}
-
-
-void KioSlaveNotifier::notifyAboutAdded( const QString& dirId )
-{
- QHash<QString, int>::Iterator it = mWatchedDirs.find( dirId );
- if( it != mWatchedDirs.end() )
- {
- const QUrl url( QLatin1String("network:/") + dirId );
- org::kde::KDirNotify::emitFilesAdded( url );
- }
-}
-
-void KioSlaveNotifier::notifyAboutRemoved( const QString& dirId, const QString& itemPath )
-{
- QHash<QString, int>::Iterator it = mWatchedDirs.find( dirId );
- if( it != mWatchedDirs.end() )
- {
- QList<QUrl> itemUrls;
- itemUrls.append( QUrl( QStringLiteral("network:/") + itemPath ) );
- org::kde::KDirNotify::emitFilesRemoved( itemUrls );
- }
-}
-
-
-void KioSlaveNotifier::onDevicesAdded( const QList<NetDevice>& deviceList )
-{
- for (const NetDevice& device : deviceList) {
- const QString id = dirIdFor( device );
- notifyAboutAdded( id );
- }
-}
-
-void KioSlaveNotifier::onDevicesRemoved( const QList<NetDevice>& deviceList )
-{
- for (const NetDevice& device : deviceList) {
- const QString dirId = dirIdFor( device );
- const QString itemPath = pathFor( device );
- notifyAboutRemoved( dirId, itemPath );
- }
-}
-
-
-void KioSlaveNotifier::onServicesAdded( const QList<NetService>& serviceList )
-{
- for (const NetService& service : serviceList) {
- const QString id = dirIdFor( service );
- notifyAboutAdded( id );
- }
-}
-
-
-void KioSlaveNotifier::onServicesRemoved( const QList<NetService>& serviceList )
-{
- for (const NetService& service : serviceList) {
- const QString dirId = dirIdFor( service );
- const QString itemPath = pathFor( service );
- notifyAboutRemoved( dirId, itemPath );
- }
-}
-
-KioSlaveNotifier::~KioSlaveNotifier()
-{
-}
-
-}
diff --git a/network/kded/kioslavenotifier.h b/network/kded/kioslavenotifier.h
deleted file mode 100644
index 1e3fe625..00000000
--- a/network/kded/kioslavenotifier.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef KIOSLAVENOTIFIER_H
-#define KIOSLAVENOTIFIER_H
-
-// Qt
-#include <QHash>
-#include <QObject>
-
-namespace Mollet
-{
-
-class Network;
-class NetDevice;
-class NetService;
-
-
-class KioSlaveNotifier : public QObject
-{
- Q_OBJECT
-
-public:
- explicit KioSlaveNotifier( Network* network, QObject* parent = nullptr );
- ~KioSlaveNotifier() override;
-
-public: // for debugging, remove also from adaptor.xml
- QStringList watchedDirectories() const;
-
-public Q_SLOTS:
- void onDirectoryEntered( const QString& directory );
- void onDirectoryLeft( const QString& directory );
-
-private:
- void notifyAboutAdded( const QString& dirId );
- void notifyAboutRemoved( const QString& dirId, const QString& itemPath );
-
-private Q_SLOTS:
- void onDevicesAdded( const QList<NetDevice>& deviceList );
- void onDevicesRemoved( const QList<NetDevice>& deviceList );
- void onServicesAdded( const QList<NetService>& serviceList );
- void onServicesRemoved( const QList<NetService>& serviceList );
-
-private:
- QHash<QString, int> mWatchedDirs;
-};
-
-}
-
-#endif
diff --git a/network/kded/networkdbusadaptor.cpp b/network/kded/networkdbusadaptor.cpp
deleted file mode 100644
index 30ef6114..00000000
--- a/network/kded/networkdbusadaptor.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "networkdbusadaptor.h"
-
-// network
-#include <networkdbus.h>
-// Qt
-#include <QDBusMetaType>
-
-
-namespace Mollet
-{
-
-NetworkDBusAdaptor::NetworkDBusAdaptor( NetworkWatcher* parent )
- : QDBusAbstractAdaptor( parent )
-{
- // TODO: best place to do this?
- qDBusRegisterMetaType<Mollet::NetDevice>();
- qDBusRegisterMetaType<Mollet::NetService>();
- qDBusRegisterMetaType<Mollet::NetDeviceList>();
- qDBusRegisterMetaType<Mollet::NetServiceList>();
-}
-
-NetDevice NetworkDBusAdaptor::deviceData( const QString& hostAddress )
-{
- return parent()->deviceData( hostAddress );
-}
-NetService NetworkDBusAdaptor::serviceData( const QString& hostAddress, const QString& serviceName, const QString& serviceType )
-{
- return parent()->serviceData( hostAddress, serviceName, serviceType );
-}
-NetDeviceList NetworkDBusAdaptor::deviceDataList()
-{
- return parent()->deviceDataList();
-}
-NetServiceList NetworkDBusAdaptor::serviceDataList( const QString& hostAddress )
-{
- return parent()->serviceDataList( hostAddress );
-}
-
-NetworkDBusAdaptor::~NetworkDBusAdaptor()
-{
-}
-
-}
diff --git a/network/kded/networkdbusadaptor.h b/network/kded/networkdbusadaptor.h
deleted file mode 100644
index f4c61548..00000000
--- a/network/kded/networkdbusadaptor.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORKDBUSADAPTOR_H
-#define NETWORKDBUSADAPTOR_H
-
-// kded
-#include "networkwatcher.h"
-//
-#include <networkdbus.h>
-// Qt
-#include <QObject>
-#include <QDBusAbstractAdaptor>
-
-
-namespace Mollet
-{
-
-// TODO: see file networkdbus.h
-class NetworkDBusAdaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "org.kde.network")
-
-public:
- explicit NetworkDBusAdaptor( NetworkWatcher* parent );
- ~NetworkDBusAdaptor() override;
-
-public:
- NetworkWatcher* parent() const;
-
-public Q_SLOTS:
- Mollet::NetDevice deviceData( const QString& hostAddress );
- Mollet::NetService serviceData( const QString& hostAddress, const QString& serviceName, const QString& serviceType );
- Mollet::NetDeviceList deviceDataList();
- Mollet::NetServiceList serviceDataList( const QString& hostAddress );
-};
-
-
-inline NetworkWatcher* NetworkDBusAdaptor::parent() const {
- return static_cast<NetworkWatcher*>( QObject::parent() );
-}
-
-}
-
-#endif
diff --git a/network/kded/networkwatcher.cpp b/network/kded/networkwatcher.cpp
deleted file mode 100644
index 2768a559..00000000
--- a/network/kded/networkwatcher.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "networkwatcher.h"
-
-// module
-#include "networkdbusadaptor.h"
-#include "kioslavenotifier.h"
-// network
-#include <network.h>
-// KF
-#include <KPluginFactory>
-// Qt
-#include <QDBusConnection>
-
-namespace Mollet
-{
-
-K_PLUGIN_CLASS_WITH_JSON(NetworkWatcher, "networkwatcher.json")
-
-NetworkWatcher::NetworkWatcher( QObject* parent, const QList<QVariant>& parameters )
- : KDEDModule( parent )
-{
- Q_UNUSED( parameters )
- mNetwork = Network::network();
-
- new KioSlaveNotifier( mNetwork );
-
- new NetworkDBusAdaptor( this );
- QDBusConnection::sessionBus().registerService( QString::fromLatin1("org.kde.kded5") );
- QDBusConnection::sessionBus().registerObject( QString::fromLatin1("/modules/networkwatcher"), this );
-}
-
-// TODO: instead use networkuri and return QVariant for all these
-NetDevice NetworkWatcher::deviceData( const QString& hostAddress )
-{
- NetDevice result;
-
- const QList<NetDevice> deviceList = mNetwork->deviceList();
- for (const NetDevice& device : deviceList) {
- if( device.hostAddress() == hostAddress )
- {
- result = device;
- break;
- }
- }
-
- return result;
-}
-
-NetService NetworkWatcher::serviceData( const QString& hostAddress, const QString& serviceName, const QString& serviceType )
-{
- NetService result;
-
- const QList<NetDevice> deviceList = mNetwork->deviceList();
- for (const NetDevice& device : deviceList) {
- if( device.hostAddress() == hostAddress )
- {
- const QList<NetService> serviceList = device.serviceList();
-
- for (const NetService& service : serviceList) {
- if( service.name() == serviceName && service.type() == serviceType )
- {
- result = service;
- break;
- }
- }
- break;
- }
- }
-
- return result;
-}
-
-NetDeviceList NetworkWatcher::deviceDataList()
-{
- return mNetwork->deviceList();
-}
-
-NetServiceList NetworkWatcher::serviceDataList( const QString& hostAddress )
-{
- NetServiceList result;
-
- const QList<NetDevice> deviceList = mNetwork->deviceList();
- for (const NetDevice& device : deviceList) {
- if( device.hostAddress() == hostAddress )
- {
- result = device.serviceList();
- break;
- }
- }
-
- return result;
-}
-
-NetworkWatcher::~NetworkWatcher()
-{
-}
-
-}
-
-#include "networkwatcher.moc"
diff --git a/network/kded/networkwatcher.desktop b/network/kded/networkwatcher.desktop
deleted file mode 100644
index 66f19000..00000000
--- a/network/kded/networkwatcher.desktop
+++ /dev/null
@@ -1,145 +0,0 @@
-[Desktop Entry]
-Type=Service
-X-KDE-ServiceTypes=KDEDModule
-X-KDE-Library=networkwatcher
-X-KDE-Kded-autoload=false
-X-KDE-Kded-load-on-demand=true
-Name=Network Watcher
-Name[ar]=مراقب الشّبكة
-Name[bg]=Наблюдение на мрежата
-Name[bn]=নেটওয়ার্ক ওয়াচার
-Name[bs]=Nadzornik mreže
-Name[ca]=Vigilant de la xarxa
-Name[ca at valencia]=Vigilant de la xarxa
-Name[cs]=Sledování sítě
-Name[csb]=Dozérôcz sécë
-Name[da]=Netværksovervåger
-Name[de]=Netzwerküberwachung
-Name[el]=Επόπτης δικτύων
-Name[en_GB]=Network Watcher
-Name[eo]=Kontrolilo de reto
-Name[es]=Observador de redes
-Name[et]=Võrgujälgija
-Name[eu]=Sare-behatzailea
-Name[fa]=دیدهبان شبکه
-Name[fi]=Verkkotilan valvoja
-Name[fr]=Surveillance du réseau
-Name[fy]=Netwurk sjogger
-Name[ga]=Fairtheoir Líonra
-Name[gl]=Vixilante da rede
-Name[gu]=નેટવર્ક દેખરેખ
-Name[he]=מנטר הרשת
-Name[hi]=नेटवर्क चौकीदार
-Name[hr]=Nadzornik mreže
-Name[hu]=Hálózatfigyelő
-Name[ia]=Observator de Rete
-Name[id]=Pengawas Jaringan
-Name[is]=Netskoðunartól
-Name[it]=Guardia di rete
-Name[ja]=ネットワークウォッチゃ
-Name[kk]=Желі бақылауышы
-Name[km]=កម្មវិធីមើលបណ្ដាញ
-Name[kn]=ಜಾಲಬಂಧ ನೋಡುಗ(ವಾಚರ್)
-Name[ko]=네트워크 모니터
-Name[lt]=Tinklo stebėtojas
-Name[lv]=Tīkla novērotājs
-Name[mai]=नेटवर्क वाचर
-Name[mk]=Анализатор на мрежи
-Name[ml]=ശൃംഖല നിരീക്ഷകന്
-Name[mr]=संजाळ नोंदकर्ता
-Name[nb]=Nettverksovervåker
-Name[nds]=Nettwark-Kieker
-Name[nl]=Netwerkbewaker
-Name[nn]=Nettverksovervakar
-Name[pa]=ਨੈੱਟਵਰਕ ਵਾਂਚਰ
-Name[pl]=Analizator sieci
-Name[pt]=Vigilante da Rede
-Name[pt_BR]=Monitor de rede
-Name[ro]=Supraveghetor rețea
-Name[ru]=Слежение за сетевыми папками
-Name[si]=ජාල විශ්ලේෂකය
-Name[sk]=Sledovanie siete
-Name[sl]=Opazovalnik omrežja
-Name[sr]=Надзорник мреже
-Name[sr at ijekavian]=Надзорник мреже
-Name[sr at ijekavianlatin]=Nadzornik mreže
-Name[sr at latin]=Nadzornik mreže
-Name[sv]=Nätverksövervakare
-Name[tg]=Нигаҳбони шабакаи Интернет
-Name[th]=เครื่องมือสอดส่องเครือข่าย
-Name[tr]=Ağ İzleyici
-Name[ug]=تور كۆزەتچى
-Name[uk]=Наглядач мережі
-Name[vi]=Trình theo dõi mạng
-Name[wa]=Waiteu d' rantoele
-Name[x-test]=xxNetwork Watcherxx
-Name[zh_CN]=网络文件系统监视程序
-Name[zh_TW]=網路監控器
-Comment=Keeps track of the network and updates directory listings of the network:/ protocol
-Comment[bg]=Наблюдение на мрежата и обновяване на съответните списъци на мрежовия протокол
-Comment[bn]=নেটওয়ার্ক-এর ওপর লক্ষ্য রাখে এবং প্রয়োজনমত network:/ প্রোটোকল-এর ডিরেক্টরি তালিকা আপডেট করে
-Comment[bs]=Prati mrežu i ažurira ispise fascikli protokola network:/
-Comment[ca]=Fa un seguiment de la xarxa i actualitza els llistats de directoris del protocol network:/
-Comment[ca at valencia]=Fa un seguiment de la xarxa i actualitza els llistats de directoris del protocol network:/
-Comment[cs]=Udržuje přehled o síti a aktualizuje výpisy adresářů protokolu network:/
-Comment[csb]=Dozérô sécë ë aktualizëje wëskrzënianié katalogów sécë:/ protocol
-Comment[da]=Holder øje med netværket og opdaterer mappelister for protokollen network:/
-Comment[de]=Überwacht das Netzwerk und aktualisiert Ordnerauflistungen des Protokolls „network:/“
-Comment[el]=Καταγραφή του δικτύου και ενημέρωση της λίστας των φακέλων του δικτύου:/πρωτόκολλο
-Comment[en_GB]=Keeps track of the network and updates directory listings of the network:/ protocol
-Comment[eo]=Ĝi konservas spuron de la reto kaj ĝisdatigas liston de dosierujoj de la protokolo network:/
-Comment[es]=Sigue la pista de la red y actualiza los listados de directorios del protocolo network:/
-Comment[et]=Hoiab võrgul silma peal ja uuendab protokolli network:/ kataloogide nimekirja
-Comment[eu]=Sarearen segimendua egiten du eta network:/ protokoloaren direktorio-zerrendak eguneratzen ditu
-Comment[fa]=شبکه را میپاید و سیاههی پوشههای شبکه روبرو را به روز میکند:/ protocol
-Comment[fi]=Pitää kirjaa verkosta ja päivittää network:/-yhteyskäytännön kansioluettelot
-Comment[fr]=Conserve des enregistrements du réseau et met à jour les contenus des dossiers pour le protocole « network:/ »
-Comment[fy]=Hâld de netwurk en fernijings triemtafel listen fan it network:/ protocol yn de gaten
-Comment[ga]=Coimeádann sé cuntas ar an líonra agus nuashonraíonn comhadlanna den phrótacal network:/
-Comment[gl]=Segue a rede e actualiza as listas de directorios do protocolo network:/
-Comment[gu]=નેટવર્કની દેખરેખ રાખે છે અને network:/ પ્રોટોકોલની ડિરેક્ટરી યાદીઓ સુધારે છે
-Comment[he]=משמש למעקב אחר הרשת ולעידכון של רשימת התיקיות בפרוטוקול network:/
-Comment[hi]=संजाल की जानकारी रखता है और संजाल के निर्देशिका सूचियाँ का अद्यतन करता है:/ protocol
-Comment[hr]=Pazi na mrežu i ažurira popis direktorija protokola network:/
-Comment[hu]=Figyeli a hálózat állapotát és frissíti a mappalistákat a network:/ protokollal
-Comment[ia]=Il mantene tracia del rete e il actualisa listas de directorio de le rete:/protocollo
-Comment[id]=Pemantauan jaringan dan pembaruan pendaftaran direktori dari jaringan/protokol
-Comment[is]=Fylgist með netvirkni og uppfærir möppubreytingar með network:/ samskiptareglunni
-Comment[it]=Tiene traccia della rete e aggiorna la lista delle cartelle del protocollo network:/
-Comment[ja]=ネットワークのトラックを保持し、network:/ プロトコルのディレクトリリスティングを更新します
-Comment[kk]=Желіке бақылап отырып network:/ протоколы тізімдерінің қапшығын жаңартып отырады
-Comment[km]=តាមដានបណ្ដាញ និងធ្វើបច្ចុប្បន្នភាពថត ដោយរាយពិធីការ network:/
-Comment[ko]=네트워크의 변경 사항을 추적하며 network:/ 프로토콜의 디렉터리 목록을 업데이트합니다
-Comment[lt]=Seka tinklą ir atnaujina network:/ protokolo katalogų sąrašą
-Comment[lv]=Seko līdzi tīkam un atjaunina network:/ protokola mapju sarakstus
-Comment[mk]=Ја следи мрежата и ги ажурира приказите на папки од протоколот network:/
-Comment[ml]=network:/ പ്രോട്ടോകോളില് ശൃംഖലയുടേയും തട്ടുകളുടെ പട്ടികകളേയും നിരീക്ഷിയ്ക്കുന്നു
-Comment[mr]=संजाळावर लक्ष ठेउन त्यातील संचयीका यादी अद्ययावत ठेवतो
-Comment[nb]=Holder øye med nettverket og oppdaterer katalogoppføringer for protokollen network:/
-Comment[nds]=Beluert dat Nettwark un frischt Orner-Oplisten vun't network:/-Protokoll op
-Comment[nl]=Bewaakt het netwerk en actualiseert de mappenweergave van het network:/ protocol
-Comment[nn]=Held auge med nettverket og oppdaterer kataloglistene i network:/-protokollen
-Comment[pa]=network:/ ਪਰੋਟੋਕਾਲ ਰਾਹੀਂ ਦਿੱਤੀਆਂ ਡਾਇਰੈਕਟਰੀਆਂ ਤੇ ਨੈੱਟਵਰਕ ਬਾਰੀ ਜਾਣਕਾਰੀ ਰੱਖੋ
-Comment[pl]=Śledzi sieć i uaktualnia zawartości katalogów dla protokołu network:/
-Comment[pt]=Mantém um registo da rede e actualiza as listagens de pastas no protocolo 'network:/'
-Comment[pt_BR]=Monitora a rede e atualiza a listagem de pastas do protocolo network:/
-Comment[ro]=Duce evidența rețelei și actualizează conținutul dosarelor protocolului network:/
-Comment[ru]=Поиск служб и обновление содержимого каталогов по протоколу network:/
-Comment[si]=ජාලය හා ජාලයේ:/ ක්රියාපටිපාටියේ යාවත්කාලීනබහාළුම් ලැයිස්තුගත කිරීමගැන විමසිල්ලෙන් සිටින්න
-Comment[sk]=Udržuje prehľad o sieti a aktualizuje výpisy adresárov protokolu network:/
-Comment[sl]=Sledi omrežju in posodablja seznam map za network:/ protokol
-Comment[sr]=Прати мрежу и ажурира исписе фасцикли протокола network:/
-Comment[sr at ijekavian]=Прати мрежу и ажурира исписе фасцикли протокола network:/
-Comment[sr at ijekavianlatin]=Prati mrežu i ažurira ispise fascikli protokola network:/
-Comment[sr at latin]=Prati mrežu i ažurira ispise fascikli protokola network:/
-Comment[sv]=Håller reda på nätverket och uppdaterar kataloglistningar för protokollet network:/
-Comment[tg]=Фаъолияти шабакаи Интернетро қайд мекунад ва мазмуни феҳрасти шабакаро навсозӣ мекунад:/ қарордод
-Comment[th]=คอยติดตามการปรับปรุงของเครือข่าย และการปรับปรุงของไดเรกทอรีผ่านโพรโทคอล network:/
-Comment[tr]=Ağı ve network:/ protokolündeki dizin güncellemelerini izler
-Comment[ug]=ئىزلاش تورى ۋە network:/ كېلىشىمى كۆرسەتكەن مۇندەرىجىنىڭ يېڭىلىنىش ئەھۋالى
-Comment[uk]=Стежить за мережею і оновлює списки каталогів протоколу network:/
-Comment[vi]=Theo dõi mạng và cập nhật danh sách thư mục trong giao thức network://
-Comment[wa]=Wåde ene trace des djivêyes des ridants del rantoele et des metaedjes a djoû do protocole network:/
-Comment[x-test]=xxKeeps track of the network and updates directory listings of the network:/ protocolxx
-Comment[zh_CN]=监视网络文件系统变化,更新 network:/ 协议列出的目录
-Comment[zh_TW]=保持追蹤此網路,並更新 network:/ 協定中的目錄清單
diff --git a/network/kded/networkwatcher.h b/network/kded/networkwatcher.h
deleted file mode 100644
index 55a19e3a..00000000
--- a/network/kded/networkwatcher.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- This file is part of the network kioslave, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORKWATCHER_H
-#define NETWORKWATCHER_H
-
-// KF
-#include <KDEDModule>
-
-namespace Mollet
-{
-class Network;
-class NetDevice;
-class NetService;
-typedef QList<NetDevice> NetDeviceList;
-typedef QList<NetService> NetServiceList;
-
-
-class NetworkWatcher : public KDEDModule
-{
- Q_OBJECT
-
-public:
- NetworkWatcher( QObject* parent, const QList<QVariant>& parameters );
- ~NetworkWatcher() override;
-
-public:
- Mollet::NetDevice deviceData( const QString& hostAddress );
- Mollet::NetService serviceData( const QString& hostAddress, const QString& serviceName, const QString& serviceType );
- Mollet::NetDeviceList deviceDataList();
- Mollet::NetServiceList serviceDataList( const QString& hostAddress );
-
-private:
- Network* mNetwork;
-};
-
-}
-
-#endif
diff --git a/network/kded/org.kde.network.kioslavenotifier.xml b/network/kded/org.kde.network.kioslavenotifier.xml
deleted file mode 100644
index 5d85c1e8..00000000
--- a/network/kded/org.kde.network.kioslavenotifier.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
- <interface name="org.kde.network.KioSlaveNotifier">
- <method name="watchedDirectories">
- <arg type="as" direction="out"/>
- </method>
- <method name="onDirectoryEntered">
- <arg name="dir" type="s" direction="in"/>
- </method>
- <method name="onDirectoryLeft">
- <arg name="dir" type="s" direction="in"/>
- </method>
- </interface>
-</node>
diff --git a/network/kded/org.kde.network.xml b/network/kded/org.kde.network.xml
deleted file mode 100644
index 17c644cf..00000000
--- a/network/kded/org.kde.network.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node>
- <interface name="org.kde.network">
- <method name="service">
- <arg type="ay" direction="out"/>
- <arg name="hostName" type="s" direction="in"/>
- <arg name="serviceName" type="s" direction="in"/>
- <arg name="type" type="i" direction="in"/>
- </method>
- </interface>
-</node>
diff --git a/network/mimetypes/CMakeLists.txt b/network/mimetypes/CMakeLists.txt
deleted file mode 100644
index 4d7368b7..00000000
--- a/network/mimetypes/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# shared-mime-info 0.40 is mandatory for generic-icon
-set( SHARED_MIME_INFO_MINIMUM_VERSION "0.40" )
-find_package( SharedMimeInfo REQUIRED )
-
-install( FILES network.xml DESTINATION ${KDE_INSTALL_MIMEDIR} RENAME kf5_network.xml )
-update_xdg_mimetypes( ${KDE_INSTALL_MIMEDIR} )
diff --git a/network/mimetypes/network.xml b/network/mimetypes/network.xml
deleted file mode 100644
index f64bc862..00000000
--- a/network/mimetypes/network.xml
+++ /dev/null
@@ -1,499 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-It comes with ABSOLUTELY NO WARRANTY, to the extent permitted by law. You may
-redistribute copies of update-mime-database under the terms of the GNU General
-Public License. For more information about these matters, see the file named
-COPYING.
--->
-<!--
-Notes:
-- the mime types in this file are valid with the version 0.23 of the
- shared-mime-info package.
-- the "fdo #xxxxx" are the wish in the freedesktop.org bug database to include
- the mime type there.
--->
-<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
- <mime-type type="inode/vnd.kde.network">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="network-workgroup"/>
- <comment>Network</comment>
- </mime-type>
-
- <!-- Devices -->
- <mime-type type="inode/vnd.kde.device.workstation">
- <sub-class-of type="inode/directory"/>
- <comment>Workstation</comment>
- <generic-icon name="computer"/>
- </mime-type>
- <mime-type type="inode/vnd.kde.device.router">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="network-server"/>
- <comment>Router</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.device.server">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="network-server"/>
- <comment>Server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.device.printer">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="printer"/>
- <comment>Printer</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.device.scanner">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="scanner"/>
- <comment>Scanner</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.device.unknown">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="network-server"/>
- <comment>Unknown device</comment>
- </mime-type>
-
-
-
- <!-- Services -->
- <mime-type type="inode/vnd.kde.service.unknown">
- <generic-icon name="document"/>
- <comment>Unknown service</comment>
- </mime-type>
-
- <!-- File services -->
- <!-- TODO: find why a generic service.filesystem does not forward its generic-icon -->
- <mime-type type="inode/vnd.kde.service.ftp">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="folder-remote"/>
- <comment>FTP server</comment>
- <acronym>FTP</acronym>
- <expanded-acronym>File transfer protocol</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.sftp-ssh">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="folder-remote"/>
- <comment>SFTP (ssh) server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.ftps">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="folder-remote"/>
- <comment>FTPS server</comment>
- <acronym>FTPS</acronym>
- <expanded-acronym>FTP over SSL</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.nfs">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="folder-remote"/>
- <comment>NFS server</comment>
- <acronym>NFS</acronym>
- <expanded-acronym>Network filesystem</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.afpovertcp">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="folder-remote"/>
- <comment>AFP server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.smb">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="folder-remote"/>
- <comment>SMB server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.webdav">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="folder-remote"/>
- <comment>WebDav server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.webdavs">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="folder-remote"/>
- <comment>WebDav secure server</comment>
- </mime-type>
-
- <mime-type type="inode/vnd.kde.service.svn">
- <sub-class-of type="inode/directory"/>
- <generic-icon name="folder-sync"/>
- <comment>Subversion server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.rsync">
- <generic-icon name="folder-sync"/>
- <comment>RSync server</comment>
- </mime-type>
-
- <!-- email -->
- <mime-type type="inode/vnd.kde.service.pop3">
- <generic-icon name="email"/>
- <comment>POP3 server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.imap">
- <generic-icon name="email"/>
- <comment>IMAP server</comment>
- </mime-type>
-
- <!-- shell services -->
- <mime-type type="inode/vnd.kde.service.ssh">
- <sub-class-of type="inode/symlink"/>
- <generic-icon name="terminal"/>
- <comment>SSH server</comment>
- <acronym>SSH</acronym>
- <expanded-acronym>Secure shell</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.telnet">
- <sub-class-of type="inode/symlink"/>
- <generic-icon name="terminal"/>
- <comment>Telnet server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.rfb">
- <sub-class-of type="inode/symlink"/>
- <generic-icon name="krfb"/>
- <comment>Display server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.rdp">
- <generic-icon name="krfb"/>
- <comment>RDP server</comment>
- </mime-type>
-
- <!-- other standard services -->
- <mime-type type="inode/vnd.kde.service.http">
- <sub-class-of type="inode/symlink"/>
- <generic-icon name="folder-html"/>
- <comment>Web server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.ntp">
- <generic-icon name="xclock"/>
- <comment>Time server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.ldap">
- <generic-icon name="user-group-properties"/>
- <comment>LDAP server</comment>
- </mime-type>
-
- <!-- user2user (chat, collaboration) -->
- <mime-type type="inode/vnd.kde.service.xmpp-server">
- <generic-icon name="xchat"/>
- <comment>XMPP/Jabber server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.presence">
- <generic-icon name="im-user"/>
- <comment>Chat</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.lobby">
- <generic-icon name="document-edit"/>
- <comment>Gobby server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.giver">
- <generic-icon name="folder-remote"/>
- <comment>Giver Peer</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.sip">
- <generic-icon name="phone"/>
- <comment>SIP Telephony</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.h323">
- <generic-icon name="phone"/>
- <comment>H323 Telephony</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.skype">
- <generic-icon name="phone"/>
- <comment>Skype Telephony</comment>
- </mime-type>
-
- <!-- printing -->
- <mime-type type="inode/vnd.kde.service.ipp">
- <generic-icon name="printer"/>
- <comment>Internet Printing</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.printer">
- <generic-icon name="printer"/>
- <comment>Unix Printing</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.pdl-datastream">
- <generic-icon name="printer"/>
- <comment>PDL Printing</comment>
- </mime-type>
-
- <!-- KDE Workspace -->
- <mime-type type="inode/vnd.kde.service.plasma">
- <generic-icon name="plasma"/>
- <comment>Plasma service</comment>
- </mime-type>
-
- <!-- KDE Games -->
- <mime-type type="inode/vnd.kde.service.kbattleship">
- <generic-icon name="kbattleship"/>
- <comment>KBattleship game table</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.lskat">
- <generic-icon name="lskat"/>
- <comment>Lieutenant skat game server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.kfourinline">
- <generic-icon name="kfourinline"/>
- <comment>Four-in-line game table</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.ksirk">
- <generic-icon name="ksirk"/>
- <comment>KSirk game table</comment>
- </mime-type>
-
- <!-- Hardware -->
- <mime-type type="inode/vnd.kde.service.pulse-server">
- <generic-icon name="audio-card"/>
- <comment>Pulse server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.pulse-source">
- <generic-icon name="audio-input-line"/>
- <comment>Pulse source</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.pulse-sink">
- <generic-icon name="speaker"/>
- <comment>Pulse sink</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.udisks-ssh">
- <generic-icon name="drive-harddisk"/>
- <comment>Udisks server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.libvirt">
- <generic-icon name="computer"/>
- <comment>libvirt server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.airmouse">
- <generic-icon name="input-mouse"/>
- <comment>Air Mouse server</comment>
- </mime-type>
-
- <!-- Database -->
- <mime-type type="inode/vnd.kde.service.postgresql">
- <generic-icon name="server-database"/>
- <comment>PostgreSQL server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.couchdb_location">
- <generic-icon name="server-database"/>
- <comment>CouchDB server</comment>
- </mime-type>
-
- <!-- Other -->
- <mime-type type="inode/vnd.kde.service.realplayfavs">
- <generic-icon name="favorites"/>
- <comment>RealPlayer Shared Favorites</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.acrobat-server">
- <generic-icon name="application-pdf"/>
- <comment>Adobe Acrobat server</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.adobe-vc">
- <generic-icon name="services"/>
- <comment>Adobe Version Cue</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.ggz">
- <generic-icon name="applications-games"/>
- <comment>GGZ Server</comment>
- <acronym>GGZ</acronym>
- <expanded-acronym>GGZ Gaming Zone</expanded-acronym>
- </mime-type>
-
- <!-- Maemo -->
- <mime-type type="inode/vnd.kde.service.maemo-inf">
- <generic-icon name="pda"/>
- <comment>Maemo Info</comment>
- </mime-type>
-
- <!-- Apple -->
- <mime-type type="inode/vnd.kde.service.airport">
- <generic-icon name="network-wireless"/>
- <comment>AirPort Base Station</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.daap">
- <generic-icon name="folder-sound"/>
- <comment>Digital Audio Access</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.dacp">
- <generic-icon name="services"/>
- <comment>iTunes Remote Control</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.eppc">
- <generic-icon name="network-connect"/>
- <comment>Remote AppleEvents</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.net-assistant">
- <generic-icon name="services"/>
- <comment>Apple Remote Desktop</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.odisk">
- <generic-icon name="media-optical"/>
- <comment>Optical Disk Sharing</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.raop">
- <generic-icon name="speaker"/>
- <comment>Remote Audio Output</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.touch-able">
- <generic-icon name="input-tablet"/>
- <comment>iPhone and iPod touch Remote Controllable</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.workstation">
- <generic-icon name="network-workgroup"/>
- <comment>Workgroup Manager</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.sleep-proxy">
- <generic-icon name="services"/>
- <comment>Sleep Proxy</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.nssocketport">
- <generic-icon name="services"/>
- <comment>NSSocketPort</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.home-sharing">
- <generic-icon name="services"/>
- <comment>iTunes Home Sharing</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.appletv-itunes">
- <generic-icon name="services"/>
- <comment>Apple TV iTunes discovery</comment>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.appletv-pair">
- <generic-icon name="services"/>
- <comment>Apple TV Pairing</comment>
- </mime-type>
-
- <!-- UPnP -->
- <mime-type type="inode/vnd.kde.service.upnp.Unknown">
- <generic-icon name="device"/>
- <comment>Unknown UPnP Device</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
-
- <mime-type type="inode/vnd.kde.service.upnp.BasicDevice1">
- <generic-icon name="network-server"/>
- <comment>UPnP Basic Device</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.WLANAccessPointDevice1">
- <generic-icon name="network-wireless"/>
- <comment>UPnP WLAN Access Point Device</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.InternetGatewayDevice1">
- <generic-icon name="network-server"/>
- <comment>UPnP Internet Gateway Device</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.PrinterBasic1">
- <generic-icon name="printer"/>
- <comment>UPnP Printer (Basic)</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.PrinterEnhanced1">
- <generic-icon name="printer"/>
- <comment>UPnP Printer (Enhanced)</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.Scanner1">
- <generic-icon name="scanner"/>
- <comment>UPnP Scanner</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.MediaServer1">
- <generic-icon name="folder-remote"/>
- <comment>UPnP Media Server</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.MediaRenderer1">
- <generic-icon name="video-television"/>
- <comment>UPnP Media Renderer</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.MediaServer2">
- <generic-icon name="folder-remote"/>
- <comment>UPnP Media Server</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.MediaRenderer2">
- <generic-icon name="video-television"/>
- <comment>UPnP Media Renderer</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.MediaServer3">
- <generic-icon name="folder-remote"/>
- <comment>UPnP Media Server</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.SolarProtectionBlind1">
- <generic-icon name="device"/>
- <comment>UPnP Solar Protection Blind</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.DigitalSecurityCamera1">
- <generic-icon name="camera"/>
- <comment>UPnP Digital Security Camera</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.HVAC1">
- <generic-icon name="device"/>
- <comment>UPnP HVAC</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- <expanded-acronym>Heating, Ventilating, and Air Conditioning</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.LightingControls1">
- <generic-icon name="light"/>
- <comment>UPnP Lighting Controls</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.RemoteUIClientDevice1">
- <generic-icon name="device"/>
- <comment>UPnP Remote UI Client</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.RemoteUIServerDevice1">
- <generic-icon name="device"/>
- <comment>UPnP Remote UI Server</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.RAClient1">
- <generic-icon name="device"/>
- <comment>UPnP Remote Access Client</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.RAServer1">
- <generic-icon name="device"/>
- <comment>UPnP Remote Access Server</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.RADiscoveryAgent1">
- <generic-icon name="device"/>
- <comment>UPnP Remote Access Discovery Agent</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
-
- <mime-type type="inode/vnd.kde.service.upnp.LANDevice1">
- <generic-icon name="network-wired"/>
- <comment>UPnP LAN Device</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.WANDevice1">
- <generic-icon name="network-wired"/>
- <comment>UPnP WAN Device</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
- <mime-type type="inode/vnd.kde.service.upnp.WANConnectionDevice1">
- <generic-icon name="network-wired"/>
- <comment>UPnP WAN Connection Device</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
-
- <mime-type type="inode/vnd.kde.service.upnp.WFADevice1">
- <generic-icon name="network-wireless"/>
- <comment>UPnP Wi-Fi Alliance Device</comment>
- <expanded-acronym>UPnP Universal Plug and Play</expanded-acronym>
- </mime-type>
-
- <!-- uri/ fake mime types -->
-<!-- <mime-type type="uri/mms">
- <comment>mms: URIs</comment>
- </mime-type>-->
-
- <!-- fonts/ fake mime types -->
-<!-- <mime-type type="application/x-smb-server">
- <sub-class-of type="inode/directory"/>
- <comment>Windows server</comment>
- </mime-type>-->
-
-</mime-info>
diff --git a/network/network/CMakeLists.txt b/network/network/CMakeLists.txt
deleted file mode 100644
index 55c9c626..00000000
--- a/network/network/CMakeLists.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-add_library(molletnetwork5 SHARED)
-
-set_target_properties( molletnetwork5 PROPERTIES
- VERSION ${RELEASE_SERVICE_VERSION}
- SOVERSION ${RELEASE_SERVICE_VERSION_MAJOR}
-)
-
-generate_export_header(molletnetwork5 BASE_NAME molletnetwork)
-
-target_sources(molletnetwork5 PRIVATE
- builder/simpleitemfactory.cpp
-
- builder/dnssd/dnssdnetworkbuilder.cpp
-
- builder/upnp/cagibidevice.cpp
- builder/upnp/cagibidbuscodec.cpp
- builder/upnp/upnpnetworkbuilder.cpp
-
- builder/abstractnetworkbuilder.cpp
- builder/abstractnetsystemfactory.cpp
-
- networkdbus.cpp
-
- network_p.cpp
- network.cpp
- netdevice_p.cpp
- netdevice.cpp
- netservice_p.cpp
- netservice.cpp
-)
-
-target_include_directories(molletnetwork5
- PRIVATE
- builder
-)
-
-target_link_libraries( molletnetwork5
- PUBLIC
- KF5::DNSSD
- Qt5::Network
- Qt5::Gui
- Qt5::DBus
-)
-
-install( TARGETS molletnetwork5 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP )
diff --git a/network/network/README b/network/network/README
deleted file mode 100644
index 5089726c..00000000
--- a/network/network/README
+++ /dev/null
@@ -1,44 +0,0 @@
-How does the network get constructed?
-=============================================
-
-There are two kind of objects:
-a) adapters to the service discovery systems
-b) factories to build network items
-
-Then there are adapter-specific interface for the factories, so a adapter can
-handover its system-specific data to the factory.
-
-The factories understand the data structure the adapters hand over (given they
-implement its interface) and construct the matching network items, e.g. a
-NetDevice or a NetService of a certain type.
-The adapters listen to the discovery systems and on a new item reported by the
-system ask those factories which implemented their interface if they could
-turn that into an object in terms of the network library and then tell them
-to do so if they can.
-
-Examples:
-interface: DNSSDNetSystemAble
-adapter: DNSSDNetworkBuilder
-factory: SimpleItemFactory (only one so far, anyway)
-
-Reasoning for this approach:
-With a plugin system yet to come, one could install a new factory for a
-service type "coffee/tea filling level", which could understand data from two
-or three adapters, so you do not need an extra factory for each adapter, but
-have a central point of competence.
-
-So now for a new backend you would need to do add these things:
-a) NEWNetSystemAble
-b) NEWNetworkBuilder
-c) have SimpleItemFactory implement NEWNetSystemAble
-
-SimpleItemFactory is just, as the name should hint, a simple factory, which
-turns a service description into a plain NetService item, without any
-additional logic or behaviour. Later on it is planned to have factories which can
-create complete proxy objects to services on the network. But that needs some
-more thoughts. Stuff for KDE 4.4, including considering a Solid integration
-
-The device type detection (heuristics based) is currently pretty bogus and
-just works for a certain private network, so do not wonder about that part of
-the code :) It should be really turned of before the 4.3 release and for the time
-given just have one type of device: a device.
diff --git a/network/network/TODO b/network/network/TODO
deleted file mode 100644
index f4f5a8a5..00000000
--- a/network/network/TODO
+++ /dev/null
@@ -1,97 +0,0 @@
-Add backends for
-* Jini
-* UPnP
-* SMB
-* manually added devices/services
- -> means also support for state not-present
-* scanning?
-
-list of dns-ds service types: http://www.dns-sd.org/ServiceTypes.html
-
-See if there could be a xdg database of products with device ontology/categories.
-
-Add a device guesser which tries to estimate the type of device by the services
-(or even with a dedicated protocol if there is one?)
-
-Devices:
-* Fileserver/-storage
-* Webserver
-* Desktop-like Computer (human-interface general purpose)
- * wearable
- * MID
- * Handheld
- * E-Book reader (is media renderer?)
- * Laptop
-* Game server
-* Server
-* Router
-* Internet Gateway Device (IGD)
-* Mediaserver
-* Mediarenderer
-* HVAC
-* Scanner
-* WLAN Access point
-* Digital Security camera
-* Wearable
-* Augmented-reality device (headmounted)
-
-
-Questions:
-What is a (virtual) device, what is a service?
-Aren't all servives virtual devices?
-So present as device or service?
-
-Some devices use services as interface utility (e.g. a http server for SOAP).
-Separate human/computer-usable services?
-Firstlevel service and secondlevel service?
-
-Physical objects should be represented as physical objects. Perhaps mark with flag.
-Which of the virtual machines in a server is the physical one if the vm host doesn't show up?
-
-How to handle unknown devices?
-Who might want to see them? Developers?
-Or users, to see it's there but not supported (=without a driver)?
-There could be a user editable whitelist/blacklist.
-
-Support should be plugin-based, so 3-party developers can easily try to develop their own drivers.
-
-
-There need to be servicetype-specific handlers which can create the service proxy object.
-Should be able to register to different discovery backends (collision handling by priority perhaps).
-For now simple listing with non-funct system items will do.
-
-
- { "_presence._tcp", "presence", "inode/vnd.kde.service.presence", "im-user", false, 0, 0, 0, 0 },
-// presence http://www.xmpp.org/registrar/linklocal.html
-// "1st", firstName, "email", emailAddress, "last", lastName, "status", "avail");
-// TODO: make this first non-simple item, showing addressbook entry
-
- // KDE
- { "_knotes._tcp", "knotes", "inode/vnd.kde.service.knotes", "knotes", false, "http", 0, 0, 0 },
-// TODO: make this second non-simple item, listing notes or enable the drop of ones (forwarding to some knotes: protocol?
-
-
-
-
- QList<NetDevice>& deviceList = mNetworkPrivate->deviceList();
- static const char* DeviceNamen[] =
- {
- "Datensafe.local",
- "Schleuder.local",
- "Phlox.local",
- "buntekuh.local"
- };
- for( int i=0; i<4; ++i )
- {
- const QString hostName( DeviceNamen[i] );
- const QString deviceName = hostName.left( hostName.indexOf('.') );
- NetDevicePrivate* d = new NetDevicePrivate( deviceName, hostName );
- d->setType( NetDevice::Workstation );
-
- NetDevice device( d );
- deviceList.append( device );
-
- QList<NetDevice> newDevices;
- newDevices.append( device );
- mNetworkPrivate->emitDevicesAdded( newDevices );
- }
diff --git a/network/network/builder/abstractnetsystemfactory.cpp b/network/network/builder/abstractnetsystemfactory.cpp
deleted file mode 100644
index 96fe86d6..00000000
--- a/network/network/builder/abstractnetsystemfactory.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "abstractnetsystemfactory.h"
diff --git a/network/network/builder/abstractnetsystemfactory.h b/network/network/builder/abstractnetsystemfactory.h
deleted file mode 100644
index e9d530a9..00000000
--- a/network/network/builder/abstractnetsystemfactory.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef ABSTRACTNETSYSTEMFACTORY_H
-#define ABSTRACTNETSYSTEMFACTORY_H
-
-// Qt
-#include <QObject>
-
-
-namespace Mollet
-{
-
-class AbstractNetSystemFactory : public QObject
-{
- Q_OBJECT
-
-public:
- ~AbstractNetSystemFactory() override;
-
-public: // API to be implemented
-};
-
-
-inline AbstractNetSystemFactory::~AbstractNetSystemFactory() {}
-
-}
-
-#endif
diff --git a/network/network/builder/abstractnetworkbuilder.cpp b/network/network/builder/abstractnetworkbuilder.cpp
deleted file mode 100644
index 8bc5d886..00000000
--- a/network/network/builder/abstractnetworkbuilder.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "abstractnetworkbuilder.h"
diff --git a/network/network/builder/abstractnetworkbuilder.h b/network/network/builder/abstractnetworkbuilder.h
deleted file mode 100644
index 5a05b6e3..00000000
--- a/network/network/builder/abstractnetworkbuilder.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef ABSTRACTNETWORKBUILDER_H
-#define ABSTRACTNETWORKBUILDER_H
-
-// Qt
-#include <QObject>
-
-namespace Mollet
-{
-class AbstractNetSystemFactory;
-
-
-class AbstractNetworkBuilder : public QObject
-{
- Q_OBJECT
-
-public:
- ~AbstractNetworkBuilder() override;
-
-public: // API to be implemented
- // build initial table synch
-// virtual void init() = 0;
- // build initial table asynch
-// virtual void startInit() = 0;
-
- // TODO: how to handle previously found, but unknown (or now-underpriorized) services? ignore and wait for rescan?
- virtual void registerNetSystemFactory( AbstractNetSystemFactory* netSystemFactory ) = 0;
- // temporary solution: have all factories set, then call start
- virtual void start() = 0;
-
-
- // drop all knowledge and restart
-// virtual void rescan()
-// virtual void startRescan()
-
-Q_SIGNALS:
- /** initial structure build */
- void initDone();
-};
-
-
-inline AbstractNetworkBuilder::~AbstractNetworkBuilder() {}
-
-}
-
-#endif
diff --git a/network/network/builder/dnssd/dnssdnetsystemable.h b/network/network/builder/dnssd/dnssdnetsystemable.h
deleted file mode 100644
index df0bc7d3..00000000
--- a/network/network/builder/dnssd/dnssdnetsystemable.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef DNSSDNETSYSTEMABLE_H
-#define DNSSDNETSYSTEMABLE_H
-
-#include <QtGlobal>
-// KF
-#include <kdnssd_version.h>
-#if KDNSSD_VERSION >= QT_VERSION_CHECK(5, 84, 0)
-#include <KDNSSD/RemoteService>
-#else
-#include <DNSSD/RemoteService>
-#endif
-
-
-// Qt
-#include <QtPlugin>
-
-namespace Mollet {
-class NetServicePrivate;
-class NetDevice;
-}
-class QString;
-
-
-namespace Mollet
-{
-
-class DNSSDNetSystemAble
-{
-public:
- virtual ~DNSSDNetSystemAble();
-
-public: // API to be implemented
- virtual bool canCreateNetSystemFromDNSSD( const QString& serviceType ) const = 0;
- virtual NetServicePrivate* createNetService( const KDNSSD::RemoteService::Ptr& service, const NetDevice& device ) const = 0;
- virtual QString dnssdId( const KDNSSD::RemoteService::Ptr& dnssdService ) const = 0;
-};
-
-
-inline DNSSDNetSystemAble::~DNSSDNetSystemAble() {}
-
-}
-
-Q_DECLARE_INTERFACE( Mollet::DNSSDNetSystemAble, "org.kde.mollet.dnssdnetsystemable/1.0" )
-
-#endif
diff --git a/network/network/builder/dnssd/dnssdnetworkbuilder.cpp b/network/network/builder/dnssd/dnssdnetworkbuilder.cpp
deleted file mode 100644
index b3d66dc0..00000000
--- a/network/network/builder/dnssd/dnssdnetworkbuilder.cpp
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009-2010 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "dnssdnetworkbuilder.h"
-
-// lib
-#include "dnssdnetsystemable.h"
-#include "abstractnetsystemfactory.h"
-#include "network_p.h"
-#include "netdevice_p.h"
-// KF
-#include <kdnssd_version.h>
-#if KDNSSD_VERSION >= QT_VERSION_CHECK(5, 84, 0)
-#include <KDNSSD/ServiceTypeBrowser>
-#include <KDNSSD/ServiceBrowser>
-#else
-#include <DNSSD/ServiceTypeBrowser>
-#include <DNSSD/ServiceBrowser>
-#endif
-
-
-// Qt
-#include <QHostAddress>
-#include <QMutableListIterator>
-
-#include <QDebug>
-
-
-namespace Mollet
-{
-
-DNSSDNetworkBuilder::DNSSDNetworkBuilder( NetworkPrivate* networkPrivate )
- : AbstractNetworkBuilder()
- , mNetworkPrivate( networkPrivate )
- , mServiceTypeBrowser( nullptr )
-{
-}
-
-
-void DNSSDNetworkBuilder::registerNetSystemFactory( AbstractNetSystemFactory* netSystemFactory )
-{
- DNSSDNetSystemAble* dnssdNetSystemAble = qobject_cast<DNSSDNetSystemAble*>( netSystemFactory );
-
- if( dnssdNetSystemAble )
- mNetSystemFactoryList.append( dnssdNetSystemAble );
-}
-
-void DNSSDNetworkBuilder::start()
-{
- mIsInit = true;
- mNoOfInitServiceTypes = 0;
-
- mServiceTypeBrowser = new KDNSSD::ServiceTypeBrowser();
- connect(mServiceTypeBrowser, &KDNSSD::ServiceTypeBrowser::serviceTypeAdded, this, &DNSSDNetworkBuilder::addServiceType);
- connect(mServiceTypeBrowser, &KDNSSD::ServiceTypeBrowser::serviceTypeRemoved, this, &DNSSDNetworkBuilder::removeServiceType);
- connect(mServiceTypeBrowser, &KDNSSD::ServiceTypeBrowser::finished, this, &DNSSDNetworkBuilder::onServiceTypeBrowserFinished);
-// TODO: add a signal network initialized to Network, so is cleared when first usable
- mServiceTypeBrowser->startBrowse();
-}
-
-void DNSSDNetworkBuilder::addServiceType( const QString& serviceType )
-{
- if( mServiceBrowserTable.contains(serviceType))
- return;
-
- KDNSSD::ServiceBrowser* serviceBrowser = new KDNSSD::ServiceBrowser( serviceType, true );
- connect(serviceBrowser, &KDNSSD::ServiceBrowser::serviceAdded, this, &DNSSDNetworkBuilder::addService);
- connect(serviceBrowser, &KDNSSD::ServiceBrowser::serviceRemoved, this, &DNSSDNetworkBuilder::removeService);
-
- if( mIsInit )
- {
- ++mNoOfInitServiceTypes;
- connect(serviceBrowser, &KDNSSD::ServiceBrowser::finished, this, &DNSSDNetworkBuilder::onServiceBrowserFinished);
- }
-
- mServiceBrowserTable[serviceType] = serviceBrowser;
- serviceBrowser->startBrowse();
-}
-
-void DNSSDNetworkBuilder::removeServiceType( const QString& serviceType )
-{
- Q_UNUSED(serviceType)
- // for now we keep the service browser (aren't that many) because otherwise
- // the serviceRemoved calls won't reach us.
- // we could also go through all the devices and remove the services manually as a fix
- return;
-#if 0
- QHash<QString,KDNSSD::ServiceBrowser*>::Iterator it = mServiceBrowserTable.find( serviceType );
-
- if( it == mServiceBrowserTable.end() )
- return;
-
- KDNSSD::ServiceBrowser* serviceBrowser = *it;
- mServiceBrowserTable.erase( it );
- // TODO: will all servicesRemoved be called before? on test NO!
- serviceBrowser->deleteLater();
-#endif
-}
-
-void DNSSDNetworkBuilder::addService( KDNSSD::RemoteService::Ptr service )
-{
- QList<NetDevice>& deviceList = mNetworkPrivate->deviceList();
-
- QString hostName = service->hostName();
- // TODO: this blocks. and the ip address should be delivered from DNS-SD with resolve
- const QHostAddress hostAddress = KDNSSD::ServiceBrowser::resolveHostName( hostName );
- const QString ipAddress = hostAddress.toString();
- // forget domain name if just ip address
- if( hostName == ipAddress )
- hostName.clear();
-
- // device TODO: only search for if we can create the service?
- NetDevicePrivate* d = nullptr;
- const NetDevice* deviceOfService = nullptr;
- for (const NetDevice& device : qAsConst(deviceList)) {
- const QString deviceHostName = device.hostName();
- const bool useIpAddress = ( deviceHostName.isEmpty() || hostName.isEmpty() );
- const bool isSameAddress = useIpAddress ?
- ( device.ipAddress() == ipAddress ) :
- ( deviceHostName == hostName );
-
- if( isSameAddress )
- {
- d = device.dPtr();
- // workaround: KDNSSD currently (4.7.0) emits two signals per service
- // just relying on service->serviceName() is fragile, but matches
- // current approach in removeService(...)
- QString id;
- const QString serviceType = service->type();
- for (const DNSSDNetSystemAble* factory : qAsConst(mNetSystemFactoryList)) {
- if( factory->canCreateNetSystemFromDNSSD(serviceType) )
- {
- id = factory->dnssdId( service );
- break;
- }
- }
- if( d->hasService(id) )
- return;
-
- deviceOfService = &device;
- break;
- }
- }
- if( !d )
- {
- const QString deviceName = hostName.left( hostName.indexOf(QLatin1Char('.')) );
- d = new NetDevicePrivate( deviceName );
- d->setHostName( hostName );
- d->setIpAddress( ipAddress );
- NetDevice device( d );
- deviceList.append( device );
- deviceOfService = &deviceList.last();
-
- QList<NetDevice> newDevices;
- newDevices.append( device );
- // TODO: the new service will be announced two times, once with the new device and once alone.
- // what to do about that? which order? okay? for now just do not attach services before. find usecases.
- mNetworkPrivate->emitDevicesAdded( newDevices );
- }
- else
- {
- if( d->hostName().isEmpty() && ! hostName.isEmpty() )
- d->setHostName( hostName );
- }
-
-
- const QString serviceType = service->type();
-
- NetServicePrivate* netServicePrivate = nullptr;
- // do a priority based lookup who can build the object
- // TODO: priorisation
- for (const DNSSDNetSystemAble* factory : qAsConst(mNetSystemFactoryList)) {
- if( factory->canCreateNetSystemFromDNSSD(serviceType) )
- {
- // TODO: here we should rather see if this service already exists
- netServicePrivate = factory->createNetService( service, *deviceOfService );
- break;
- }
- }
- // TODO: create dummy service
-// if( ! netServicePrivate )
-// netServicePrivate = new UnknownService;
-
- NetService netService( netServicePrivate );
- d->addService( netService );
-
- // try guessing the device type by the services on it
- // TODO: move into devicefactory
- NetDevice::Type deviceTypeByService = NetDevice::Unknown;
- QString deviceName;
- if( serviceType == QLatin1String("_workstation._tcp") )
- {
- deviceTypeByService = NetDevice::Workstation;
- deviceName = service->serviceName().left( service->serviceName().lastIndexOf(QLatin1Char('[')) ).trimmed();
- }
- else if( serviceType == QLatin1String("_net-assistant._udp") )
- {
- deviceTypeByService = NetDevice::Workstation;
- deviceName = service->serviceName();
- }
- else if( serviceType == QLatin1String("_airport._tcp") )
- deviceTypeByService = NetDevice::Router;
- else if( serviceType == QLatin1String("_ipp._tcp")
- || serviceType == QLatin1String("_printer._tcp")
- || serviceType == QLatin1String("_pdl-datastream._tcp") )
- {
- deviceTypeByService = NetDevice::Printer;
- deviceName = service->serviceName();
- }
-
- if( deviceTypeByService != NetDevice::Unknown )
- {
- if( deviceTypeByService > d->type() )
- {
- d->setType( deviceTypeByService );
- if( ! deviceName.isEmpty() )
- d->setName( deviceName );
- }
- }
-
- QList<NetService> newServices;
- newServices.append( netService );
- mNetworkPrivate->emitServicesAdded( newServices );
-}
-
-// TODO: each builder should refcount its services, so a shared one does not get removed to early
-// (might disappear for one sd because of master breakdown)
-void DNSSDNetworkBuilder::removeService( KDNSSD::RemoteService::Ptr service )
-{
- QList<NetDevice>& deviceList = mNetworkPrivate->deviceList();
-
- const QString hostName = service->hostName();
-
- // device
- QMutableListIterator<NetDevice> it( deviceList );
- while( it.hasNext())
- {
- const NetDevice& device = it.next();
- if( device.hostName() == hostName )
- {
- QString id;
- const QString serviceType = service->type();
- for (const DNSSDNetSystemAble* factory : qAsConst(mNetSystemFactoryList)) {
- if( factory->canCreateNetSystemFromDNSSD(serviceType) )
- {
- id = factory->dnssdId( service );
- break;
- }
- }
- NetDevicePrivate* d = device.dPtr();
- NetService netService = d->removeService( id );
- if( !netService.isValid() )
- break;
-
- QList<NetService> removedServices;
- removedServices.append( netService );
- mNetworkPrivate->emitServicesRemoved( removedServices );
-
- // remove device on last service
- if( d->serviceList().count() == 0 )
- {
- QList<NetDevice> removedDevices;
- removedDevices.append( device );
- // remove only after taking copy from reference into removed list
- it.remove();
-
- mNetworkPrivate->emitDevicesRemoved( removedDevices );
- }
- break;
- }
- }
-}
-
-void DNSSDNetworkBuilder::onServiceTypeBrowserFinished()
-{
- if( mIsInit )
- {
- mIsInit = false;
- if( mNoOfInitServiceTypes == 0 )
- emit initDone();
- }
-}
-
-void DNSSDNetworkBuilder::onServiceBrowserFinished()
-{
- --mNoOfInitServiceTypes;
- // only check for countdown after end of new service types
- if( !mIsInit && mNoOfInitServiceTypes == 0 )
- emit initDone();
-}
-
-DNSSDNetworkBuilder::~DNSSDNetworkBuilder()
-{
- qDeleteAll(mServiceBrowserTable);
- delete mServiceTypeBrowser;
-}
-
-}
diff --git a/network/network/builder/dnssd/dnssdnetworkbuilder.h b/network/network/builder/dnssd/dnssdnetworkbuilder.h
deleted file mode 100644
index 9f7ff779..00000000
--- a/network/network/builder/dnssd/dnssdnetworkbuilder.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef DNSSDNETWORKBUILDER_H
-#define DNSSDNETWORKBUILDER_H
-
-// lib
-#include "abstractnetworkbuilder.h"
-#include "network.h"
-#include "netdevice.h"
-// KF
-#include <kdnssd_version.h>
-#if KDNSSD_VERSION >= QT_VERSION_CHECK(5, 84, 0)
-#include <KDNSSD/RemoteService>
-#include <KDNSSD/ServiceTypeBrowser>
-#include <KDNSSD/ServiceBrowser>
-#else
-#include <DNSSD/RemoteService>
-#include <DNSSD/ServiceTypeBrowser>
-#include <DNSSD/ServiceBrowser>
-#endif
-
-// Qt
-#include <QHash>
-
-namespace Mollet {
-class DNSSDNetSystemAble;
-}
-
-namespace DNSSD {
-class ServiceBrowser;
-class ServiceTypeBrowser;
-}
-
-
-namespace Mollet
-{
-
-class DNSSDNetworkBuilder : public AbstractNetworkBuilder
-{
- Q_OBJECT
-
-public:
- explicit DNSSDNetworkBuilder( NetworkPrivate* networkPrivate );
- ~DNSSDNetworkBuilder() override;
-
-public: // AbstractNetworkBuilder API
- void registerNetSystemFactory( AbstractNetSystemFactory* netSystemFactory ) override;
- void start() override;
-
-private Q_SLOTS:
- void addServiceType( const QString& serviceType );
- void addService( KDNSSD::RemoteService::Ptr service );
- void removeServiceType( const QString& serviceType );
- void removeService( KDNSSD::RemoteService::Ptr service );
-
- void onServiceTypeBrowserFinished();
- void onServiceBrowserFinished();
-
-private: // data
- NetworkPrivate* mNetworkPrivate;
-
- KDNSSD::ServiceTypeBrowser* mServiceTypeBrowser;
- QHash<QString,KDNSSD::ServiceBrowser*> mServiceBrowserTable;
-
- QList<DNSSDNetSystemAble*> mNetSystemFactoryList;
-
- bool mIsInit;
- int mNoOfInitServiceTypes;
-};
-
-}
-
-#endif
diff --git a/network/network/builder/simpleitemfactory.cpp b/network/network/builder/simpleitemfactory.cpp
deleted file mode 100644
index 61d0f1df..00000000
--- a/network/network/builder/simpleitemfactory.cpp
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009-2010 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "simpleitemfactory.h"
-
-// lib
-#include "netservice_p.h"
-// #include "service.h"
-#include "upnp/cagibidevice.h"
-
-// Qt
-#include <QIcon>
-
-// KF
-#include <QUrl>
-
-#include <QDebug>
-
-namespace Mollet
-{
-
-struct DNSSDServiceDatum {
- const char* dnssdTypeName;
- const char* typeName;
- const char* fallbackIconName;
- bool isFilesystem;
- const char* protocol; // KDE can forward to it
- const char* pathField;
- const char* iconField;
- const char* userField;
- const char* passwordField;
-
- void feedUrl( QUrl* url, const KDNSSD::RemoteService* remoteService ) const;
-};
-
-static const DNSSDServiceDatum DNSSDServiceData[] =
-{
- // file services
- { "_ftp._tcp", "ftp", "folder-remote", true, "ftp", "path", nullptr, "u", "p" },
- { "_sftp-ssh._tcp", "sftp-ssh", "folder-remote", true, "sftp", nullptr, nullptr, "u", "p" },
- { "_ftps._tcp", "ftps", "folder-remote", true, "ftps", "path", nullptr, "u", "p" },
- { "_nfs._tcp", "nfs", "folder-remote", true, "nfs", "path", nullptr, nullptr, nullptr },
- { "_afpovertcp._tcp", "afpovertcp", "folder-remote", true, "afp", "path", nullptr, nullptr, nullptr },
- { "_smb._tcp", "smb", "folder-remote", true, "smb", "path", nullptr, "u", "p" },
- { "_webdav._tcp", "webdav", "folder-remote", true, "webdav", "path", nullptr, "u", "p" },
- { "_webdavs._tcp", "webdavs", "folder-remote", true, "webdavs", "path", nullptr, "u", "p" },
-
- { "_svn._tcp", "svn", "folder-sync", true, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_rsync._tcp", "rsync", "folder-sync", true, nullptr, nullptr, nullptr, nullptr, nullptr },
-
- // email
- { "_imap._tcp", "imap", "email", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_pop3._tcp", "pop3", "email", false, "pop3", nullptr, nullptr, nullptr, nullptr },
-
- // shell services
- { "_ssh._tcp", "ssh", "terminal", false, "ssh", nullptr, nullptr, "u", "p" },
- { "_telnet._tcp", "telnet", "terminal", false, "telnet", nullptr, nullptr, "u", "p" },
- { "_rfb._tcp", "rfb", "krfb", false, "vnc", "path", nullptr, "u", "p" },
- { "_rdp._tcp", "rdp", "krfb", false, "rdp", nullptr, nullptr, nullptr, nullptr },
-
- // other standard services
- { "_http._tcp", "http", "folder-html", false, "http", "path", nullptr, "u", "p" },
- { "_ntp._udp", "ntp", "xclock", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_ldap._tcp", "ldap", "user-group-properties", false, "ldap", nullptr, nullptr, nullptr, nullptr },
-
- // user2user (chat, collaboration)
- { "_xmpp-server._tcp", "xmpp-server", "xchat", false, "jabber", nullptr, nullptr, nullptr, nullptr },
- { "_presence._tcp", "presence", "im-user", false, "presence", nullptr, nullptr, nullptr, nullptr },
- { "_lobby._tcp", "lobby", "document-edit", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_giver._tcp", "giver", "folder-remote", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_sip._udp", "sip", "phone", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_h323._tcp", "h323", "phone", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_skype._tcp", "skype", "phone", false, nullptr, nullptr, nullptr, nullptr, nullptr },
-
- // printing
- { "_ipp._tcp", "ipp", "printer", false, "ipp", "path", nullptr, "u", "p" },
- { "_printer._tcp", "printer", "printer", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_pdl-datastream._tcp", "pdl-datastream", "printer", false, nullptr, nullptr, nullptr, nullptr, nullptr },
-
- // KDE workspace
- { "_plasma._tcp", "plasma", "plasma", false, "plasma", "name", "icon", nullptr, nullptr },
-
- // KDE games
- { "_kbattleship._tcp", "kbattleship", "kbattleship", false, "kbattleship", nullptr, nullptr, nullptr, nullptr },
- { "_lskat._tcp", "lskat", "lskat", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_kfourinline._tcp", "kfourinline", "kfourinline", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_ksirk._tcp", "ksirk", "ksirk", false, nullptr, nullptr, nullptr, nullptr, nullptr },
-
- // hardware
- { "_pulse-server._tcp","pulse-server","audio-card", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_pulse-source._tcp","pulse-source","audio-input-line", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_pulse-sink._tcp", "pulse-sink", "speaker", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_udisks-ssh._tcp", "udisks-ssh", "drive-harddisk", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_libvirt._tcp", "libvirt", "computer", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_airmouse._tcp", "airmouse", "input-mouse", false, nullptr, nullptr, nullptr, nullptr, nullptr },
-
- // database
- { "_postgresql._tcp", "postgresql", "server-database", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_couchdb_location._tcp", "couchdb_location", "server-database", false, nullptr, nullptr, nullptr, nullptr, nullptr },
-
- // else
- { "_realplayfavs._tcp","realplayfavs","favorites", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_acrobatSRV._tcp", "acrobat-server","application-pdf", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_adobe-vc._tcp", "adobe-vc", "services", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_ggz._tcp", "ggz", "applications-games", false, "ggz", nullptr, nullptr, nullptr, nullptr },
-
- { "_pgpkey-ldap._tcp", "pgpkey-ldap", "application-pgp-keys", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_pgpkey-hkp._tcp", "pgpkey-hkp", "application-pgp-keys", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_pgpkey-https._tcp", "pgpkey-https", "application-pgp-keys", true, "https", "path", nullptr, nullptr, nullptr },
-
- // Maemo
- { "_maemo-inf._tcp", "maemo-inf", "pda", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- // TODO: _maemo-inf._tcp seems to be not a service, just some about info, use to identify device and hide
-
- // Apple
- { "_airport._tcp", "airport", "network-wireless", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_daap._tcp", "daap", "folder-sound", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_dacp._tcp", "dacp", "folder-sound", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_eppc._tcp", "eppc", "network-connect", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_net-assistant._udp", "net-assistant", "services", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_odisk._tcp", "odisk", "media-optical", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_raop._tcp", "raop", "speaker", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_touch-able._tcp", "touch-able", "input-tablet", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_workstation._tcp", "workstation", "network-workgroup", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_sleep-proxy._udp", "sleep-proxy", "services", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_nssocketport._tcp", "nssocketport", "services", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_home-sharing._tcp", "home-sharing", "services", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_appletv-itunes._tcp","appletv-itunes","services", false, nullptr, nullptr, nullptr, nullptr, nullptr },
- { "_appletv-pair._tcp", "appletv-pair", "services", false, nullptr, nullptr, nullptr, nullptr, nullptr }
-};
-// result["_ssh._tcp"]= DNSSDNetServiceBuilder(i18n("Remote disk (fish)"), "fish", "service/ftp", QString(), "u", "p");
-// network-server-database icon
-// see // SubEthaEdit 2
-// Defined TXT keys: txtvers=1, name=<Full Name>, userid=<User ID>, version=2
-
-static const int DNSSDServiceDataSize = sizeof( DNSSDServiceData ) / sizeof( DNSSDServiceData[0] );
-
-static const DNSSDServiceDatum UnknownServiceDatum = { "", "unknown", "unknown", false, nullptr, nullptr, nullptr, nullptr, nullptr };
-
-// TODO:
-// * find out how ws (webservices, _ws._tcp), upnp (_upnp._tcp) are exactly meant to be used
-// * learn about uddi
-// * see how the apple specific protocols can be used for devicetype identification (printer, scanner)
-
-
-void DNSSDServiceDatum::feedUrl( QUrl* url, const KDNSSD::RemoteService* remoteService ) const
-{
- const QMap<QString,QByteArray> serviceTextData = remoteService->textData();
-
- url->setScheme( QString::fromLatin1(protocol) );
- if( userField )
- url->setUserName( QLatin1String(serviceTextData.value(QLatin1String(userField)).constData()) );
- if( passwordField )
- url->setPassword( QLatin1String(serviceTextData.value(QLatin1String(passwordField)).constData()) );
- if( pathField )
- url->setPath( QLatin1String(serviceTextData.value(QLatin1String(pathField)).constData()) );
-
- url->setHost( remoteService->hostName() );
- url->setPort( remoteService->port() );
-}
-
-
-SimpleItemFactory::SimpleItemFactory()
- : AbstractNetSystemFactory()
-{
-}
-
-
-bool SimpleItemFactory::canCreateNetSystemFromDNSSD( const QString& serviceType ) const
-{
- Q_UNUSED( serviceType )
- return true;
-}
-
-QString SimpleItemFactory::dnssdId( const KDNSSD::RemoteService::Ptr& dnssdService ) const
-{
- return dnssdService->type() + QLatin1Char('_') + dnssdService->serviceName();
-}
-
-NetServicePrivate* SimpleItemFactory::createNetService( const KDNSSD::RemoteService::Ptr& dnssdService, const NetDevice& device ) const
-{
- NetServicePrivate* result;
-
- const QString dnssdServiceType = dnssdService->type();
-
- const DNSSDServiceDatum* serviceDatum = &UnknownServiceDatum;
- for( int i = 0; i< DNSSDServiceDataSize; ++i )
- {
- const DNSSDServiceDatum* datum = &DNSSDServiceData[i];
- if( dnssdServiceType == QLatin1String(datum->dnssdTypeName) )
- {
- serviceDatum = datum;
- break;
- }
- }
-
- QUrl url;
- if( serviceDatum->protocol )
- serviceDatum->feedUrl( &url, dnssdService.data() );
-
- const bool isUnknown = ( serviceDatum == &UnknownServiceDatum );
- const QString typeName = isUnknown ?
- dnssdServiceType.mid( 1, dnssdServiceType.lastIndexOf(QLatin1Char('.'))-1 ) :
- QString::fromLatin1( serviceDatum->typeName );
-
- QString iconName = QString::fromLatin1(serviceDatum->fallbackIconName);
- if ( serviceDatum->iconField ) {
- const QMap<QString,QByteArray> serviceTextData = dnssdService->textData();
- QString serviceIconName = QString::fromUtf8(serviceTextData[QString::fromLatin1(serviceDatum->iconField)]);
- if ( QIcon::hasThemeIcon(serviceIconName) ) {
- iconName = serviceIconName;
- }
- }
-
- result = new NetServicePrivate( dnssdService->serviceName(), iconName,
- typeName, device, url.url(), SimpleItemFactory::dnssdId(dnssdService) );
-
- return result;
-}
-
-bool SimpleItemFactory::canCreateNetSystemFromUpnp( const Cagibi::Device& upnpDevice ) const
-{
- Q_UNUSED( upnpDevice )
- return true;
-}
-
-QString SimpleItemFactory::upnpId( const Cagibi::Device& upnpDevice ) const
-{
- return upnpDevice.udn();
-}
-
-// TODO: add KIcon with specialized KIconLoader (fetches Icons via D-Bus)
-NetServicePrivate* SimpleItemFactory::createNetService( const Cagibi::Device& upnpDevice, const NetDevice& device ) const
-{
- NetServicePrivate* result;
-
- QString url = upnpDevice.presentationUrl();
- if( url.isEmpty() )
- {
- url = QString::fromLatin1( "upnp://" );
- url.append( upnpDevice.udn() );
- }
- result = new NetServicePrivate( upnpDevice.friendlyName(),
- QString::fromLatin1("unknown"),
- QString::fromLatin1("upnp.")+upnpDevice.type(), device, url, SimpleItemFactory::upnpId(upnpDevice) );
-
- return result;
-}
-
-SimpleItemFactory::~SimpleItemFactory() {}
-
-}
diff --git a/network/network/builder/simpleitemfactory.h b/network/network/builder/simpleitemfactory.h
deleted file mode 100644
index f31c73ce..00000000
--- a/network/network/builder/simpleitemfactory.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef SIMPLEITEMFACTORY_H
-#define SIMPLEITEMFACTORY_H
-
-// lib
-#include <dnssd/dnssdnetsystemable.h>
-#include <upnp/upnpnetsystemable.h>
-#include <abstractnetsystemfactory.h>
-
-
-namespace Mollet
-{
-
-class SimpleItemFactory : public AbstractNetSystemFactory,
- public DNSSDNetSystemAble,
- public UpnpNetSystemAble
-{
- Q_OBJECT
- Q_INTERFACES(
- Mollet::DNSSDNetSystemAble
- Mollet::UpnpNetSystemAble
- )
-
-public:
- SimpleItemFactory();
- ~SimpleItemFactory() override;
-
-public: // DNSSDNetSystemAble API
- bool canCreateNetSystemFromDNSSD( const QString& serviceType ) const override;
- NetServicePrivate* createNetService( const KDNSSD::RemoteService::Ptr& service, const NetDevice& device ) const override;
- QString dnssdId( const KDNSSD::RemoteService::Ptr& dnssdService ) const override;
-
-public: // UpnpNetSystemAble API
- bool canCreateNetSystemFromUpnp( const Cagibi::Device& upnpDevice ) const override;
- NetServicePrivate* createNetService( const Cagibi::Device& upnpDevice, const NetDevice& device ) const override;
- QString upnpId( const Cagibi::Device& upnpDevice ) const override;
-
-private:
-};
-
-}
-
-#endif
diff --git a/network/network/builder/upnp/cagibidbuscodec.cpp b/network/network/builder/upnp/cagibidbuscodec.cpp
deleted file mode 100644
index 32687ea7..00000000
--- a/network/network/builder/upnp/cagibidbuscodec.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- This file is part of the KUPnP library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2010-2011 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "cagibidbuscodec.h"
-
-// network
-#include "cagibidevice_p.h"
-// Qt
-#include <QDBusArgument>
-
-#include <QDebug>
-
-static const QString type = QLatin1String( "deviceType" );
-static const QString friendlyName = QLatin1String( "friendlyName" );
-static const QString manufacturerName = QLatin1String( "manufacturer" );
-static const QString modelDescription = QLatin1String( "modelDescription" );
-static const QString modelName = QLatin1String( "modelName" );
-static const QString modelNumber = QLatin1String( "modelNumber" );
-static const QString serialNumber = QLatin1String( "serialNumber" );
-static const QString udn = QLatin1String( "UDN" );
-static const QString presentationUrl = QLatin1String( "presentationURL" );
-static const QString ipAddress = QLatin1String( "ipAddress" );
-static const QString portNumber = QLatin1String( "ipPortNumber" );
-static const QString parentDeviceUdn = QLatin1String( "parentDeviceUDN" );
-
-
-QDBusArgument& operator<<( QDBusArgument& argument, const Cagibi::Device& device )
-{
- Q_UNUSED( device )
- // not used in code at the moment, so do not stream anything
- // QtDBus marshaller still uses it to calculate the D-Bus argument signature
- argument.beginMap( QVariant::String, QVariant::String );
- argument.endMap();
-
- return argument;
-}
-
-const QDBusArgument& operator>>( const QDBusArgument& argument,
- Cagibi::Device& device )
-{
- Cagibi::DevicePrivate* const devicePrivate = device.d.data();
-
- argument.beginMap();
-
- QString key;
- QString value;
- while( ! argument.atEnd() )
- {
- argument.beginMapEntry();
- argument >> key;
-
- if( key == type )
- {
- QString type;
- argument >> type;
- const QStringList typeParts = type.split( QLatin1Char(':') );
- qDebug()<<type;
- if( typeParts.size() >=5 )
- devicePrivate->mType = typeParts[3]+typeParts[4];
- }
- else if( key == friendlyName )
- argument >> devicePrivate->mFriendlyName;
- else if( key == manufacturerName )
- argument >> devicePrivate->mManufacturerName;
-// const QString& manufacturerUrl() const;
- else if( key == modelDescription )
- argument >> devicePrivate->mModelDescription;
- else if( key == modelName )
- argument >> devicePrivate->mModelName;
- else if( key == modelNumber )
- argument >> devicePrivate->mModelNumber;
- else if( key == serialNumber )
- argument >> devicePrivate->mSerialNumber;
- else if( key == udn )
- argument >> devicePrivate->mUdn;
-// const QString upc() const;
- else if( key == presentationUrl )
- argument >> devicePrivate->mPresentationUrl;
- else if( key == ipAddress )
- argument >> devicePrivate->mIpAddress;
- else if( key == portNumber )
- argument >> devicePrivate->mIpPortNumber;
- else if( key == parentDeviceUdn )
- argument >> devicePrivate->mParentDeviceUdn;
-// const QList<Icon>& icons() const;
-// const QList<Service>& services() const;
-// const QList<Device>& devices() const;
- // unknown key
- else
- argument >> value;
- argument.endMapEntry();
- }
-
- argument.endMap();
-
- return argument;
-}
diff --git a/network/network/builder/upnp/cagibidbuscodec.h b/network/network/builder/upnp/cagibidbuscodec.h
deleted file mode 100644
index 98be7593..00000000
--- a/network/network/builder/upnp/cagibidbuscodec.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- This file is part of the KUPnP library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2010 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef CAGIBIDBUSCODEC_H
-#define CAGIBIDBUSCODEC_H
-
-// lib
-#include "cagibidevice.h"
-// Qt
-#include <QMetaType>
-#include <QVector>
-
-class QDBusArgument;
-QDBusArgument& operator<<( QDBusArgument& argument,
- const Cagibi::Device& device );
-const QDBusArgument& operator>>( const QDBusArgument& argument,
- Cagibi::Device& device );
-
-Q_DECLARE_METATYPE( Cagibi::Device )
-
-#endif
diff --git a/network/network/builder/upnp/cagibidevice.cpp b/network/network/builder/upnp/cagibidevice.cpp
deleted file mode 100644
index c8ad1694..00000000
--- a/network/network/builder/upnp/cagibidevice.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- This file is part of the KUPnP library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009-2010 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "cagibidevice.h"
-#include "cagibidevice_p.h"
-
-
-namespace Cagibi
-{
-
-Device::Device()
- : d( new DevicePrivate() )
-{
-}
-
-Device::Device( DevicePrivate* _d )
- : d( _d )
-{
-}
-
-Device::Device( const Device& other )
- : d( other.d )
-{
-}
-
-const QString& Device::type() const { return d->type(); }
-const QString& Device::friendlyName() const { return d->friendlyName(); }
-const QString& Device::manufacturerName() const { return d->manufacturerName(); }
-const QString& Device::modelDescription() const { return d->modelDescription(); }
-const QString& Device::modelName() const { return d->modelName(); }
-const QString& Device::modelNumber() const { return d->modelNumber(); }
-const QString& Device::serialNumber() const { return d->serialNumber(); }
-const QString& Device::udn() const { return d->udn(); }
-const QString& Device::presentationUrl() const { return d->presentationUrl(); }
-const QString& Device::ipAddress() const { return d->ipAddress(); }
-int Device::ipPortNumber() const { return d->ipPortNumber(); }
-
-bool Device::hasParentDevice() const { return d->hasParentDevice(); }
-const QString& Device::parentDeviceUdn() const { return d->parentDeviceUdn(); }
-
-Device& Device::operator=( const Device& other )
-{
- d = other.d;
- return *this;
-}
-
-Device::~Device()
-{
-}
-
-}
diff --git a/network/network/builder/upnp/cagibidevice.h b/network/network/builder/upnp/cagibidevice.h
deleted file mode 100644
index 19c26312..00000000
--- a/network/network/builder/upnp/cagibidevice.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- This file is part of the KUPnP library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009-2010 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef CAGIBIDEVICE_H
-#define CAGIBIDEVICE_H
-
-// Qt
-#include <QExplicitlySharedDataPointer>
-
-namespace Cagibi {
-class Device;
-}
-class QString;
-class QDBusArgument;
-extern QDBusArgument& operator<<( QDBusArgument& argument,
- const Cagibi::Device& device );
-extern const QDBusArgument& operator>>( const QDBusArgument& argument,
- Cagibi::Device& device );
-
-
-namespace Cagibi
-{
-class DevicePrivate;
-
-class Device
-{
- friend QDBusArgument& ::operator<<( QDBusArgument& argument,
- const Cagibi::Device& device );
- friend const QDBusArgument& ::operator>>( const QDBusArgument& argument,
- Cagibi::Device& device );
-
-protected:
- explicit Device( DevicePrivate* _d );
-
-public:
- Device();
- Device( const Device& other );
-
- ~Device();
-
-public:
- Device& operator=( const Device& other );
-
-public:
- const QString& type() const;
- const QString& friendlyName() const;
- const QString& manufacturerName() const;
-// QString manufacturerUrl() const;
- const QString& modelDescription() const;
- const QString& modelName() const;
- const QString& modelNumber() const;
- const QString& serialNumber() const;
- const QString& udn() const;
-// QString upc() const;
- const QString& presentationUrl() const;
- const QString& ipAddress() const;
- int ipPortNumber() const;
-
- bool hasParentDevice() const;
- const QString& parentDeviceUdn() const;
-
-protected:
- QExplicitlySharedDataPointer<DevicePrivate> d;
-};
-
-}
-
-#endif
diff --git a/network/network/builder/upnp/cagibidevice_p.h b/network/network/builder/upnp/cagibidevice_p.h
deleted file mode 100644
index ea41a28e..00000000
--- a/network/network/builder/upnp/cagibidevice_p.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- This file is part of the KUPnP library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009-2010 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef CAGIBIDEVICE_P_H
-#define CAGIBIDEVICE_P_H
-
-// lib
-#include "cagibidevice.h"
-// Qt
-#include <QString>
-#include <QSharedData>
-
-
-namespace Cagibi
-{
-
-class DevicePrivate : public QSharedData
-{
- friend const QDBusArgument& ::operator>>( const QDBusArgument& argument,
- Cagibi::Device& device );
-
- public:
- DevicePrivate();
-
- public:
- const QString& type() const;
- const QString& friendlyName() const;
- const QString& manufacturerName() const;
-// const QString& manufacturerUrl() const;
- const QString& modelDescription() const;
- const QString& modelName() const;
- const QString& modelNumber() const;
- const QString& serialNumber() const;
- const QString& udn() const;
-// const QString upc() const;
- const QString& presentationUrl() const;
- const QString& ipAddress() const;
- int ipPortNumber() const;
-
- bool hasParentDevice() const;
- const QString& parentDeviceUdn() const;
-
- protected:
- QString mType;
- /// short user-friendly title
- QString mFriendlyName;
- QString mManufacturerName;
-// QString mManufacturerUrl;
- /// long user-friendly title
- QString mModelDescription;
- QString mModelName;
- QString mModelNumber;
- QString mSerialNumber;
- QString mUdn;
-// QString mUpc; Universal Product Code;
- QString mPresentationUrl;
-
- QString mIpAddress;
- int mIpPortNumber;
-
- QString mParentDeviceUdn;
-};
-
-
-inline DevicePrivate::DevicePrivate() {}
-inline const QString& DevicePrivate::type() const { return mType; }
-inline const QString& DevicePrivate::friendlyName() const { return mFriendlyName; }
-inline const QString& DevicePrivate::manufacturerName() const { return mManufacturerName; }
-inline const QString& DevicePrivate::modelDescription() const { return mModelDescription; }
-inline const QString& DevicePrivate::modelName() const { return mModelName; }
-inline const QString& DevicePrivate::modelNumber() const { return mModelNumber; }
-inline const QString& DevicePrivate::serialNumber() const { return mSerialNumber; }
-inline const QString& DevicePrivate::udn() const { return mUdn; }
-inline const QString& DevicePrivate::presentationUrl() const { return mPresentationUrl; }
-inline const QString& DevicePrivate::ipAddress() const { return mIpAddress; }
-inline int DevicePrivate::ipPortNumber() const { return mIpPortNumber; }
-inline bool DevicePrivate::hasParentDevice() const { return (! mParentDeviceUdn.isEmpty() ); }
-inline const QString& DevicePrivate::parentDeviceUdn() const { return mParentDeviceUdn; }
-
-}
-
-#endif
diff --git a/network/network/builder/upnp/upnpnetsystemable.h b/network/network/builder/upnp/upnpnetsystemable.h
deleted file mode 100644
index cfc45ea9..00000000
--- a/network/network/builder/upnp/upnpnetsystemable.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef UPNPNETSYSTEMABLE_H
-#define UPNPNETSYSTEMABLE_H
-
-// Qt
-#include <QtPlugin>
-
-namespace Cagibi {
-class Device;
-}
-class QString;
-
-
-namespace Mollet
-{
-class NetServicePrivate;
-class NetDevice;
-
-
-class UpnpNetSystemAble
-{
-public:
- virtual ~UpnpNetSystemAble();
-
-public: // API to be implemented
- virtual bool canCreateNetSystemFromUpnp( const Cagibi::Device& upnpDevice ) const = 0;
- virtual NetServicePrivate* createNetService( const Cagibi::Device& upnpDevice, const NetDevice& device ) const = 0;
- virtual QString upnpId( const Cagibi::Device& upnpDevice ) const = 0;
-};
-
-
-inline UpnpNetSystemAble::~UpnpNetSystemAble() {}
-
-}
-
-Q_DECLARE_INTERFACE( Mollet::UpnpNetSystemAble, "org.kde.mollet.upnpnetsystemable/1.0" )
-
-#endif
diff --git a/network/network/builder/upnp/upnpnetworkbuilder.cpp b/network/network/builder/upnp/upnpnetworkbuilder.cpp
deleted file mode 100644
index 23b42036..00000000
--- a/network/network/builder/upnp/upnpnetworkbuilder.cpp
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009-2011 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "upnpnetworkbuilder.h"
-
-// lib
-#include "upnpnetsystemable.h"
-#include "abstractnetsystemfactory.h"
-#include "network_p.h"
-#include "netdevice_p.h"
-#include "netservice_p.h"
-#include "cagibidevice.h"
-#include "cagibidbuscodec.h"
-// Qt
-#include <QDBusMetaType>
-#include <QDBusReply>
-#include <QDBusConnection>
-#include <QDBusInterface>
-#include <QDBusPendingCallWatcher>
-#include <QDBusServiceWatcher>
-#include <QStringList>
-
-#include <QDebug>
-
-namespace Mollet
-{
-static const char cagibiServiceName[] = "org.kde.Cagibi";
-static const char cagibiDeviceListObjectPath[] = "/org/kde/Cagibi/DeviceList";
-static const char cagibiDeviceListInterface[] = "org.kde.Cagibi.DeviceList";
-
-UpnpNetworkBuilder::UpnpNetworkBuilder( NetworkPrivate* networkPrivate )
- : AbstractNetworkBuilder()
- , mNetworkPrivate( networkPrivate )
- , mCagibiDeviceListDBusProxy( nullptr )
-{
-}
-
-void UpnpNetworkBuilder::registerNetSystemFactory( AbstractNetSystemFactory* netSystemFactory )
-{
- UpnpNetSystemAble* upnpNetSystemAble = qobject_cast<UpnpNetSystemAble*>( netSystemFactory );
-
- if( upnpNetSystemAble )
- mNetSystemFactoryList.append( upnpNetSystemAble );
-}
-
-void UpnpNetworkBuilder::start()
-{
- QMetaObject::invokeMethod( this, "startBrowse", Qt::QueuedConnection );
-}
-
-void UpnpNetworkBuilder::startBrowse()
-{
- qDBusRegisterMetaType<DeviceTypeMap>();
- qDBusRegisterMetaType<Cagibi::Device>();
-
- QDBusConnection dbusConnection = QDBusConnection::systemBus();
-
- const QString serviceName = QLatin1String( cagibiServiceName );
- const QString deviceListObjectPath = QLatin1String( cagibiDeviceListObjectPath );
- const QString deviceListInterface = QLatin1String( cagibiDeviceListInterface );
-
- // install service watcher
- QDBusServiceWatcher* cagibiServiceWatcher =
- new QDBusServiceWatcher( serviceName,
- dbusConnection,
- QDBusServiceWatcher::WatchForOwnerChange,
- this );
- connect( cagibiServiceWatcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)),
- SLOT(onCagibiServiceOwnerChanged(QString,QString,QString)) );
-
- // create devicelist proxy
- mCagibiDeviceListDBusProxy =
- new QDBusInterface( serviceName,
- deviceListObjectPath,
- deviceListInterface,
- dbusConnection, this );
- connect( mCagibiDeviceListDBusProxy, SIGNAL(devicesAdded(DeviceTypeMap)),
- SLOT(onDevicesAdded(DeviceTypeMap)) );
- connect( mCagibiDeviceListDBusProxy, SIGNAL(devicesRemoved(DeviceTypeMap)),
- SLOT(onDevicesRemoved(DeviceTypeMap)) );
-
- // query current devicelist
- queryCurrentDevices();
-
- emit initDone();
-}
-
-void UpnpNetworkBuilder::queryCurrentDevices()
-{
- // query current devicelist
- QDBusPendingCall allDevicesCall =
- mCagibiDeviceListDBusProxy->asyncCall( QLatin1String("allDevices") );
-
- QDBusPendingCallWatcher* allDevicesCallWatcher =
- new QDBusPendingCallWatcher( allDevicesCall, this );
- connect( allDevicesCallWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
- SLOT(onAllDevicesCallFinished(QDBusPendingCallWatcher*)) );
-}
-
-void UpnpNetworkBuilder::onAllDevicesCallFinished( QDBusPendingCallWatcher* allDevicesCallWatcher )
-{
- QDBusReply<DeviceTypeMap> reply = *allDevicesCallWatcher;
-
- if( reply.isValid() )
- {
-//qDebug() << "Connected to Cagibi, listing of UPnP devices/services started.";
- const DeviceTypeMap deviceTypeMap = reply;
- onDevicesAdded( deviceTypeMap );
- }
- else
- {
- //qDebug() << "Could not connect to Cagibi, no listing of UPnP devices/services.";
- //qDebug() << "Error: " << reply.error().name();
- }
-
- delete allDevicesCallWatcher;
-}
-
-void UpnpNetworkBuilder::addUPnPDevices( const QList<Cagibi::Device>& upnpDevices )
-{
- QList<NetDevice> addedDevices;
- QList<NetService> addedServices;
-
- QList<NetDevice>& deviceList = mNetworkPrivate->deviceList();
- for (const Cagibi::Device& upnpDevice : upnpDevices) {
- if( upnpDevice.hasParentDevice() )
- continue;
-
- const QString ipAddress = upnpDevice.ipAddress();
-
- NetDevicePrivate* d = nullptr;
- const NetDevice* deviceOfService = nullptr;
- for (const NetDevice& device : qAsConst(deviceList)) {
- const bool isSameAddress = ( device.ipAddress() == ipAddress );
-//qDebug()<<"existing device:"<<device.hostName()<<"at"<<device.ipAddress()<<"vs."<<ipAddress<<":"<<isSameAddress;
- // TODO: lookup hostname and try to use that
- if( isSameAddress )
- {
- d = device.dPtr();
- deviceOfService = &device;
- break;
- }
- }
- if( ! d )
- {
- const QString displayName = upnpDevice.friendlyName();
-
- const QString deviceName = displayName;
- d = new NetDevicePrivate( deviceName );
- d->setIpAddress( ipAddress );
-
- NetDevice device( d );
- addedDevices.append( device );
- deviceList.append( device );
- deviceOfService = &deviceList.last();
-//qDebug()<<"new device:"<<deviceName<<"at"<<ipAddress;
- }
-
- NetServicePrivate* netServicePrivate = nullptr;
- // do a priority based lookup who can build the object
- // TODO: priorisation
- for (const UpnpNetSystemAble* factory : qAsConst(mNetSystemFactoryList)) {
- if( factory->canCreateNetSystemFromUpnp(upnpDevice) )
- {
- // TODO: here we should rather see if this service already exists
- netServicePrivate = factory->createNetService( upnpDevice, *deviceOfService );
- break;
- }
- }
-
- NetService netService( netServicePrivate );
- d->addService( netService );
-
- addedServices.append( netService );
-//qDebug()<<"new service:"<<netService.name()<<netService.url();
-
- // try guessing the device type by the services on it
- // TODO: move into devicefactory
- const QString serviceType = upnpDevice.type();
- NetDevice::Type deviceTypeByService = NetDevice::Unknown;
- QString deviceName;
- if( serviceType == QLatin1String("InternetGatewayDevice1") )
- deviceTypeByService = NetDevice::Router;
- else if( serviceType == QLatin1String("PrinterBasic1")
- || serviceType == QLatin1String("PrinterEnhanced1") )
- deviceTypeByService = NetDevice::Printer;
- else if( serviceType == QLatin1String("Scanner1") )
- deviceTypeByService = NetDevice::Scanner;
-
- if( deviceTypeByService != NetDevice::Unknown )
- {
- if( deviceTypeByService > d->type() )
- {
- d->setType( deviceTypeByService );
- if( ! deviceName.isEmpty() )
- d->setName( deviceName );
- }
- }
- }
-
- if( ! addedDevices.isEmpty() )
- mNetworkPrivate->emitDevicesAdded( addedDevices );
- if( ! addedServices.isEmpty() )
- mNetworkPrivate->emitServicesAdded( addedServices );
-}
-
-
-void UpnpNetworkBuilder::removeUPnPDevices( const QList<Cagibi::Device>& upnpDevices )
-{
- QList<NetDevice> removedDevices;
- QList<NetService> removedServices;
-
- QList<NetDevice>& deviceList = mNetworkPrivate->deviceList();
- for (const Cagibi::Device& upnpDevice : upnpDevices) {
- const QString ipAddress = upnpDevice.ipAddress();
-
- QMutableListIterator<NetDevice> it( deviceList );
- while( it.hasNext())
- {
- const NetDevice& device = it.next();
- if( device.ipAddress() == ipAddress )
- {
- QString id;
- for (const UpnpNetSystemAble* factory : qAsConst(mNetSystemFactoryList)) {
- if( factory->canCreateNetSystemFromUpnp(upnpDevice) )
- {
- id = factory->upnpId( upnpDevice );
- break;
- }
- }
- NetDevicePrivate* d = device.dPtr();
- NetService netService = d->removeService( id );
- if( ! netService.isValid() )
- break;
-
- removedServices.append( netService );
-
- // remove device on last service
- if( d->serviceList().count() == 0 )
- {
- removedDevices.append( device );
- // remove only after taking copy from reference into removed list
- it.remove();
- }
- break;
- }
- }
- }
- if( ! removedServices.isEmpty() )
- mNetworkPrivate->emitServicesRemoved( removedServices );
- if( ! removedDevices.isEmpty() )
- mNetworkPrivate->emitDevicesRemoved( removedDevices );
-}
-
-
-void UpnpNetworkBuilder::onDevicesAdded( const DeviceTypeMap& deviceTypeMap )
-{
- DeviceTypeMap::ConstIterator it = deviceTypeMap.constBegin();
- DeviceTypeMap::ConstIterator end = deviceTypeMap.constEnd();
- for( ; it != end; ++it )
- {
- const QString udn = it.key();
- QList<QVariant> args;
- args << udn;
- mCagibiDeviceListDBusProxy->callWithCallback(
- QLatin1String("deviceDetails"), args,
- this, SLOT(onAddedDeviceDetails(Cagibi::Device)), nullptr );
- }
-}
-
-void UpnpNetworkBuilder::onDevicesRemoved( const DeviceTypeMap& deviceTypeMap )
-{
- QList<Cagibi::Device> upnpDevices;
-
- DeviceTypeMap::ConstIterator it = deviceTypeMap.constBegin();
- DeviceTypeMap::ConstIterator end = deviceTypeMap.constEnd();
- for( ; it != end; ++it )
- {
- QHash<QString,Cagibi::Device>::Iterator adIt =
- mActiveDevices.find( it.key() );
- if( adIt != mActiveDevices.end() )
- {
-//qDebug()<<"removing UPnP device" << adIt.value().friendlyName();
- upnpDevices.append( adIt.value() );
- mActiveDevices.erase( adIt );
- }
- }
-
- removeUPnPDevices( upnpDevices );
-}
-
-void UpnpNetworkBuilder::onAddedDeviceDetails( const Cagibi::Device& device )
-{
- // currently only root devices are shown
- if( device.hasParentDevice() )
- return;
-
- mActiveDevices.insert( device.udn(), device );
-
- QList<Cagibi::Device> devices;
- devices.append( device );
- addUPnPDevices( devices );
-}
-
-void UpnpNetworkBuilder::onCagibiServiceOwnerChanged( const QString& serviceName,
- const QString& oldOwner,
- const QString& newOwner )
-{
- Q_UNUSED(serviceName);
- Q_UNUSED(newOwner);
-
- // old service disappeared?
- if( ! oldOwner.isEmpty() )
- {
-//qDebug()<<"Cagibi disappeared, removing all UPnP devices";
-
- // remove all registered UPnP devices
- QList<Cagibi::Device> upnpDevices = mActiveDevices.values();
- mActiveDevices.clear();
-
- removeUPnPDevices( upnpDevices );
- }
-
- if( ! newOwner.isEmpty() )
- queryCurrentDevices();
-}
-
-UpnpNetworkBuilder::~UpnpNetworkBuilder()
-{
-}
-
-}
diff --git a/network/network/builder/upnp/upnpnetworkbuilder.h b/network/network/builder/upnp/upnpnetworkbuilder.h
deleted file mode 100644
index a771a972..00000000
--- a/network/network/builder/upnp/upnpnetworkbuilder.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef UPNPNETWORKBUILDER_H
-#define UPNPNETWORKBUILDER_H
-
-// lib
-#include <abstractnetworkbuilder.h>
-#include <network.h>
-#include <netdevice.h>
-// Qt
-#include <QMetaType>
-#include <QHash>
-
-namespace Cagibi {
-class Device;
-}
-
-class QDBusInterface;
-class QDBusPendingCallWatcher;
-
-typedef QHash<QString,QString> DeviceTypeMap;
-Q_DECLARE_METATYPE( DeviceTypeMap )
-
-
-namespace Mollet
-{
-class UpnpNetSystemAble;
-
-
-class UpnpNetworkBuilder : public AbstractNetworkBuilder
-{
- Q_OBJECT
-
-public:
- explicit UpnpNetworkBuilder( NetworkPrivate* networkPrivate );
- ~UpnpNetworkBuilder() override;
-
-public: // AbstractNetworkBuilder API
- void registerNetSystemFactory( AbstractNetSystemFactory* netSystemFactory ) override;
- void start() override;
- //TODO: void stop(); ? why needed, what to do?
-
-protected:
- void addUPnPDevices( const QList<Cagibi::Device>& devices );
- void removeUPnPDevices( const QList<Cagibi::Device>& devices );
-
-private Q_SLOTS:
- void startBrowse();
-
- void onDevicesAdded( const DeviceTypeMap& deviceTypeMap );
- void onDevicesRemoved( const DeviceTypeMap& deviceTypeMap );
- void onAddedDeviceDetails( const Cagibi::Device& device );
- void onCagibiServiceOwnerChanged( const QString& serviceName,
- const QString& oldOwner, const QString& newOwner );
-
- void onAllDevicesCallFinished( QDBusPendingCallWatcher* allDevicesCallWatcher );
-
-private:
- void queryCurrentDevices();
-
-private: // data
- NetworkPrivate* mNetworkPrivate;
-
- QList<UpnpNetSystemAble*> mNetSystemFactoryList;
-
- QHash<QString,Cagibi::Device> mActiveDevices;
-
- QDBusInterface* mCagibiDeviceListDBusProxy;
-};
-
-}
-
-#endif
diff --git a/network/network/netdevice.cpp b/network/network/netdevice.cpp
deleted file mode 100644
index 644e1b05..00000000
--- a/network/network/netdevice.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "netdevice.h"
-#include "netdevice_p.h"
-
-namespace Mollet
-{
-
-Q_GLOBAL_STATIC_WITH_ARGS(QSharedPointer<NetDevicePrivate>, dummyNetDevicePrivate, ( new NetDevicePrivate(QString()) ))
-
-
-QString NetDevice::iconName( Type type )
-{
- static const char* const IconName[] =
- {
- /*"unknown"*/"network-server", "scanner", "printer", "network-server-database", "network-server", "computer"
- };
-
- return QLatin1String(IconName[type]);
-}
-
-NetDevice::NetDevice()
- : d( *dummyNetDevicePrivate )
-{
-}
-
-NetDevice::NetDevice( NetDevicePrivate* _d )
- : d( _d )
-{
-}
-
-NetDevice::NetDevice( const NetDevice& other )
- : d( other.d )
-{
-}
-
-QString NetDevice::name() const {
- return d->name();
-}
-QString NetDevice::hostName() const {
- return d->hostName();
-}
-QString NetDevice::ipAddress() const {
- return d->ipAddress();
-}
-QString NetDevice::hostAddress() const {
- return d->hostAddress();
-}
-NetDevice::Type NetDevice::type() const {
- return d->type();
-}
-QList<NetService> NetDevice::serviceList() const {
- return d->serviceList();
-}
-
-
-NetDevice& NetDevice::operator =( const NetDevice& other )
-{
- d = other.d;
- return *this;
-}
-
-void NetDevice::setDPtr( NetDevicePrivate* _d )
-{
- d.reset(_d);
-}
-
-NetDevice::~NetDevice()
-{
-}
-
-}
diff --git a/network/network/netdevice.h b/network/network/netdevice.h
deleted file mode 100644
index e2c2e0f3..00000000
--- a/network/network/netdevice.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETDEVICE_H
-#define NETDEVICE_H
-
-// lib
-#include "molletnetwork_export.h"
-// Qt
-#include <QSharedPointer>
-
-namespace Mollet {
-class NetService;
-class NetDevice;
-}
-template < class T > class QList;
-class QString;
-class QDBusArgument;
-
-extern MOLLETNETWORK_EXPORT QDBusArgument& operator<<( QDBusArgument& argument, const Mollet::NetDevice& device );
-extern MOLLETNETWORK_EXPORT const QDBusArgument& operator>>( const QDBusArgument& argument, Mollet::NetDevice& device );
-
-
-namespace Mollet
-{
-
-class NetDevicePrivate;
-
-
-class MOLLETNETWORK_EXPORT NetDevice
-{
- friend class DNSSDNetworkBuilder;
- friend class UpnpNetworkBuilder;
- friend QDBusArgument& ::operator<<( QDBusArgument& argument, const NetDevice& device );
- friend const QDBusArgument& ::operator>>( const QDBusArgument& argument, NetDevice& device );
-
-public:
- // later has priority
- enum Type { Unknown = 0, Scanner, Printer, FileServer, Router, Workstation };
- static QString iconName( Type type );
-
-public:
- NetDevice();
- NetDevice( const NetDevice& other );
- virtual ~NetDevice();
-
-public:
- QString name() const;
- QString hostName() const;
- /// if hostName is not set, use ipAddress to identify device
- QString ipAddress() const;
- /// returns hostName if set, otherwise ipAddress TODO: find better name
- QString hostAddress() const;
- Type type() const;
- QList<NetService> serviceList() const;
-
-public:
- NetDevice& operator =( const NetDevice& other );
-
-private:
- explicit NetDevice( NetDevicePrivate* _d );
- void setDPtr( NetDevicePrivate* _d );
- NetDevicePrivate* dPtr() const;
-
-private:
- QSharedPointer<NetDevicePrivate> d;
-};
-
-typedef QList<NetDevice> NetDeviceList;
-
-
-inline NetDevicePrivate* NetDevice::dPtr() const {
- return const_cast<NetDevicePrivate*>( d.data() );
-}
-
-}
-
-#endif
diff --git a/network/network/netdevice_p.cpp b/network/network/netdevice_p.cpp
deleted file mode 100644
index edfee907..00000000
--- a/network/network/netdevice_p.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "netdevice_p.h"
-
-// library
-#include "netservice_p.h"
-// Qt
-#include <QMutableListIterator>
-
-
-namespace Mollet
-{
-
-NetDevicePrivate::NetDevicePrivate( const QString& name )
- : mName( name )
- , mType( NetDevice::Unknown )
-{
-}
-
-bool NetDevicePrivate::hasService( const QString& id ) const
-{
- bool result = false;
-
- for (const NetService& service : mServiceList) {
- const NetServicePrivate* const d = service.dPtr();
- if( d->id() == id )
- {
- result = true;
- break;
- }
- }
-
- return result;
-}
-
-NetService NetDevicePrivate::removeService( const QString& id )
-{
- NetService result;
- QMutableListIterator<NetService> it( mServiceList );
- while( it.hasNext())
- {
- const NetService& service = it.next();
- const NetServicePrivate* const d = service.dPtr();
- if( d->id() == id )
- {
- result = service;
- it.remove();
- break;
- }
- }
- return result;
-}
-
-NetDevicePrivate::~NetDevicePrivate()
-{
-}
-
-}
diff --git a/network/network/netdevice_p.h b/network/network/netdevice_p.h
deleted file mode 100644
index 33cdfb2f..00000000
--- a/network/network/netdevice_p.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETDEVICE_P_H
-#define NETDEVICE_P_H
-
-// lib
-#include "netdevice.h"
-#include "netservice.h"
-// Qt
-#include <QSharedData>
-#include <QString>
-#include <QList>
-
-
-namespace Mollet
-{
-
-class NetDevicePrivate : public QSharedData
-{
- public:
- explicit NetDevicePrivate( const QString& name );
- virtual ~NetDevicePrivate();
-
- public:
- const QString& name() const;
- const QString& hostName() const;
- const QString& ipAddress() const;
- const QString& hostAddress() const;
- NetDevice::Type type() const;
- const QList<NetService>& serviceList() const;
- bool hasService( const QString& id ) const;
-
- public:
- void setName( const QString& name );
- void setHostName( const QString& hostName );
- void setIpAddress( const QString& ipAddress );
- void setType( NetDevice::Type type );
- void addService( const NetService& service );
- NetService removeService( const QString& id );
-
- private:
- QString mName;
- QString mHostName;
- QString mIpAddress;
- NetDevice::Type mType;
- QList<NetService> mServiceList;
-};
-
-
-inline const QString& NetDevicePrivate::name() const { return mName; }
-inline const QString& NetDevicePrivate::hostName() const { return mHostName; }
-inline const QString& NetDevicePrivate::ipAddress() const { return mIpAddress; }
-inline NetDevice::Type NetDevicePrivate::type() const { return mType; }
-inline const QList<NetService>& NetDevicePrivate::serviceList() const { return mServiceList; }
-inline const QString& NetDevicePrivate::hostAddress() const { return mHostName.isEmpty() ? mIpAddress : mHostName; }
-
-inline void NetDevicePrivate::setName( const QString& name ) { mName = name; }
-inline void NetDevicePrivate::setHostName( const QString& hostName ) { mHostName = hostName; }
-inline void NetDevicePrivate::setIpAddress( const QString& ipAddress ) { mIpAddress = ipAddress; }
-inline void NetDevicePrivate::setType( NetDevice::Type type ) { mType = type; }
-inline void NetDevicePrivate::addService( const NetService& service ) { mServiceList.append( service ); }
-
-}
-
-#endif
diff --git a/network/network/netservice.cpp b/network/network/netservice.cpp
deleted file mode 100644
index 78546be8..00000000
--- a/network/network/netservice.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "netservice.h"
-#include "netservice_p.h"
-
-// lib
-#include "netdevice.h"
-// Qt
-#include <QGlobalStatic>
-
-
-namespace Mollet
-{
-
-//
-Q_GLOBAL_STATIC_WITH_ARGS(QSharedPointer<NetServicePrivate>,
- defaultEmptyNetServicePrivate,
- ( new NetServicePrivate(QString(),QString(),QString(),NetDevice(),QString(),QString()) ))
-
-
-NetService::NetService()
- : d( *defaultEmptyNetServicePrivate )
-{
-}
-
-NetService::NetService( NetServicePrivate* _d )
- : d( _d )
-{
-}
-
-NetService::NetService( const NetService& other )
- : d( other.d )
-{
-}
-
-QString NetService::name() const { return d->name(); }
-QString NetService::iconName() const { return d->iconName(); }
-QString NetService::type() const { return d->type(); }
-NetDevice NetService::device() const { return d->device(); }
-bool NetService::isValid() const { return !d->type().isEmpty(); } // was !d.isNull()
-QString NetService::url() const { return d->url(); }
-
-
-NetService& NetService::operator =( const NetService& other )
-{
- d = other.d;
- return *this;
-}
-
-void NetService::setDPtr( NetServicePrivate* _d )
-{
- d.reset(_d);
-}
-
-NetService::~NetService()
-{
-}
-
-}
diff --git a/network/network/netservice.h b/network/network/netservice.h
deleted file mode 100644
index 58fd5bd3..00000000
--- a/network/network/netservice.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETSERVICE_H
-#define NETSERVICE_H
-
-// lib
-#include "molletnetwork_export.h"
-// Qt
-#include <QSharedPointer>
-
-namespace Mollet {
-class NetDevice;
-class NetService;
-}
-template < class T > class QList;
-class QString;
-class QDBusArgument;
-
-extern MOLLETNETWORK_EXPORT QDBusArgument& operator<<( QDBusArgument& argument, const Mollet::NetService& service );
-extern MOLLETNETWORK_EXPORT const QDBusArgument& operator>>( const QDBusArgument& argument, Mollet::NetService& service );
-
-
-namespace Mollet
-{
-
-class NetServicePrivate;
-
-
-class MOLLETNETWORK_EXPORT NetService
-{
- friend class DNSSDNetworkBuilder;
- friend class UpnpNetworkBuilder;
- friend class NetDevicePrivate;
- friend QDBusArgument& ::operator<<( QDBusArgument& argument, const NetService& service );
- friend const QDBusArgument& ::operator>>( const QDBusArgument& argument, NetService& service );
-
-public:
- NetService();
- NetService( const NetService& other );
- virtual ~NetService();
-
-public:
- QString name() const;
- QString iconName() const;
- QString type() const;
- NetDevice device() const;
- bool isValid() const;
-
- // TODO: not sure all services come down to one url
- QString url() const;
-
-public:
- NetService& operator =( const NetService& other );
-
-private:
- explicit NetService( NetServicePrivate* _d );
- void setDPtr( NetServicePrivate* _d );
- NetServicePrivate* dPtr() const;
-
-private:
- QSharedPointer<NetServicePrivate> d;
-};
-
-typedef QList<NetService> NetServiceList;
-
-
-inline NetServicePrivate* NetService::dPtr() const {
- return const_cast<NetServicePrivate*>( d.data() );
-}
-
-}
-
-#endif
diff --git a/network/network/netservice_p.cpp b/network/network/netservice_p.cpp
deleted file mode 100644
index 9ca2584b..00000000
--- a/network/network/netservice_p.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009, 2011 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "netservice_p.h"
-
-
-namespace Mollet
-{
-
-NetServicePrivate::NetServicePrivate( const QString& name, const QString& iconName, const QString& type,
- const NetDevice& device, const QString& url, const QString& id )
- : mName( name )
- , mIconName( iconName )
- , mType( type )
- , mDevice( device )
- , mUrl( url )
- , mId( id )
-{
-}
-
-
-NetServicePrivate::~NetServicePrivate()
-{
-}
-
-}
diff --git a/network/network/netservice_p.h b/network/network/netservice_p.h
deleted file mode 100644
index 3bb517b8..00000000
--- a/network/network/netservice_p.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009, 2011 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETSERVICE_P_H
-#define NETSERVICE_P_H
-
-// lib
-#include "netdevice.h"
-#include "netservice.h"
-// Qt
-#include <QSharedData>
-#include <QString>
-
-
-namespace Mollet
-{
-
-class NetServicePrivate : public QSharedData
-{
- public:
- explicit NetServicePrivate( const QString& name, const QString& iconName, const QString& type,
- const NetDevice& device, const QString& url, const QString& id );
- virtual ~NetServicePrivate();
-
- public:
- const QString& name() const;
- const QString& iconName() const;
- const QString& type() const;
- const NetDevice& device() const;
- const QString& url() const;
- const QString& id() const;
-
- private:
- QString mName;
- QString mIconName;
- QString mType;
- NetDevice mDevice;
- QString mUrl;
- QString mId;
-};
-
-
-inline const QString& NetServicePrivate::name() const { return mName; }
-inline const QString& NetServicePrivate::iconName() const { return mIconName; }
-inline const QString& NetServicePrivate::type() const { return mType; }
-inline const NetDevice& NetServicePrivate::device() const { return mDevice; }
-inline const QString& NetServicePrivate::url() const { return mUrl; }
-inline const QString& NetServicePrivate::id() const { return mId; }
-
-}
-
-#endif
diff --git a/network/network/network.cpp b/network/network/network.cpp
deleted file mode 100644
index 7532d9e1..00000000
--- a/network/network/network.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "network.h"
-#include "network_p.h"
-
-// Qt
-#include <QGlobalStatic>
-#include <QList>
-
-
-namespace Mollet
-{
-
-Q_GLOBAL_STATIC( Network, networkSingleton )
-
-Network* Network::network()
-{
- return networkSingleton;
-}
-
-Network::Network()
- : d( new NetworkPrivate(this) )
-{
- d->init();
-}
-
-QList<NetDevice> Network::deviceList() const {
- return d->deviceList();
-}
-
-Network::~Network()
-{
-}
-
-}
-
-#include "moc_network.cpp"
diff --git a/network/network/network.h b/network/network/network.h
deleted file mode 100644
index 6eb43ad2..00000000
--- a/network/network/network.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORK_H
-#define NETWORK_H
-
-// lib
-#include "molletnetwork_export.h"
-// Qt
-#include <QObject>
-
-namespace Mollet {
-class NetDevice;
-class NetService;
-}
-template < class T > class QList;
-
-
-namespace Mollet
-{
-class NetworkPrivate;
-
-class MOLLETNETWORK_EXPORT Network : public QObject
-{
- Q_OBJECT
-
- friend class NetworkPrivate;
-
-public:
- static Network* network();
-
-public:
- Network();
- ~Network() override;
-
-public:
- QList<NetDevice> deviceList() const;
-
-Q_SIGNALS:
- void devicesAdded( const QList<NetDevice>& deviceList );
- void devicesRemoved( const QList<NetDevice>& deviceList );
- void servicesAdded( const QList<NetService>& serviceList );
- void servicesRemoved( const QList<NetService>& serviceList );
-
- void initDone();
-
-private:
- Q_PRIVATE_SLOT( d, void onBuilderInit() )
-
-private:
- NetworkPrivate* const d;
-};
-
-// void connect( Network& network, const char* signal, QObject* object, const char* slot );
-
-}
-
-#endif
diff --git a/network/network/network_p.cpp b/network/network/network_p.cpp
deleted file mode 100644
index d3253ad9..00000000
--- a/network/network/network_p.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "network_p.h"
-
-// lib
-#include "builder/dnssd/dnssdnetworkbuilder.h"
-#include "builder/upnp/upnpnetworkbuilder.h"
-#include "builder/simpleitemfactory.h"
-
-#include <QDebug>
-
-namespace Mollet
-{
-
-NetworkPrivate::NetworkPrivate( Network* parent )
- : p( parent )
-{
-}
-
-void NetworkPrivate::init()
-{
- SimpleItemFactory* simpleItemFactory = new SimpleItemFactory();
- mNetSystemFactoryList.append( simpleItemFactory );
-
- DNSSDNetworkBuilder* dnssdBuilder = new DNSSDNetworkBuilder( this );
- UpnpNetworkBuilder* upnpBuilder = new UpnpNetworkBuilder( this );
- mNetworkBuilderList.append( dnssdBuilder );
- mNetworkBuilderList.append( upnpBuilder );
- mNoOfInitBuilders = mNetworkBuilderList.count();
-
- for (AbstractNetworkBuilder* builder : qAsConst(mNetworkBuilderList)) {
- for (AbstractNetSystemFactory* factory : qAsConst(mNetSystemFactoryList)) {
- builder->registerNetSystemFactory( factory );
- }
- p->connect( builder, SIGNAL(initDone()), SLOT(onBuilderInit()) );
- builder->start();
- }
-}
-
-void NetworkPrivate::onBuilderInit()
-{
- --mNoOfInitBuilders;
- if( mNoOfInitBuilders == 0 )
- emit p->initDone();
-}
-
-NetworkPrivate::~NetworkPrivate()
-{
- qDeleteAll( mNetworkBuilderList );
- qDeleteAll( mNetSystemFactoryList );
-}
-
-}
diff --git a/network/network/network_p.h b/network/network/network_p.h
deleted file mode 100644
index 78a6e2b9..00000000
--- a/network/network/network_p.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORK_P_H
-#define NETWORK_P_H
-
-// lib
-#include "network.h"
-#include "netdevice.h"
-
-
-namespace Mollet
-{
-
-class AbstractNetworkBuilder;
-class AbstractNetSystemFactory;
-
-class NetworkPrivate
-{
-public:
- explicit NetworkPrivate( Network* parent );
- virtual ~NetworkPrivate();
-
-public:
- const QList<NetDevice>& deviceList() const;
- QList<NetDevice>& deviceList();
-
-public:
- void init();
- void onBuilderInit();
-
-public:
- void emitDevicesAdded( const QList<NetDevice>& deviceList );
- void emitDevicesRemoved( const QList<NetDevice>& deviceList );
- void emitServicesAdded( const QList<NetService>& serviceList );
- void emitServicesRemoved( const QList<NetService>& serviceList );
-
-private: // data
- Network* p;
- QList<NetDevice> mDeviceList;
- QList<AbstractNetworkBuilder*> mNetworkBuilderList;
- QList<AbstractNetSystemFactory*> mNetSystemFactoryList;
-
- int mNoOfInitBuilders;
-};
-
-
-inline const QList<NetDevice>& NetworkPrivate::deviceList() const { return mDeviceList; }
-inline QList<NetDevice>& NetworkPrivate::deviceList() { return mDeviceList; }
-
-inline void NetworkPrivate::emitDevicesAdded( const QList<NetDevice>& deviceList ) { emit p->devicesAdded( deviceList ); }
-inline void NetworkPrivate::emitDevicesRemoved( const QList<NetDevice>& deviceList ) { emit p->devicesRemoved( deviceList ); }
-inline void NetworkPrivate::emitServicesAdded( const QList<NetService>& serviceList ) { emit p->servicesAdded( serviceList ); }
-inline void NetworkPrivate::emitServicesRemoved( const QList<NetService>& serviceList ) { emit p->servicesRemoved( serviceList ); }
-
-}
-
-#endif
diff --git a/network/network/networkdbus.cpp b/network/network/networkdbus.cpp
deleted file mode 100644
index b13381e3..00000000
--- a/network/network/networkdbus.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#include "networkdbus.h"
-
-// network
-#include "netdevice_p.h"
-#include "netservice_p.h"
-// Qt
-#include <QDBusArgument>
-
-
-// TODO: Attention, we currently do not stream any references to other items, just the direct data!
-
-QDBusArgument& operator<<( QDBusArgument& argument, const Mollet::NetDevice& device )
-{
- Mollet::NetDevicePrivate* devicePrivate = device.dPtr();
-
- argument.beginStructure();
- argument << devicePrivate->name();
- argument << devicePrivate->hostName();
- argument << devicePrivate->ipAddress();
- argument << (int) devicePrivate->type();
- argument.endStructure();
-
- return argument;
-}
-const QDBusArgument& operator>>( const QDBusArgument& argument, Mollet::NetDevice& device )
-{
- QString name;
- QString hostName;
- QString ipAddress;
- int type;
-
- argument.beginStructure();
- argument >> name;
- argument >> hostName;
- argument >> ipAddress;
- argument >> type;
- argument.endStructure();
-
- Mollet::NetDevicePrivate* d = new Mollet::NetDevicePrivate( name );
- d->setHostName( hostName );
- d->setIpAddress( ipAddress );
- d->setType( (Mollet::NetDevice::Type)type );
-
- device.setDPtr( d );
-
- return argument;
-}
-
-QDBusArgument& operator<<( QDBusArgument& argument, const Mollet::NetService& service )
-{
- Mollet::NetServicePrivate* servicePrivate = service.dPtr();
-
- argument.beginStructure();
- argument << servicePrivate->name();
- argument << servicePrivate->iconName();
- argument << servicePrivate->type();
- argument << servicePrivate->url();
- argument << servicePrivate->id();
- argument.endStructure();
-
- return argument;
-}
-const QDBusArgument& operator>>( const QDBusArgument& argument, Mollet::NetService& service )
-{
- QString name;
- QString iconName;
- QString type;
- QString url;
- QString id;
-
- argument.beginStructure();
- argument >> name;
- argument >> iconName;
- argument >> type;
- argument >> url;
- argument >> id;
- argument.endStructure();
-
- Mollet::NetServicePrivate* d = new Mollet::NetServicePrivate( name, iconName, type, Mollet::NetDevice(), url, id );
-
- service.setDPtr( d );
-
- return argument;
-}
diff --git a/network/network/networkdbus.h b/network/network/networkdbus.h
deleted file mode 100644
index 46332b7d..00000000
--- a/network/network/networkdbus.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- This file is part of the Mollet network library, part of the KDE project.
-
- SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau at kde.org>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-#ifndef NETWORKDBUS_H
-#define NETWORKDBUS_H
-
-// lib
-#include "molletnetwork_export.h"
-#include "netdevice.h"
-#include "netservice.h"
-// Qt
-#include <QMetaType>
-
-
-// TODO: copying single items out of an interlinked structure does not work
-// classical problem with different address spaces.
-// instead just the item data is transferred for now. Perhaps this should become another data structure
-// which uses ids as reference to the linked data. Needs more use cases to get a better picture.
-// also needed: xml description for introspection and automagical creation of adaptor and interface
-
-
-MOLLETNETWORK_EXPORT QDBusArgument& operator<<( QDBusArgument& argument, const Mollet::NetDevice& device );
-MOLLETNETWORK_EXPORT const QDBusArgument& operator>>( const QDBusArgument& argument, Mollet::NetDevice& device );
-
-MOLLETNETWORK_EXPORT QDBusArgument& operator<<( QDBusArgument& argument, const Mollet::NetService& service );
-MOLLETNETWORK_EXPORT const QDBusArgument& operator>>( const QDBusArgument& argument, Mollet::NetService& service );
-
-Q_DECLARE_METATYPE(Mollet::NetDevice)
-Q_DECLARE_METATYPE(Mollet::NetService)
-Q_DECLARE_METATYPE(Mollet::NetDeviceList)
-Q_DECLARE_METATYPE(Mollet::NetServiceList)
-
-#endif
More information about the kde-doc-english
mailing list