Commit 8fb0d035 authored by Tony Murray's avatar Tony Murray

Only show "Discovered Network Servers" node when it has children.

Also fix the display icons so they actually work.

svn path=/trunk/KDE/kdenetwork/krdc/; revision=1017652
parent e8231d43
......@@ -101,8 +101,14 @@ QVariant RemoteDesktopsModel::data(const QModelIndex &index, int role) const
return QVariant();
RemoteDesktopsItem *item = static_cast<RemoteDesktopsItem*>(index.internalPointer());
const QString currentItemTitleString = item->data(0).toString();
const QString currentItemString = item->data(1).toString();
#ifdef BUILD_ZEROCONF
if (currentItemTitleString == "Discovered Network Servers" && zeroconfItem->childCount()<=0)
return QVariant();
#endif
switch (role) {
case Qt::DisplayRole:
return item->data(index.column());
......@@ -112,15 +118,15 @@ QVariant RemoteDesktopsModel::data(const QModelIndex &index, int role) const
if (!currentItemString.isEmpty()) // contains an url
return KIcon("krdc");
#ifdef BUILD_ZEROCONF
else if (currentItemString == "Discovered Network Services")
else if (currentItemTitleString == "Discovered Network Servers")
return KIcon("network-workgroup");
#endif
#if 0
else if (currentItemString == "Local Network")
else if (currentItemTitleString == "Local Network")
return KIcon("network-workgroup");
#endif
else if (currentItemString == "...")
else if (currentItemTitleString == "...")
return KIcon("view-history");
#endif
else
return KIcon("folder-bookmarks");
case 10001: //url for dockwidget
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment