-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 3 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 4d476ac..22b16d2 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp @@ -1,37 +1,36 @@ /* * bluebase.cpp * * --------------------- * - * begin : Sun 10 17:20:00 CEST 2002 * copyright : (c) 2002 by Maximilian Reiß * email : max.reiss@gmx.de * */ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "bluebase.h" #include "scandialog.h" #include <qframe.h> #include <qlabel.h> #include <qpushbutton.h> #include <qlayout.h> #include <qvariant.h> #include <qwhatsthis.h> #include <qimage.h> #include <qpixmap.h> #include <qtabwidget.h> #include <qscrollview.h> #include <qvbox.h> #include <qmessagebox.h> #include <qapplication.h> #include <qcheckbox.h> #include <qlineedit.h> #include <qlistview.h> @@ -272,52 +271,52 @@ namespace OpieTooth { void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column) { } /* * Search and display avail. services for a device (on expand from device listing) * */ void BlueBase::addServicesToDevice( QListViewItem * item ) { // row of mac adress RemoteDevice *device = new RemoteDevice(item->text(1), item->text(0)); //dann nen manager und darauf dann searchServises, das liefert nen signal, das wieder connected // werden muss. // delete } /* * Find out if a device can currently be reached */ bool BlueBase::deviceActive( RemoteDevice *device ) { return true; } /** * Open the "scan for devices" dialog */ void BlueBase::startScan() { ScanDialog *scan = new ScanDialog( this, "", true); - QObject::connect((QObject*)scan, SIGNAL( selectedDevices(QList<RemoteDevice>&) ), + QObject::connect( scan, SIGNAL( selectedDevices(QList<RemoteDevice>&) ), this, SLOT( addSearchedDevices(QList<RemoteDevice>& ) )); scan->showMaximized(); } void BlueBase::setInfo() { StatusLabel->setText(getStatus()); } /** * Decontructor */ BlueBase::~BlueBase(){ writeSavedDevices(); } } diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp index bd7d23c..f8f7b15 100644 --- a/noncore/net/opietooth/manager/scandialog.cpp +++ b/noncore/net/opietooth/manager/scandialog.cpp @@ -118,52 +118,54 @@ namespace OpieTooth { // checken ob initialisiert , qcop ans applet. localDevice->searchDevices(); } void ScanDialog::stopSearch() { } void ScanDialog::fillList(const QString& device, RemoteDevice::ValueList deviceList) { QCheckListItem * deviceItem; RemoteDevice::ValueList::Iterator it; for( it = deviceList.begin(); it != deviceList.end(); ++it ) { deviceItem = new QCheckListItem( ListView1, (*it).name() ); deviceItem->setText(1, (*it).mac() ); } } /* * Iterates trough the items, and collects the checked items. * Then it emits it, so the manager can connect to the signal to fill the listing. */ void ScanDialog::emitToManager() { if (!ListView1) { return; } QList<RemoteDevice> *deviceList = new QList<RemoteDevice>; + deviceList->setAutoDelete(true); QListViewItemIterator it( ListView1 ); for ( ; it.current(); ++it ) { if ( ((QCheckListItem*)it.current())->isOn() ) { RemoteDevice * device = new RemoteDevice( it.current()->text(1), it.current()->text(0)); deviceList->append( device ); } } emit selectedDevices( *deviceList ); + delete deviceList; } /* * Cleanup */ ScanDialog::~ScanDialog() { emitToManager(); delete localDevice; } } |