Fix a segfault when no configuration file is present.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14161 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3f8a2d61ca
commit
a31b410868
1 changed files with 3 additions and 2 deletions
|
@ -190,7 +190,7 @@ void Config::setDevices(QSettings *dev)
|
|||
QStringList brands = manuf.uniqueKeys();
|
||||
QTreeWidgetItem *w;
|
||||
QTreeWidgetItem *w2;
|
||||
QTreeWidgetItem *w3;
|
||||
QTreeWidgetItem *w3 = 0;
|
||||
for(int c = 0; c < brands.size(); c++) {
|
||||
qDebug() << brands.at(c);
|
||||
w = new QTreeWidgetItem();
|
||||
|
@ -223,7 +223,8 @@ void Config::setDevices(QSettings *dev)
|
|||
}
|
||||
}
|
||||
ui.treeDevices->insertTopLevelItems(0, items);
|
||||
ui.treeDevices->setCurrentItem(w3); // hilight old selection
|
||||
if(w3 != 0)
|
||||
ui.treeDevices->setCurrentItem(w3); // hilight old selection
|
||||
connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updatePlatform()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue