- QAction *whoisAction = nickContextMenu.addAction(tr("WHOIS"));
- QAction *versionAction = nickContextMenu.addAction(tr("VERSION"));
- QAction *pingAction = nickContextMenu.addAction(tr("PING"));
-
- nickContextMenu.addSeparator();
-
- QMenu *modeMenu = nickContextMenu.addMenu(tr("Modes"));
- QAction *opAction = modeMenu->addAction(tr("Op %1").arg(nick));
- QAction *deOpAction = modeMenu->addAction(tr("Deop %1").arg(nick));
- QAction *voiceAction = modeMenu->addAction(tr("Voice %1").arg(nick));
- QAction *deVoiceAction = modeMenu->addAction(tr("Devoice %1").arg(nick));
+ // make sure the item we clicked on is first
+ if(indexList.contains(currentIndex())) {
+ indexList.removeAll(currentIndex());
+ indexList.prepend(currentIndex());
+ }