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