File session-management.diff of Package kdebluetooth4

Index: src/inputwizard/wizarddialog.cpp
===================================================================
--- src/inputwizard/wizarddialog.cpp	(revision 912807)
+++ src/inputwizard/wizarddialog.cpp	(revision 927433)
@@ -35,37 +35,46 @@
 #define AGENT_PATH "/kbluetooth4_wizard_agent"
 
 
-BTWizard::BTWizard(QObject* parent) : QWizard(), btmanager(Solid::Control::BluetoothManager::self()), m_parent(parent)
+BTWizard::BTWizard(QApplication* parent) : QWizard(), btmanager(Solid::Control::BluetoothManager::self()), m_parent(parent)
 {
-	iface = new Solid::Control::BluetoothInterface(btmanager.defaultInterface());
 
-	addPage(createIntroPage());
-	addPage(createSelectServicePage());
-	addPage(createSelectDevicePage());
-	addPage(createConnectionPage());
+        iface = 0;
+        introPage = 0;
+        servicePage = 0;
+        devicePage = 0;
+        connPage = 0;
+        finalPage = 0;
+
+        setAttribute(Qt::WA_DeleteOnClose);
+        iface = new Solid::Control::BluetoothInterface(btmanager.defaultInterface());
+
+        addPage(createIntroPage());
+        addPage(createSelectServicePage());
+        addPage(createSelectDevicePage());
+        addPage(createConnectionPage());
         addPage(createFinalPage());
-	setWindowIcon(KIcon("kbluetooth4"));
-	setWindowTitle("Bluetooth Device Wizard");
+        setWindowIcon(KIcon("kbluetooth4"));
+        setWindowTitle("Bluetooth Device Wizard");
 
-	
-	connect(button(QWizard::CancelButton),SIGNAL(clicked()),this,SLOT(slotCancel()));
-	connect(button(QWizard::NextButton),SIGNAL(clicked()),this,SLOT(slotNext()));
-	connect(button(QWizard::FinishButton),SIGNAL(clicked()),this,SLOT(slotFinish()));
 
+        connect(button(QWizard::CancelButton),SIGNAL(clicked()),this,SLOT(slotCancel()));
+        connect(button(QWizard::NextButton),SIGNAL(clicked()),this,SLOT(slotNext()));
+        connect(button(QWizard::FinishButton),SIGNAL(clicked()),this,SLOT(slotFinish()));
+
         normalPixmap = KIcon("kbluetooth4").pixmap(128,128);
         flashPixmap = KIcon("kbluetooth4-flashing").pixmap(128,128);
 
-	setPixmap(QWizard::WatermarkPixmap,normalPixmap);
+        setPixmap(QWizard::WatermarkPixmap,normalPixmap);
         logoTimer = new QTimer(this);
         connect(logoTimer, SIGNAL(timeout()), this, SLOT(setFlashingLogo()));
-	show();
+        show();
 }
 
 BTWizard::~BTWizard()
 {
 	kDebug() << "Deleting Wizard";
-
-        iface->stopDiscovery();
+        if (iface)
+            iface->stopDiscovery();
 	if (introPage)
 		delete introPage;
 	if (servicePage)
Index: src/inputwizard/main.cpp
===================================================================
--- src/inputwizard/main.cpp	(revision 912807)
+++ src/inputwizard/main.cpp	(revision 927433)
@@ -22,21 +22,20 @@
  *
 */
 
-#include <kuniqueapplication.h>
+#include <QApplication>
 #include <iostream>
 #include <kcomponentdata.h>
 #include <kaboutdata.h>
 #include <kcmdlineargs.h>
+#include <solid/control/bluetoothmanager.h>
 
 #include "wizarddialog.h"
-#include "../agent/agent.h"
 
 
 int main(int argc, char *argv[])
 {
 	
-static const char *description =
-    I18N_NOOP("kbluetooth4-wizard");
+static const char *description = I18N_NOOP("kbluetooth4-wizard");
 
 	KAboutData aboutData("kbluetooth4-wizard",
                I18N_NOOP("KBluetooth4-Wizard"),
@@ -44,33 +43,23 @@
        	ki18n(description), KAboutData::License_GPL);
 	aboutData.addAuthor(ki18n("Tom Patzig"), KLocalizedString(), "tpatzig@suse.de", "http://www.kde.org/");
 
-	
+    std::cout << "Bluetooth Adapters" << std::endl;
     KComponentData component(&aboutData);
 
-    KCmdLineArgs::init( argc, argv, &aboutData );
+    //KCmdLineArgs::init( argc, argv, &aboutData );
+    //KUniqueApplication::addCmdLineOptions();
 
-    KUniqueApplication::addCmdLineOptions();
-
-    
-    if (!KUniqueApplication::start()) {
-	fprintf(stderr, "KBluetooth4-Wizard is already running!\n");
+    Solid::Control::BluetoothManager& btmanager = Solid::Control::BluetoothManager::self();
+    if (btmanager.bluetoothInterfaces().size() == 0) {
+        fprintf(stderr, "No Bluetooth Adapter found!\n");
         return 0;
     }
 
+    QApplication a(argc,argv);
 
-    KUniqueApplication a;
+    a.setQuitOnLastWindowClosed( true );
 
-    a.disableSessionManagement();
-    a.setQuitOnLastWindowClosed( false );
-/*   //CreatePairedDevice Mode //
-    const QString path = "/kbluetooth4_wizard_agent";
-    QDBusConnection::systemBus().registerObject(path, &a);
-    new Agent(&a);
-*/
+    BTWizard wiz(&a);
 
-    
-    BTWizard wiz;
-    
     return wiz.exec();
-
 }
Index: src/inputwizard/wizarddialog.h
===================================================================
--- src/inputwizard/wizarddialog.h	(revision 912807)
+++ src/inputwizard/wizarddialog.h	(revision 927433)
@@ -45,13 +45,13 @@
 Q_OBJECT
 
 public:
-	BTWizard(QObject* parent = 0);
+	BTWizard(QApplication* parent = 0);
 	~BTWizard();
 
 
 private:
 	const Solid::Control::BluetoothManager& btmanager;
-        QObject* m_parent;
+        QApplication* m_parent;
 	Solid::Control::BluetoothInterface* iface;
         Solid::Control::BluetoothRemoteDeviceList devList;
         Solid::Control::BluetoothRemoteDevice* remoteDev;
Index: src/obexserver/obexserver.cpp
===================================================================
--- src/obexserver/obexserver.cpp	(revision 912807)
+++ src/obexserver/obexserver.cpp	(revision 927433)
@@ -97,12 +97,14 @@
 
 void ObexServer::stop() {
 	kDebug() << "obex server stopped";
-	session->call(QDBus::BlockWithGui, "Stop");
+	//session->call(QDBus::BlockWithGui, "Stop");
+	session->call("Stop");
 }
 
 void ObexServer::close() {
 	kDebug() << "obex server closed";
-	session->call(QDBus::BlockWithGui, "Close");
+	//session->call(QDBus::BlockWithGui, "Close");
+	session->call("Close");
 }
 
 bool ObexServer::isStarted() {
Index: src/adapterconfig.cpp
===================================================================
--- src/adapterconfig.cpp	(revision 912807)
+++ src/adapterconfig.cpp	(revision 927433)
@@ -118,6 +118,8 @@
 
 void AdapterConfig::slotQuit()
 {
+        emit adapterConfigClosed();
+        kDebug() << "ConfigClosed";
 	close();
 }
 
Index: src/adapterconfig.h
===================================================================
--- src/adapterconfig.h	(revision 912807)
+++ src/adapterconfig.h	(revision 927433)
@@ -65,6 +65,8 @@
 	void setTabName(AdapterWidget*, QString);
 	void adapterAdded(const QString&);
 	void adapterRemoved(const QString&);
+signals:
+        void adapterConfigClosed();
 
 };
 
Index: src/agent/agent.cpp
===================================================================
--- src/agent/agent.cpp	(revision 912807)
+++ src/agent/agent.cpp	(revision 927433)
@@ -27,17 +27,13 @@
 
 #include "agent.h"
 
-Agent::Agent( QApplication* application) : QDBusAbstractAdaptor(application), app(application)
+Agent::Agent( QApplication* application, Solid::Control::BluetoothInterface* iface) : QDBusAbstractAdaptor(application), app(application), adapter(iface)
 {
     exitOnReleaseVal = false;
 
-    Solid::Control::BluetoothManager &man = Solid::Control::BluetoothManager::self();	
-    adapter = new Solid::Control::BluetoothInterface(man.defaultInterface());
-
     passkeyDialog = new PasskeyDialog(this);
     authDialog = new AuthDialog(this);
 
-    
     connect(passkeyDialog,SIGNAL(okClicked()),this,SLOT(slotOkClicked()));
 
     qDebug() << "AGENT registered !";
@@ -45,10 +41,17 @@
 
 Agent::~Agent()
 {
-//   if (adapter)
-//        delete adapter;
+    delete authDialog;
+    delete passkeyDialog;
+    qDebug() << "Agent deleted";
 }
 
+
+void Agent::setBluetoothInterface(Solid::Control::BluetoothInterface* iface)
+{
+    adapter = iface;
+}
+
 bool Agent::exitOnRelease()
 {
     return exitOnReleaseVal;
Index: src/agent/agent.h
===================================================================
--- src/agent/agent.h	(revision 912807)
+++ src/agent/agent.h	(revision 927433)
@@ -31,8 +31,8 @@
 #include <QtDBus>
 #include <QApplication>
 #include <QDebug>
-#include <solid/control/bluetoothmanager.h>
 #include <solid/control/bluetoothinterface.h>
+#include <solid/control/bluetoothremotedevice.h>
 
 #include "authdialog.h"
 #include "passkeydialog.h"
@@ -47,11 +47,12 @@
 
 public:
 
-    Agent(QApplication* application);
+    Agent(QApplication* application,Solid::Control::BluetoothInterface*);
     ~Agent();
 
     bool exitOnRelease();
     void setExitOnRelease(bool val);
+    void setBluetoothInterface(Solid::Control::BluetoothInterface* iface);
 
 public slots:
 
Index: src/obexsession/obexsession.cpp
===================================================================
--- src/obexsession/obexsession.cpp	(revision 912807)
+++ src/obexsession/obexsession.cpp	(revision 927433)
@@ -52,7 +52,8 @@
 	args << addr << srcAddr << service;
 
 	manager->callWithCallback( method, args, this, SLOT(sessionCreated(QDBusObjectPath)), SLOT(sessionCreatedError(QDBusError)) );
-	dbusconn.connect("",path,iface,"SessionConnected",this,SLOT(slotConnected()));	
+	dbusconn.connect("",path,iface,"SessionConnected",this,SLOT(slotConnected(QDBusObjectPath)));	
+	dbusconn.connect("",path,iface,"SessionConnectError",this,SLOT(slotConnectError(QDBusObjectPath,QString,QString)));	
 
 
 }
@@ -223,11 +224,17 @@
 	emit cancelled();
 }
 
-void ObexSession::slotConnected()
+void ObexSession::slotConnected(QDBusObjectPath path)
 {
+        kDebug() << "Session connected " <<  path.path();
 	emit connected();
 }
 
+void ObexSession::slotConnectError(QDBusObjectPath path, QString err_name, QString err_msg)
+{
+    kDebug() << "Session Connect Error " << err_name << " " << err_msg;
+}
+
 void ObexSession::slotDisconnected()
 {
 	emit disconnected();
Index: src/obexsession/obexsession.h
===================================================================
--- src/obexsession/obexsession.h	(revision 912807)
+++ src/obexsession/obexsession.h	(revision 927433)
@@ -73,13 +73,14 @@
 	void sessionCreatedError(QDBusError);
 
 	void slotCancelled();
-	void slotConnected();
+	void slotConnected(QDBusObjectPath);
 	void slotDisconnected();
 	void slotClosed();
 	void slotTransferStarted(const QString& filename, const QString& local_path, qulonglong total_bytes);
 	void slotTransferProgress(qulonglong bytes_transferred);
 	void slotTransferCompleted();
 	void slotErrorOccurred(const QString& error_name, const QString& error_message);
+        void slotConnectError(QDBusObjectPath path, QString err_name, QString err_msg);
 
 
 signals:
Index: src/main.cpp
===================================================================
--- src/main.cpp	(revision 912807)
+++ src/main.cpp	(revision 927433)
@@ -58,11 +58,8 @@
         return 0;
     }
 
-//  QApplication a(argc, argv);
-
     KUniqueApplication a;
 
-    a.disableSessionManagement();
     a.setQuitOnLastWindowClosed( false );
 
     const QString path = "/kbluetooth4_agent";
Index: src/adapterwidget.cpp
===================================================================
--- src/adapterwidget.cpp	(revision 912807)
+++ src/adapterwidget.cpp	(revision 927433)
@@ -40,8 +40,8 @@
 	connect(nameLineEdit,SIGNAL(editingFinished()),this,SLOT(slotNameChanged()));
 
 
-	connect(iface,SIGNAL(discoverableTimeoutChanged(int)),this,SLOT(setDiscoverableTimeout(int)));
-	connect(iface,SIGNAL(nameChanged(const QString&)),this,SLOT(setName(QString)));
+	//connect(iface,SIGNAL(discoverableTimeoutChanged(int)),this,SLOT(setDiscoverableTimeout(int)));
+	//connect(iface,SIGNAL(nameChanged(const QString&)),this,SLOT(setName(QString)));
 
 }
 
Index: src/device-manager/devicemanager.h
===================================================================
--- src/device-manager/devicemanager.h	(revision 912807)
+++ src/device-manager/devicemanager.h	(revision 927433)
@@ -45,11 +45,11 @@
 Q_OBJECT
 
 public:
-	 DeviceMan(QObject* parent = 0);
+	 DeviceMan(QApplication* parent = 0);
 	 ~DeviceMan();
 	 
 private:
-         QObject* m_parent;
+         QApplication* m_parent;
 	 Solid::Control::BluetoothRemoteDeviceList devList;
 	 Solid::Control::BluetoothInterface* iface;
 	 void getConfiguredDevices();
Index: src/device-manager/main.cpp
===================================================================
--- src/device-manager/main.cpp	(revision 912807)
+++ src/device-manager/main.cpp	(revision 927433)
@@ -22,8 +22,7 @@
  *
 */
 
-//#include <kuniqueapplication.h>
-#include <KApplication>
+#include <QApplication>
 #include <iostream>
 #include <kcomponentdata.h>
 #include <kaboutdata.h>
@@ -47,26 +46,18 @@
 	
     KComponentData component(&aboutData);
 
-    KCmdLineArgs::init( argc, argv, &aboutData );
-
-//    KUniqueApplication::addCmdLineOptions();
-
-/*    
-    if (!KUniqueApplication::start()) {
-	fprintf(stderr, "KBluetooth4 Device-Manager is already running!\n");
+    Solid::Control::BluetoothManager& btmanager = Solid::Control::BluetoothManager::self();
+    if (btmanager.bluetoothInterfaces().size() == 0) {
+        fprintf(stderr, "No Bluetooth Adapter found!\n");
         return 0;
     }
-*/
 
-    KApplication a;
+    QApplication a(argc,argv);
 
-//    a.disableSessionManagement();
-//    a.setQuitOnLastWindowClosed( true );
+    a.setQuitOnLastWindowClosed( true );
 
-    
-    DeviceMan manager;
+    DeviceMan manager(&a);
     manager.show();
-    
-    return a.exec();
 
+    return a.exec();
 }
