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:
Dominik Riebeling 2007-08-03 16:30:37 +00:00
parent 3f8a2d61ca
commit a31b410868

View file

@ -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()));
}