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

List:       kde-commits
Subject:    playground/network/kbluetooth/src
From:       Alex Fiestas <alex () eyeos ! org>
Date:       2009-11-09 17:17:40
Message-ID: 1257787060.577396.9224.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1046775 by afiestas:

This may fix a large number of bugs when receiving files, the approach comes from a \
comment in kde-apps by user damjan, who detected the bug. Now is time to confirm, \
those fixes.

 M  +1 -6      obexserver/obexserver.cpp  
 M  +18 -19    trayicon.cpp  
 M  +1 -0      trayicon.h  


--- trunk/playground/network/kbluetooth/src/obexserver/obexserver.cpp \
#1046774:1046775 @@ -50,12 +50,7 @@
 	kDebug() << addr;
 
 	manager = new QDBusInterface(obexService,path,iface,dbusconn);
-	
-	//openObex service Must be present.
-	if(!manager->isValid()){
-		error = true;
-		return;
-	}
+
 	QList<QVariant> args;
 	args << addr << pattern << require_pairing;
 	kDebug() << args;
--- trunk/playground/network/kbluetooth/src/trayicon.cpp #1046774:1046775
@@ -184,7 +184,7 @@
 	serverAction->setCheckable(true);
 	KConfigGroup obexServerConfig(config, "ObexServer");
 	if(obexServerConfig.readEntry("Autostart") == "true") {
-		serverAction->setChecked(true);
+		serverAction->setChecked(false);
 	}
 
 	aboutAction = contextMenu()->addAction(KIcon("folder-remote"), i18n("About"), this, \
SLOT(showAboutInfo())); @@ -255,29 +255,22 @@
 	m_sendClipboardText->setEnabled(true);
 	m_sendMenu->setEnabled(true);
 
-	if (!server) {
-		server = new ObexServer(this, adapter->address(), "opp", false);
-		//TODO: Make this error beatiful
-		if(server->error){
-			delete server;
-			server = 0;
-			serverAction->setEnabled(false);
-			return;
-		}
-		connect(server, SIGNAL(openObexError()), this, SLOT(openObexError()));
-		connect(server, SIGNAL(serverReady()), this, SLOT(slotServerReady()));
-		connect(server, SIGNAL(started()), this, SLOT(slotServerStarted()));
-		connect(server, SIGNAL(stopped()), this, SLOT(slotServerStopped()));
-		connect(server, SIGNAL(closed()), this, SLOT(slotServerClosed()));
-		connect(server, SIGNAL(sessionCreated(const QString&)), this, \
                SLOT(slotServerSessionCreated(const QString&)));
-		connect(server, SIGNAL(sessionRemoved(const QString&)), this, \
                SLOT(slotServerSessionRemoved(const QString&)));
-		connect(server, SIGNAL(errorOccured(const QString&, const QString&)), this, \
                SLOT(slotServerErrorOccured(const QString&, const QString&)));
-	} else {
+	if (server) {
 		KConfigGroup obexServerConfig(config, "ObexServer");
 		server->start(config->group("ObexServer").readEntry("savePath"), true, false);
+	} else {
+		createObexServer();
 	}
 }
 
+void KBlueTray::createObexServer()
+{
+	//TODO: Make this error beatiful
+	server = new ObexServer(this, adapter->address(), "opp", false);
+	connect(server, SIGNAL(openObexError()), this, SLOT(openObexError()));
+	connect(server, SIGNAL(serverReady()), this, SLOT(slotServerReady()));
+}
+
 void KBlueTray::offlineMode()
 {
 	kDebug() << "offline Mode";
@@ -650,6 +643,12 @@
 			server->start(config->group("ObexServer").readEntry("savePath"), true, false);
 		}
 	}
+	connect(server, SIGNAL(started()), this, SLOT(slotServerStarted()));
+	connect(server, SIGNAL(stopped()), this, SLOT(slotServerStopped()));
+	connect(server, SIGNAL(closed()), this, SLOT(slotServerClosed()));
+	connect(server, SIGNAL(sessionCreated(const QString&)), this, \
SLOT(slotServerSessionCreated(const QString&))); +	connect(server, \
SIGNAL(sessionRemoved(const QString&)), this, SLOT(slotServerSessionRemoved(const \
QString&))); +	connect(server, SIGNAL(errorOccured(const QString&, const QString&)), \
this, SLOT(slotServerErrorOccured(const QString&, const QString&)));  \
updateTooltip();  }
 
--- trunk/playground/network/kbluetooth/src/trayicon.h #1046774:1046775
@@ -142,6 +142,7 @@
 	void onlineMode();
 	void offlineMode();
 
+	void createObexServer();
 	void slotPropertyChanged(const QString&, const QVariant&);
 	void adapterAdded(const QString&);
 	void adapterRemoved(const QString&);


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

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