Exemplo n.º 1
0
void DataItemDisplay::NavItemVisitor::visit(RendererItem* item)
{
    Q_ASSERT(item);

    m_owner->clearModel();

    HClientDevice* device = item->renderer()->device();
    HDeviceInfo deviceInfo = device->info();

    m_owner->m_rootDeviceUdn = device->rootDevice()->info().udn();
    m_owner->m_columns.clear();
    m_owner->m_columns.insert(0, "Name");
    m_owner->m_columns.insert(1, "Value");

    m_owner->m_modelData.push_back(
        new DisplayDataRow(QString(
            "Friendly name,%1").arg(deviceInfo.friendlyName()).split(",")));

    m_owner->m_modelData.push_back(
        new DisplayDataRow(QString(
            "Device type,%1").arg(deviceInfo.deviceType().toString()).split(",")));

    m_owner->m_modelData.push_back(
        new DisplayDataRow(QString(
            "Model name,%1").arg(deviceInfo.modelName()).split(",")));

    m_owner->m_modelData.push_back(
        new DisplayDataRow(QString(
            "Manufacturer,%1").arg(deviceInfo.manufacturer()).split(",")));

    m_owner->m_modelData.push_back(
        new DisplayDataRow(QString(
            "UDN,%1").arg(deviceInfo.udn().toString()).split(",")));

    QList<QUrl> locations = device->locations();
    for (qint32 i = 0; i < locations.size(); ++i)
    {
        m_owner->m_modelData.push_back(
            new DisplayDataRow(QString(
                "Device description URL,%1").arg(
                    locations.at(i).toString()).split(",")));
    }

    m_owner->reset();
}
Exemplo n.º 2
0
void DataItemDisplay::NavItemVisitor::visit(DeviceItem* item)
{
    Q_ASSERT(item);

    m_owner->m_modelData.clear();

    HClientDevice* device = item->device();
    HDeviceInfo deviceInfo = device->info();

    m_owner->m_rootDeviceUdn = device->rootDevice()->info().udn();

    m_owner->m_modelData.push_back(
        qMakePair(QString("Friendly name"), deviceInfo.friendlyName()));

    m_owner->m_modelData.push_back(
        qMakePair(QString("Device type"), deviceInfo.deviceType().toString()));

    m_owner->m_modelData.push_back(
        qMakePair(QString("Model name"), deviceInfo.modelName()));

    m_owner->m_modelData.push_back(
        qMakePair(QString("Manufacturer"), deviceInfo.manufacturer()));

    m_owner->m_modelData.push_back(
        qMakePair(QString("UDN"), deviceInfo.udn().toString()));

    QList<QUrl> locations = device->locations();
    for (qint32 i = 0; i < locations.size(); ++i)
    {
        m_owner->m_modelData.push_back(
            qMakePair(
                QString("Device description URL"),
                locations.at(i).toString()));
    }

#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
    m_owner->reset();
#else
    m_owner->resetInternalData();
#endif
}