Commit a5e17084 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

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/
parent 932c70eb
Pipeline #67949 passed with stage
in 2 minutes and 53 seconds
......@@ -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
......
......@@ -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)
......
kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR kioslave5/network)
<?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@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>
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 )
#! /usr/bin/env bash
$XGETTEXT $(find . -name *.cpp) -o $podir/kio5_network.pot
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@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.
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)
/*
This file is part of the network kioslave, part of the KDE project.
SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@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"
/*
This file is part of the network kioslave, part of the KDE project.
SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@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;
}
/*
This file is part of the network kioslave, part of the KDE project.
SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@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
[Desktop Entry]
Type=Link
URL=network:/
Icon=network-workgroup
Name=Network
Name[af]=Netwerk
Name[ar]=الشّبكة
Name[as]=নে'টৱৰ্ক
Name[be]=Сетка
Name[be@latin]=Sietka
Name[bg]=Мрежа
Name[bn]=নেটওয়ার্ক
Name[bn_IN]=নেটওয়ার্ক
Name[br]=Rouedad
Name[bs]=Mreža
Name[ca]=Xarxa
Name[ca@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@ijekavian]=Мрежа
Name[sr@ijekavianlatin]=Mreža
Name[sr@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@cyrillic]=Тармоқ
Name[vi]=Mạng
Name[wa]=Rantoele
Name[xh]=Umsebenzi womnatha
Name[x-test]=xxNetworkxx
Name[zh_CN]=网络
Name[zh_TW]=網路
{
"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
}
}
}
/*
This file is part of the network kioslave, part of the KDE project.
SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@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()
{
}
/*
This file is part of the network kioslave, part of the KDE project.
SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@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
/*
This file is part of the network kioslave, part of the KDE project.
SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "networkinitwatcher.h"
/*
This file is part of the network kioslave, part of the KDE project.
SPDX-FileCopyrightText: 2009 Friedrich W. H. Kossebau <kossebau@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