[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/kdnssd/ioslave
From:       Friedrich W. H. Kossebau <kossebau () kde ! org>
Date:       2009-01-30 20:29:00
Message-ID: 1233347340.467032.25857.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 918839 by kossebau:

cleanup: removed unneeded includes and reduced kde_main to the minimum needed (by \
examples of kio-slaves from kdebase).

 M  +15 -39    dnssd.cpp  
 M  +8 -11     dnssd.h  


--- trunk/KDE/kdenetwork/kdnssd/ioslave/dnssd.cpp #918838:918839
@@ -20,29 +20,12 @@
 
 #include "dnssd.h"
 
-#include <stdlib.h>
-#include <math.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <netinet/in.h>
-#include <netdb.h>
+#include <KComponentData>
+#include <KProtocolInfo>
 
-#include <kconfig.h>
-#include <kconfiggroup.h>
-#include <kmessagebox.h>
-#include <kcomponentdata.h>
-#include <kglobal.h>
-#include <kstandarddirs.h>
-#include <kprotocolinfo.h>
-#include <kcmdlineargs.h>
-#include <klocale.h>
-#include <kurl.h>
-#include <kapplication.h>
-#include <dnssd/domainbrowser.h>
-#include <krun.h>
-#include <kprotocolmanager.h>
+#include <QtCore/QCoreApplication>
 
+
 ZeroConfProtocol::ZeroConfProtocol(const QByteArray& protocol, const QByteArray \
&pool_socket, const QByteArray &app_socket)  : SlaveBase(protocol, pool_socket, \
app_socket), browser(0),toResolve(0)  {
@@ -239,27 +222,20 @@
 	eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
 }
 
+
 extern "C"
 {
-	int KDE_EXPORT kdemain( int argc, char **argv )
-	{
-		// KApplication is necessary to use other ioslaves
-		putenv(strdup("SESSION_MANAGER="));
-		KCmdLineArgs::init(argc, argv, "kio_zeroconf", 0, KLocalizedString(), 0, \
KLocalizedString()); +    int KDE_EXPORT kdemain( int argc, char **argv )
+    {
+        // necessary to use other kio slaves
+        KComponentData componentData("kio_zeroconf");
+        QCoreApplication app(argc,argv);
 
-		KCmdLineOptions options;
-		options.add("+protocol", ki18n( "Protocol name" ));
-		options.add("+pool", ki18n( "Socket name" ));
-		options.add("+app", ki18n( "Socket name" ));
-		KCmdLineArgs::addCmdLineOptions( options );
-		//KApplication::disableAutoDcopRegistration();
-		KApplication app;
-		KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
-		ZeroConfProtocol slave( args->arg(0).toLocal8Bit(), args->arg(1).toLocal8Bit(), \
                args->arg(2).toLocal8Bit() );
-		args->clear();
-		slave.dispatchLoop();
-		return 0;
-	}
+        // start the slave
+        ZeroConfProtocol slave(argv[1],argv[2],argv[3]);
+        slave.dispatchLoop();
+        return 0;
+    }
 }
 
 
--- trunk/KDE/kdenetwork/kdnssd/ioslave/dnssd.h #918838:918839
@@ -21,18 +21,15 @@
 #ifndef _dnssd_H_
 #define _dnssd_H_
 
-#include <qstring.h>
-#include <qobject.h>
+#include <DNSSD/ServiceBrowser>
+#include <dnssd/servicetypebrowser.h> // missing CamelCase version, can be fixed \
beginning 02.02.09 +#include <DNSSD/RemoteService>
 
-#include <kurl.h>
-#include <kio/global.h>
-#include <kio/slavebase.h>
-#include <dnssd/servicebrowser.h>
-#include <dnssd/servicetypebrowser.h>
-#include <dnssd/remoteservice.h>
-#include <qstringlist.h>
+#include <KIO/SlaveBase>
 
+#include <QtCore/QObject>
 
+
 using namespace KIO;
 using namespace DNSSD;
 
@@ -61,7 +58,7 @@
 	virtual void mimetype(const KUrl& url);
 	virtual void stat(const KUrl& url);
 	virtual void listDir(const KUrl& url );
-signals:
+Q_SIGNALS:
 	void leaveModality();
 private:
 	// Create UDSEntry for zeroconf:/ or zeroconf:/type/ paths
@@ -84,7 +81,7 @@
 	RemoteService *toResolve;
 	QHash<QString,ProtocolData> knownProtocols;
 	
-private slots:
+private Q_SLOTS:
 	void newType(const QString&);
 	void newService(DNSSD::RemoteService::Ptr);
 	void allReported();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic