mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
fix some warning and a bogus empty test.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21053 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b4ef7c9968
commit
dc2f94a8b1
@ -1852,7 +1852,7 @@ void PrefShortcuts::on_modifyPB_pressed()
|
||||
void PrefShortcuts::on_removePB_pressed()
|
||||
{
|
||||
QList<QTreeWidgetItem*> items = shortcutsTW->selectedItems();
|
||||
for (size_t i = 0; i < items.size(); ++i)
|
||||
for (int i = 0; i < items.size(); ++i)
|
||||
items[i]->setText(1, QString());
|
||||
}
|
||||
|
||||
@ -1863,20 +1863,20 @@ void PrefShortcuts::on_searchPB_pressed()
|
||||
searchLE->text(),
|
||||
Qt::MatchFlags(Qt::MatchContains | Qt::MatchRecursive));
|
||||
|
||||
if (!matched.size() > 0)
|
||||
if (matched.isEmpty())
|
||||
return;
|
||||
|
||||
QList<QTreeWidgetItem *> const items = shortcutsTW->selectedItems();
|
||||
// clear current selection
|
||||
for (size_t i = 0; i < items.size(); ++i)
|
||||
for (int i = 0; i < items.size(); ++i)
|
||||
items[i]->setSelected(false);
|
||||
for (size_t i = 0; i < matched.size(); ++i) {
|
||||
for (int i = 0; i < matched.size(); ++i) {
|
||||
if (matched[i]->flags() & Qt::ItemIsSelectable)
|
||||
matched[i]->setSelected(true);
|
||||
matched[i]->setExpanded(true);
|
||||
}
|
||||
// scroll to the first selectable item
|
||||
for (size_t i = 0; i < matched.size(); ++i)
|
||||
for (int i = 0; i < matched.size(); ++i)
|
||||
if (matched[i]->flags() & Qt::ItemIsSelectable) {
|
||||
shortcutsTW->scrollToItem(matched[i]);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user