make the casts a bit more sensible

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=784938
This commit is contained in:
Aaron J. Seigo 2008-03-12 20:39:23 +00:00
parent f17c8c6676
commit ff54447acf

View File

@ -139,7 +139,7 @@ void PlasmaAppletItemModel::setRunningApplets(const QHash<QString, int> &apps)
//foreach item, find that string and set the count
for (int r=0; r<rowCount(); ++r) {
QStandardItem *i = item(r);
PlasmaAppletItem *p = (PlasmaAppletItem *)i;
PlasmaAppletItem *p = dynamic_cast<PlasmaAppletItem *>(i);
if (p) {
p->setRunning(apps.value(p->name()));
}
@ -150,7 +150,7 @@ void PlasmaAppletItemModel::setRunningApplets(const QString &name, int count)
{
for (int r=0; r<rowCount(); ++r) {
QStandardItem *i = item(r);
PlasmaAppletItem *p = (PlasmaAppletItem *)i;
PlasmaAppletItem *p = dynamic_cast<PlasmaAppletItem *>(i);
if (p && p->name() == name) {
p->setRunning(count);
}