Fix for volume rocker bug
[pierogi] / mainwindow.cpp
index fb07829..1b5ee5e 100644 (file)
@@ -27,6 +27,7 @@ QMutex commandIFMutex;
 bool stopRepeatingFlag = false;
 QMutex stopRepeatingMutex;
 
+
 extern PIRMakeMgr makeManager;
 
 
@@ -72,8 +73,7 @@ MainWindow::MainWindow(QWidget *parent)
 
   connect(
     ui->favoriteKeysetsWidget,
-//    SIGNAL(itemActivated(QListWidgetItem *)),
-    SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
+    SIGNAL(itemActivated(QListWidgetItem *)),
     this,
     SLOT(keysetSelectionChanged(QListWidgetItem *)),
     Qt::QueuedConnection);
@@ -893,6 +893,12 @@ void MainWindow::keysetSelectionChanged(
   PIRKeysetWidgetItem *kwi = dynamic_cast<PIRKeysetWidgetItem *>(item);
 
   if (!kwi) return; // Also need to say something here
+
+  if (currentKeyset == kwi->getID())
+  {
+    // We're already on that keyset, so nothing to do:
+    return;
+  }
   
   currentKeyset = kwi->getID();
 
@@ -1093,6 +1099,8 @@ void MainWindow::selectPrevFavKeyset()
     position,
     QItemSelectionModel::ClearAndSelect);
 
+  keysetSelectionChanged(ui->favoriteKeysetsWidget->currentItem());
+
   // Tell the user about the change:
   QMaemo5InformationBox::information(
     0,
@@ -1122,6 +1130,8 @@ void MainWindow::selectNextFavKeyset()
     position,
     QItemSelectionModel::ClearAndSelect);
 
+  keysetSelectionChanged(ui->favoriteKeysetsWidget->currentItem());
+
   // Tell the user about the change:
   QMaemo5InformationBox::information(
     0,