Commit 17effe0d authored by Jonathan Marten's avatar Jonathan Marten

Network ioslave: Port away from KDELibs4Support

Differential Revision: https://phabricator.kde.org/D5565
parent 149d2812
......@@ -22,8 +22,6 @@
#include "networkslave.h"
// KDE
#include <KComponentData>
// Qt
#include <QtCore/QCoreApplication>
......@@ -33,8 +31,8 @@ extern "C"
int Q_DECL_EXPORT kdemain( int argc, char** argv )
{
KComponentData componentData( "kio_network" );
QCoreApplication app( argc, argv );
app.setApplicationName(QLatin1String("kio_network"));
NetworkSlave slave( argv[1], argv[2], argv[3] );
slave.dispatchLoop();
......
......@@ -28,8 +28,7 @@
//Qt
#include <QtCore/QObject>
#include <QtCore/QMutex>
#include <KDebug>
#include <QtCore/QDebug>
using namespace Mollet;
......@@ -57,16 +56,16 @@ inline NetworkInitWatcher::NetworkInitWatcher( Network* network, QMutex* mutex )
}
inline NetworkInitWatcher::~NetworkInitWatcher()
{
kDebug();
qDebug();
}
inline void NetworkInitWatcher::onNetworkInitDone()
{
kDebug()<<"before unlock";
qDebug()<<"before unlock";
mMutex->unlock();
kDebug()<<"after unlock";
qDebug()<<"after unlock";
deleteLater();
kDebug()<<"after deleteLater";
qDebug()<<"after deleteLater";
}
#endif
......@@ -29,12 +29,9 @@
// network
#include <netdevice.h>
#include <netservice.h>
// KDE
#include <kde_file.h>
// Qt
#include <QtCore/QEventLoop>
#include <QDebug>
#include <QtCore/QDebug>
// static const char NetworkIconName[] = "network-workgroup";
......
......@@ -57,7 +57,7 @@ target_link_libraries( molletnetwork5
KF5::DNSSD
Qt5::Network
Qt5::Gui
KF5::KDELibs4Support # KSharedPtr
Qt5::DBus
)
if(SLP_FOUND)
target_link_libraries( molletnetwork5 PRIVATE ${SLP_LIBRARIES} )
......
......@@ -23,22 +23,18 @@
#ifndef MOLLETNETWORK_EXPORT_H
#define MOLLETNETWORK_EXPORT_H
// KDE
#include <kdemacros.h>
#ifndef MOLLETNETWORK_EXPORT
// building the library?
# if defined(MAKE_MOLLETNETWORK_LIB)
# define MOLLETNETWORK_EXPORT Q_DECL_EXPORT
// using the library
# else
# define MOLLETNETWORK_EXPORT KDE_IMPORT
# define MOLLETNETWORK_EXPORT Q_DECL_IMPORT
# endif
#endif
# ifndef MOLLETNETWORK_EXPORT_DEPRECATED
# define MOLLETNETWORK_EXPORT_DEPRECATED KDE_DEPRECATED MOLLETNETWORK_EXPORT
# define MOLLETNETWORK_EXPORT_DEPRECATED QT_DEPRECATED MOLLETNETWORK_EXPORT
# endif
#endif
......@@ -23,13 +23,10 @@
#include "netdevice.h"
#include "netdevice_p.h"
// KDE
#include <KGlobal>
namespace Mollet
{
K_GLOBAL_STATIC_WITH_ARGS(KSharedPtr< NetDevicePrivate >, dummyNetDevicePrivate, ( new NetDevicePrivate(QString()) ))
Q_GLOBAL_STATIC_WITH_ARGS(QSharedPointer<NetDevicePrivate>, dummyNetDevicePrivate, ( new NetDevicePrivate(QString()) ))
QString NetDevice::iconName( Type type )
......@@ -73,7 +70,7 @@ NetDevice& NetDevice::operator =( const NetDevice& other )
void NetDevice::setDPtr( NetDevicePrivate* _d )
{
d = _d;
d.reset(_d);
}
NetDevice::~NetDevice()
......
......@@ -25,8 +25,8 @@
// lib
#include "molletnetwork_export.h"
// KDE
#include <KSharedPtr>
// Qt
#include <QSharedPointer>
namespace Mollet {
class NetService;
......@@ -82,7 +82,7 @@ class MOLLETNETWORK_EXPORT NetDevice
NetDevicePrivate* dPtr() const;
private:
KSharedPtr<NetDevicePrivate> d;
QSharedPointer<NetDevicePrivate> d;
};
typedef QList<NetDevice> NetDeviceList;
......
......@@ -25,15 +25,15 @@
// lib
#include "netdevice.h"
// KDE
#include <KGlobal>
// Qt
#include <QGlobalStatic>
namespace Mollet
{
//
K_GLOBAL_STATIC_WITH_ARGS(KSharedPtr< NetServicePrivate >,
Q_GLOBAL_STATIC_WITH_ARGS(QSharedPointer<NetServicePrivate>,
defaultEmptyNetServicePrivate,
( new NetServicePrivate(QString(),QString(),QString(),NetDevice(),QString(),QString()) ))
......@@ -69,7 +69,7 @@ NetService& NetService::operator =( const NetService& other )
void NetService::setDPtr( NetServicePrivate* _d )
{
d = _d;
d.reset(_d);
}
NetService::~NetService()
......
......@@ -25,8 +25,8 @@
// lib
#include "molletnetwork_export.h"
// KDE
#include <KSharedPtr>
// Qt
#include <QSharedPointer>
namespace Mollet {
class NetDevice;
......@@ -78,7 +78,7 @@ class MOLLETNETWORK_EXPORT NetService
NetServicePrivate* dPtr() const;
private:
KSharedPtr<NetServicePrivate> d;
QSharedPointer<NetServicePrivate> d;
};
typedef QList<NetService> NetServiceList;
......
......@@ -23,18 +23,18 @@
#include "network.h"
#include "network_p.h"
// KDE
#include <KGlobal>
// Qt
#include <QtCore/QGlobalStatic>
#include <QtCore/QList>
namespace Mollet
{
Q_GLOBAL_STATIC( Network, networkSingleton )
Network* Network::network()
{
K_GLOBAL_STATIC( Network, networkSingleton )
return networkSingleton;
}
......
......@@ -49,6 +49,7 @@ class MOLLETNETWORK_EXPORT Network : public QObject
static Network* network();
public:
Network();
virtual ~Network();
public:
......@@ -63,7 +64,6 @@ class MOLLETNETWORK_EXPORT Network : public QObject
void initDone();
private:
Network();
Q_PRIVATE_SLOT( d, void onBuilderInit() )
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment