QStringList MonitorItemThread::createRes(const cl_opts& cl) { QStringList tabRefs; LockRes(my_config); int monitorItems = 0; MONITORRES *monitorRes; foreach_res(my_config, monitorRes, R_MONITOR) { monitorItems++; } if (monitorItems != 1) { Emsg2(M_ERROR_TERM, 0, _("Error: %d Monitor resources defined in %s. " "You must define one and only one Monitor resource.\n"), monitorItems, cl.configfile); } monitor = reinterpret_cast<MONITORRES*>(my_config->GetNextRes(R_MONITOR, (RES *)NULL)); int nitems = 0; DIRRES* dird; foreach_res(my_config, dird, R_DIRECTOR) { MonitorItem* item = new MonitorItem; item->setType(R_DIRECTOR); item->setResource(dird); item->setConnectTimeout(monitor->DIRConnectTimeout); item->connectToMainWindow(MainWindow::instance()); tabRefs.append(item->get_name()); items.append(item); nitems++; }
foreach_res(my_config, stored, R_STORAGE) { MonitorItem* item = new MonitorItem; item->setType(R_STORAGE); item->setResource(stored); item->setConnectTimeout(monitor->SDConnectTimeout); item->connectToMainWindow(MainWindow::instance()); tabRefs.append(item->get_name()); items.append(item); nitems++; }
foreach_res(filed, R_CLIENT) { MonitorItem* item = new MonitorItem; item->setType(R_CLIENT); item->setResource(filed); item->setConnectTimeout(monitor->FDConnectTimeout); item->connectToMainWindow(MainWindow::instance()); tabRefs.append(item->get_name()); items.append(item); nitems++; }