Index: src/device-manager/devicemanager.cpp
===================================================================
--- src/device-manager/devicemanager.cpp	(revision 912807)
+++ src/device-manager/devicemanager.cpp	(revision 927433)
@@ -36,52 +36,57 @@
 #define HID "00001124-0000-1000-8000-00805F9B34FB"
 #define FTP "00001106-0000-1000-8000-00805F9B34FB"
 
-DeviceMan::DeviceMan(QObject* parent) : Ui_DeviceManager(), m_parent(parent)
+DeviceMan::DeviceMan(QApplication* parent) : Ui_DeviceManager(), m_parent(parent)
 {
 //	 setAttribute(Qt::WA_DeleteOnClose);
 
 	 Solid::Control::BluetoothManager &man = Solid::Control::BluetoothManager::self();
+         if (man.bluetoothInterfaces().size() > 0) {
 
-	 iface = new Solid::Control::BluetoothInterface(man.defaultInterface());
+             iface = new Solid::Control::BluetoothInterface(man.defaultInterface());
 
-	 connect(iface,SIGNAL(deviceCreated(const QString&)),this,SLOT(slotDeviceAdded(const QString&)));
-	 connect(iface,SIGNAL(deviceRemoved(const QString&)),this,SLOT(slotDeviceRemoved(const QString&)));
+             connect(iface,SIGNAL(deviceCreated(const QString&)),this,SLOT(slotDeviceAdded(const QString&)));
+             connect(iface,SIGNAL(deviceRemoved(const QString&)),this,SLOT(slotDeviceRemoved(const QString&)));
 
-	 kDebug() << "Device Manager - Welcome";
-//	 setParent(kapp);
-	 setupUi(this);
-	 setWindowIcon(KIcon("kbluetooth4"));
+             kDebug() << "Device Manager - Welcome";
+    //	 setParent(kapp);
+             setupUi(this);
+             setWindowIcon(KIcon("kbluetooth4"));
 
-//	 connect(closeButton,SIGNAL(clicked(bool)),this,SLOT(slotQuitApp(bool)));
-	 connect(newDevButton,SIGNAL(clicked(bool)),this,SLOT(slotStartWizard(bool)));
-	 connect(removeButton,SIGNAL(clicked(bool)),this,SLOT(slotRemoveDevice(bool)));
+    //	 connect(closeButton,SIGNAL(clicked(bool)),this,SLOT(slotQuitApp(bool)));
+             connect(newDevButton,SIGNAL(clicked(bool)),this,SLOT(slotStartWizard(bool)));
+             connect(removeButton,SIGNAL(clicked(bool)),this,SLOT(slotRemoveDevice(bool)));
 
-	 connect(actionConnect,SIGNAL(triggered(bool)),this,SLOT(slotConnectDevice(bool)));
-	 connect(actionRemove_Trust,SIGNAL(triggered(bool)),this,SLOT(slotChangeTrust(bool)));
-	 connect(actionRemove,SIGNAL(triggered(bool)),this,SLOT(slotRemoveDevice(bool)));
-	 connect(actionNew,SIGNAL(triggered(bool)),this,SLOT(slotStartWizard(bool)));
+             connect(actionConnect,SIGNAL(triggered(bool)),this,SLOT(slotConnectDevice(bool)));
+             connect(actionRemove_Trust,SIGNAL(triggered(bool)),this,SLOT(slotChangeTrust(bool)));
+             connect(actionRemove,SIGNAL(triggered(bool)),this,SLOT(slotRemoveDevice(bool)));
+             connect(actionNew,SIGNAL(triggered(bool)),this,SLOT(slotStartWizard(bool)));
 
-	 connect(menuEdit,SIGNAL(aboutToShow()),this,SLOT(slotMenuActive()));
-	 
-	 connect(deviceListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(slotShowDetails()));
+             connect(menuEdit,SIGNAL(aboutToShow()),this,SLOT(slotMenuActive()));
+             
+             connect(deviceListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(slotShowDetails()));
 
-	 inputDeviceMap = new QMap<QString,Solid::Control::BluetoothInputDevice*>;
-	 remoteDeviceMap = new QMap<QString,Solid::Control::BluetoothRemoteDevice*>;
-	 show();
-	 actionConnect->setEnabled(false);
-	 actionRemove->setEnabled(false);
-	 actionRemove_Trust->setEnabled(false);
-	 removeButton->setEnabled(false);
-	 
-	 actionQuit->setIcon(KIcon("window-close"));
-	 actionConnect->setIcon(KIcon("applications-internet"));
-	 actionRemove->setIcon(KIcon("user-trash"));
-	 actionNew->setIcon(KIcon("list-add"));
-	 actionRemove_Trust->setIcon(KIcon("dialog-password"));
-	 
-	 current = 0;
-	 
-	 getConfiguredDevices();
+             inputDeviceMap = new QMap<QString,Solid::Control::BluetoothInputDevice*>;
+             remoteDeviceMap = new QMap<QString,Solid::Control::BluetoothRemoteDevice*>;
+             show();
+             actionConnect->setEnabled(false);
+             actionRemove->setEnabled(false);
+             actionRemove_Trust->setEnabled(false);
+             removeButton->setEnabled(false);
+             
+             actionQuit->setIcon(KIcon("window-close"));
+             actionConnect->setIcon(KIcon("applications-internet"));
+             actionRemove->setIcon(KIcon("user-trash"));
+             actionNew->setIcon(KIcon("list-add"));
+             actionRemove_Trust->setIcon(KIcon("dialog-password"));
+             
+             current = 0;
+             
+             getConfiguredDevices();
+         } else {
+             kDebug() << "No Bluetooth Adapter found";
+             close();
+        }
 }
 
 DeviceMan::~DeviceMan()
