Skip to content

Commit

Permalink
Fix for bug #569
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6606 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Feb 16, 2007
1 parent 1872fe0 commit d25fa0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/plugins/gps_importer/qgsgpsdevicedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ QgsGPSDeviceDialog::QgsGPSDeviceDialog(std::map<QString, QgsGPSDevice*>&
split.append(340);
splitter->setSizes(split);

QObject::connect(lbDeviceList, SIGNAL(itemSelectionChanged()),
this, SLOT(slotSelectionChanged()));
QObject::connect(lbDeviceList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this, SLOT(slotSelectionChanged(QListWidgetItem*)));
slotUpdateDeviceList();
}

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

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

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

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


void QgsGPSDeviceDialog::slotSelectionChanged() {
void QgsGPSDeviceDialog::slotSelectionChanged(QListWidgetItem *current) {
if (lbDeviceList->count() > 0)
{
QString devName = lbDeviceList->currentItem()->text();
QString devName = current->text();
leDeviceName->setText(devName);
QgsGPSDevice* device = mDevices[devName];
leWptDown->setText(device->
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/gps_importer/qgsgpsdevicedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public slots:
void on_pbnUpdateDevice_clicked();
void on_pbnClose_clicked();
void slotUpdateDeviceList(const QString& selection = "");
void slotSelectionChanged();
void slotSelectionChanged(QListWidgetItem *current);

signals:
void devicesChanged();
Expand Down

0 comments on commit d25fa0c

Please sign in to comment.