If present, select first item in status dialog

The old behavior is confusing and there is no real
reason to not have an object that is default-selected.
This commit is contained in:
Daniel Molkentin 2012-10-20 14:58:49 +02:00
parent 8fbc0e7c46
commit b0801d469c

View file

@ -243,6 +243,10 @@ void StatusDialog::setFolderList( Folder::Map folders )
qDebug() << "Folder: " << f;
slotAddFolder( f );
}
QModelIndex idx = _model->index(0, 0);
if (idx.isValid())
_folderList->setCurrentIndex(idx);
buttonsSetEnabled();
}
@ -270,7 +274,7 @@ void StatusDialog::buttonsSetEnabled()
_ButtonAdd->setEnabled(true);
}
QModelIndex selected = _folderList->selectionModel()->currentIndex();
QModelIndex selected = _folderList->currentIndex();
bool isSelected = selected.isValid();
_ButtonEnable->setEnabled(isSelected);