Index: src/trayicon.cpp
===================================================================
--- src/trayicon.cpp	(revision 912807)
+++ src/trayicon.cpp	(revision 927433)
@@ -45,11 +45,10 @@
 
 //	 kbluelockMenu = mainmenu->addMenu(KIcon("system-lock-screen"),i18n("KBlueLock"));
 
-/*       Currently no DeviceDisappeared Signal is thrown by Bluez
+//       Currently no DeviceDisappeared Signal is thrown by Bluez
 
          kbluelockMenu = mainmenu->addMenu(KIcon("preferences-desktop-user-password"),i18n("KBlueLock"));
 	 
-
 	 lockEnableAction = kbluelockMenu->addAction(KIcon("system-lock-screen"),i18n("Enable"));
 	 lockEnableAction->setCheckable(true);
 	 lockEnableAction->setChecked(false);
@@ -58,7 +57,6 @@
 	 lockConfigureAction = kbluelockMenu->addAction(KIcon("configure"), i18n("Configure..."));
 	 connect(lockConfigureAction,SIGNAL(triggered(bool)), this, SLOT(slotConfigureKBlueLock()));
 	 lockConfigureAction->setDisabled(true);
-*/
 
 	 sendToAction = mainmenu->addAction(KIcon("text-directory"), i18n("Send File"));
 	 connect(sendToAction, SIGNAL(triggered(bool)), this, SLOT(sendFile()));
