| 234 | } |
| 235 | |
| 236 | QString QmitkServiceListWidget::CreateCaptionForService(const us::ServiceReferenceU &serviceRef) |
| 237 | { |
| 238 | std::string caption; |
| 239 | // TODO allow more complex formatting |
| 240 | if (m_NamingProperty.empty()) |
| 241 | caption = m_Interface; |
| 242 | else |
| 243 | { |
| 244 | us::Any prop = serviceRef.GetProperty(m_NamingProperty); |
| 245 | if (prop.Empty()) |
| 246 | { |
| 247 | MITK_WARN << "QmitkServiceListWidget tried to resolve property '" + m_NamingProperty + |
| 248 | "' but failed. Resorting to interface name for display."; |
| 249 | caption = m_Interface; |
| 250 | } |
| 251 | else |
| 252 | caption = prop.ToString(); |
| 253 | } |
| 254 | |
| 255 | return QString::fromStdString(caption); |
| 256 | } |
no test coverage detected