Skip to content

Commit a421612

Browse files
author
homann
committed
Ported r6606 to trunk
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6607 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 341d27e commit a421612

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/plugins/gps_importer/qgsgpsdevicedialog.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ QgsGPSDeviceDialog::QgsGPSDeviceDialog(std::map<QString, QgsGPSDevice*>&
3232
split.append(340);
3333
splitter->setSizes(split);
3434

35-
QObject::connect(lbDeviceList, SIGNAL(itemSelectionChanged()),
36-
this, SLOT(slotSelectionChanged()));
35+
QObject::connect(lbDeviceList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
36+
this, SLOT(slotSelectionChanged(QListWidgetItem*)));
3737
slotUpdateDeviceList();
3838
}
3939

@@ -103,8 +103,8 @@ void QgsGPSDeviceDialog::slotUpdateDeviceList(const QString& selection) {
103103

104104
// We're going to be changing the selected item, so disable our
105105
// notificaton of that.
106-
QObject::disconnect(lbDeviceList, SIGNAL(itemSelectionChanged()),
107-
this, SLOT(slotSelectionChanged()));
106+
QObject::disconnect(lbDeviceList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
107+
this, SLOT(slotSelectionChanged(QListWidgetItem*)));
108108

109109
lbDeviceList->clear();
110110
std::map<QString, QgsGPSDevice*>::const_iterator iter;
@@ -119,16 +119,16 @@ void QgsGPSDeviceDialog::slotUpdateDeviceList(const QString& selection) {
119119
lbDeviceList->setCurrentRow(0);
120120

121121
// Update the display and reconnect the selection changed signal
122-
slotSelectionChanged();
123-
QObject::connect(lbDeviceList, SIGNAL(itemSelectionChanged()),
124-
this, SLOT(slotSelectionChanged()));
122+
slotSelectionChanged(lbDeviceList->currentItem());
123+
QObject::connect(lbDeviceList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
124+
this, SLOT(slotSelectionChanged(QListWidgetItem*)));
125125
}
126126

127127

128-
void QgsGPSDeviceDialog::slotSelectionChanged() {
128+
void QgsGPSDeviceDialog::slotSelectionChanged(QListWidgetItem *current) {
129129
if (lbDeviceList->count() > 0)
130130
{
131-
QString devName = lbDeviceList->currentItem()->text();
131+
QString devName = current->text();
132132
leDeviceName->setText(devName);
133133
QgsGPSDevice* device = mDevices[devName];
134134
leWptDown->setText(device->

src/plugins/gps_importer/qgsgpsdevicedialog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public slots:
3030
void on_pbnUpdateDevice_clicked();
3131
void on_pbnClose_clicked();
3232
void slotUpdateDeviceList(const QString& selection = "");
33-
void slotSelectionChanged();
33+
void slotSelectionChanged(QListWidgetItem *current);
3434

3535
signals:
3636
void devicesChanged();

0 commit comments

Comments
 (0)