Exemplo n.º 1
0
void DeviceActionsDialog::setDevice(const Solid::Device &device)
{
    m_device = device;
    
    QString label = device.vendor();
    if (!label.isEmpty()) label+=' ';
    label+= device.product();
    
    setWindowTitle(label); 
    
    m_view.iconLabel->setPixmap(KIcon(device.icon()).pixmap(64));
    m_view.descriptionLabel->setText(device.vendor()+' '+device.product());
    setWindowIcon(KIcon(device.icon()));
}
/**
 * @brief Return true if device is identified as iPod-compatible using product and vendor.
 *
 * @param device Solid device to identify
 * @return true if the device is iPod-like, false if it cannot be proved.
 **/
static bool
deviceIsRootIpodDevice( const Solid::Device &device )
{
    if( !device.vendor().contains( "Apple", Qt::CaseInsensitive ) )
        return false;
    return device.product().startsWith( "iPod" )
        || device.product().startsWith( "iPhone" )
        || device.product().startsWith( "iPad" );
}