~ubuntu-branches/ubuntu/wily/qtconnectivity-opensource-src/wily

« back to all changes in this revision

Viewing changes to examples/bluetooth/btchat/remoteselector.cpp

  • Committer: Package Import Robot
  • Author(s): Lisandro Damián Nicanor Pérez Meyer, Timo Jyrinki
  • Date: 2014-02-23 00:01:49 UTC
  • mfrom: (0.1.3 experimental) (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140223000149-ht3k3x21dr5n5dol
Tags: 5.2.1-1
[ Timo Jyrinki ]
* New upstream release
* Move mkspecs to the new location
* Make private headers cleaning non version specific
* Add examples package
* Add dependencies to build against the 5.2.1 versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
#include <qbluetoothdeviceinfo.h>
45
45
#include <qbluetoothaddress.h>
46
 
 
47
 
QT_USE_NAMESPACE_BLUETOOTH
48
 
 
49
 
RemoteSelector::RemoteSelector(QWidget *parent)
50
 
:   QDialog(parent), ui(new Ui::RemoteSelector),
51
 
    m_discoveryAgent(new QBluetoothServiceDiscoveryAgent)
 
46
#include <qbluetoothlocaldevice.h>
 
47
 
 
48
QT_USE_NAMESPACE
 
49
 
 
50
RemoteSelector::RemoteSelector(const QBluetoothAddress &localAdapter, QWidget *parent)
 
51
:   QDialog(parent), ui(new Ui::RemoteSelector)
52
52
{
53
53
    ui->setupUi(this);
54
54
 
 
55
    m_discoveryAgent = new QBluetoothServiceDiscoveryAgent(localAdapter);
 
56
 
55
57
    connect(m_discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)),
56
58
            this, SLOT(serviceDiscovered(QBluetoothServiceInfo)));
57
59
    connect(m_discoveryAgent, SIGNAL(finished()), this, SLOT(discoveryFinished()));
 
60
    connect(m_discoveryAgent, SIGNAL(canceled()), this, SLOT(discoveryFinished()));
58
61
}
59
62
 
60
63
RemoteSelector::~RemoteSelector()
61
64
{
62
65
    delete ui;
 
66
    delete m_discoveryAgent;
63
67
}
64
68
 
65
69
void RemoteSelector::startDiscovery(const QBluetoothUuid &uuid)
66
70
{
 
71
    ui->status->setText(tr("Scanning..."));
67
72
    if (m_discoveryAgent->isActive())
68
73
        m_discoveryAgent->stop();
69
74
 
72
77
    m_discoveryAgent->setUuidFilter(uuid);
73
78
    m_discoveryAgent->start();
74
79
 
75
 
    ui->status->setText(tr("Scanning..."));
76
80
}
77
81
 
78
82
void RemoteSelector::stopDiscovery()