222 QListView *servers = iscmd ? fDimCmdServers : fDimSvcServers;
223 QListView *services = iscmd ? fDimCmdCommands : fDimSvcServices;
224 QListView *description = iscmd ? fDimCmdDescription : fDimSvcDescription;
226 QStandardItemModel *m =
dynamic_cast<QStandardItemModel*
>(servers->model());
229 m =
new QStandardItemModel(
this);
230 servers->setModel(m);
231 services->setModel(m);
232 description->setModel(m);
235 QList<QStandardItem*> l = m->findItems(server.c_str());
239 cout <<
"hae" << endl;
243 QStandardItem *col = l.size()==0 ? NULL : l[0];
247 col =
new QStandardItem(server.c_str());
250 if (!services->rootIndex().isValid())
252 services->setRootIndex(col->index());
253 servers->setCurrentIndex(col->index());
257 QStandardItem *
item = 0;
258 for (
int i=0;
i<col->rowCount();
i++)
260 QStandardItem *coli = col->child(
i);
261 if (coli->text().toStdString()==service)
265 item =
new QStandardItem(service.c_str());
266 col->appendRow(item);
267 col->sortChildren(0);
269 if (!description->rootIndex().isValid())
271 description->setRootIndex(item->index());
272 services->setCurrentIndex(item->index());
276 item->setCheckable(
true);