@@ -133,6 +131,8 @@
 		adapter->stopDiscovery();
 		delete adapter;
 	}
+        if (agent)
+            delete agent;
 
 	if (session)
 		delete session;
@@ -180,7 +180,9 @@
 	kDebug() << "Adapter found " << adapter->name();
 
         adapter->registerAgent(agentPath,"DisplayYesNo");
-        agent = new Agent(kapp);
+        if (!agent)
+            agent = new Agent(kapp,adapter);
+        agent->setBluetoothInterface(adapter);
         agent->setExitOnRelease(false);
 	
 	updateTooltip();
@@ -190,7 +192,6 @@
 	adapterAction->setEnabled(true);
 //	kbluelockMenu->setEnabled(true);
         settingsMenu->setEnabled(true);
-	serverAction->setChecked(true);
 
         if (!server) {
             server = new ObexServer(this, "00:00:00:00:00:00", "opp", true);
@@ -202,9 +203,10 @@
             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
-            enableServer();
+	    server->start(QDir::homePath()+"/.kbluetooth4", true, false);
 
 
+
 }
 
 void KBlueTray::offlineMode()
@@ -229,16 +231,11 @@
 		delete adapter;
 		adapter = 0;
 	}
-
-        if (agent) {
-            delete agent;
-            agent = 0;
-        }
 	
 	if(server) {
 		server->stop();
 	}
-	
+
 	if(serversession) {
 		serversession->cancel();
 		serversession->disconnect();
@@ -246,11 +243,10 @@
 		serversession = 0;
 	}
 
-
 }
 
 void KBlueTray::updateTooltip() {
-	
+        kDebug() << "Updating Tooltip";	
 	if(!online) {
 		toolTipInfo = i18n("No Bluetooth Adapter");
 		return;
@@ -327,11 +323,12 @@
 
 void KBlueTray::showAdapterInterface()
 {
-	if (!adapterConfig)
+	if (!adapterConfig) {
 		adapterConfig = new AdapterConfig(this);
+                connect(adapterConfig,SIGNAL(adapterConfigClosed()),this,SLOT(updateTooltip()));
+        }
 
 	adapterConfig->initialize();
-
 }
 
 void KBlueTray::showWizard()
@@ -355,7 +352,7 @@
 
 void KBlueTray::sendFile()
 {
-// bluez4//    
+
 	QString fileName = KFileDialog::getOpenFileName(KUrl("./"),"*",mainmenu, tr("Select File"));
         if (!fileName.isEmpty()) {
 		fileToSend = fileName;
@@ -425,6 +422,11 @@
 	session->disconnect();
 	session->close();
 
+        if (progress) {
+            delete progress;
+            progress = 0;
+        }
+
 	delete session;
 	session = 0;
 
openSUSE Build Service is sponsored by