mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdecore: extend the upstream PCI and USB databases
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
ee5c128b7d
commit
e8f2c262e2
7 changed files with 86 additions and 16 deletions
|
@ -445,5 +445,7 @@ install(
|
|||
FILES
|
||||
pci.ids
|
||||
usb.ids
|
||||
kde4_pci.ids
|
||||
kde4_usb.ids
|
||||
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kdevicedatabase
|
||||
)
|
||||
|
|
2
kdecore/kde4_pci.ids
Normal file
2
kdecore/kde4_pci.ids
Normal file
|
@ -0,0 +1,2 @@
|
|||
#
|
||||
# KDE IDs, missing in the upstream database
|
19
kdecore/kde4_usb.ids
Normal file
19
kdecore/kde4_usb.ids
Normal file
|
@ -0,0 +1,19 @@
|
|||
#
|
||||
# KDE IDs, missing in the upstream database
|
||||
|
||||
1038 SteelSeries ApS
|
||||
1729 SteelSeries Rival 110 Gaming Mouse
|
||||
|
||||
13d3 IMC Networks
|
||||
# https://linux-hardware.org/?probe=e8349bba13
|
||||
56a2 USB2.0 HD UVC WebCam
|
||||
# https://linux-hardware.org/?probe=81f7a796be
|
||||
56bc Integrated Camera
|
||||
|
||||
0480 Toshiba America Inc
|
||||
# https://linux-hardware.org/?probe=45c6c458bc
|
||||
0210 External USB 3.0 1TB
|
||||
|
||||
03f0 HP, Inc
|
||||
# https://linux-hardware.org/?probe=db3540f085
|
||||
122a LaserJet 200 colorMFP M276nw
|
|
@ -54,4 +54,25 @@ void KDeviceDatabaseTest::testUSB()
|
|||
QCOMPARE(m_devicedb.lookupUSBProtocol("02", "02", "00"), QLatin1String("None"));
|
||||
}
|
||||
|
||||
void KDeviceDatabaseTest::testKDE4PCI()
|
||||
{
|
||||
if (!m_iskdelibsinstalled) {
|
||||
QSKIP("kdelibs not installed", SkipAll);
|
||||
}
|
||||
|
||||
// no IDs yet
|
||||
}
|
||||
|
||||
void KDeviceDatabaseTest::testKDE4USB()
|
||||
{
|
||||
if (!m_iskdelibsinstalled) {
|
||||
QSKIP("kdelibs not installed", SkipAll);
|
||||
}
|
||||
|
||||
QCOMPARE(m_devicedb.lookupUSBVendor("1038"), QLatin1String("SteelSeries ApS"));
|
||||
QCOMPARE(m_devicedb.lookupUSBDevice("1038", "1729"), QLatin1String("SteelSeries Rival 110 Gaming Mouse"));
|
||||
QCOMPARE(m_devicedb.lookupUSBVendor("13d3"), QLatin1String("IMC Networks"));
|
||||
QCOMPARE(m_devicedb.lookupUSBDevice("13d3", "56a2"), QLatin1String("USB2.0 HD UVC WebCam"));
|
||||
}
|
||||
|
||||
#include "moc_kdevicedatabasetest.cpp"
|
||||
|
|
|
@ -32,6 +32,9 @@ private Q_SLOTS:
|
|||
void testPCI();
|
||||
void testUSB();
|
||||
|
||||
void testKDE4PCI();
|
||||
void testKDE4USB();
|
||||
|
||||
private:
|
||||
bool m_iskdelibsinstalled;
|
||||
KDeviceDatabase m_devicedb;
|
||||
|
|
|
@ -15723,7 +15723,6 @@
|
|||
1361 Ideazon Sensei
|
||||
1410 SRW-S1 [Simraceway Steering Wheel]
|
||||
1720 Mouse
|
||||
1729 SteelSeries Rival 110 Gaming Mouse
|
||||
1039 devolo AG
|
||||
0824 1866 802.11bg [Texas Instruments TNETW1450]
|
||||
2140 dsl+ 1100 duo
|
||||
|
|
|
@ -206,25 +206,37 @@ bool KDeviceDatabasePrivate::readPCIDatabase()
|
|||
return true;
|
||||
}
|
||||
|
||||
pcivendorsmap.clear();
|
||||
pcidevicesmap.clear();
|
||||
pciclassesmap.clear();
|
||||
pcisubclassesmap.clear();
|
||||
pciprotocolsmap.clear();
|
||||
|
||||
const QString pciids = KStandardDirs::locate("data", QString::fromLatin1("kdevicedatabase/pci.ids"));
|
||||
QFile pciidsfile(pciids);
|
||||
if (!pciidsfile.open(QFile::ReadOnly)) {
|
||||
kWarning() << "PCI IDs database not found";
|
||||
return false;
|
||||
}
|
||||
|
||||
pcivendorsmap.clear();
|
||||
pcidevicesmap.clear();
|
||||
pciclassesmap.clear();
|
||||
pcisubclassesmap.clear();
|
||||
pciprotocolsmap.clear();
|
||||
extractIDs(
|
||||
&pciidsfile,
|
||||
&pcivendorsmap, &pcidevicesmap,
|
||||
&pciclassesmap, &pcisubclassesmap, &pciprotocolsmap
|
||||
);
|
||||
// qDebug() << Q_FUNC_INFO << pcivendorsmap;
|
||||
|
||||
const QString kde4pciids = KStandardDirs::locate("data", QString::fromLatin1("kdevicedatabase/kde4_pci.ids"));
|
||||
QFile kde4pciidsfile(kde4pciids);
|
||||
if (!kde4pciidsfile.open(QFile::ReadOnly)) {
|
||||
kDebug() << "KDE PCI IDs database not found";
|
||||
} else {
|
||||
extractIDs(
|
||||
&kde4pciidsfile,
|
||||
&pcivendorsmap, &pcidevicesmap,
|
||||
&pciclassesmap, &pcisubclassesmap, &pciprotocolsmap
|
||||
);
|
||||
}
|
||||
|
||||
// qDebug() << Q_FUNC_INFO << pcivendorsmap;
|
||||
m_pcicached = true;
|
||||
return true;
|
||||
}
|
||||
|
@ -235,25 +247,37 @@ bool KDeviceDatabasePrivate::readUSBDatabase()
|
|||
return true;
|
||||
}
|
||||
|
||||
usbvendorsmap.clear();
|
||||
usbdevicesmap.clear();
|
||||
usbclassesmap.clear();
|
||||
usbsubclassesmap.clear();
|
||||
usbprotocolsmap.clear();
|
||||
|
||||
const QString usbids = KStandardDirs::locate("data", QString::fromLatin1("kdevicedatabase/usb.ids"));
|
||||
QFile usbidsfile(usbids);
|
||||
if (!usbidsfile.open(QFile::ReadOnly)) {
|
||||
kWarning() << "USB IDs database not found";
|
||||
return false;
|
||||
}
|
||||
|
||||
usbvendorsmap.clear();
|
||||
usbdevicesmap.clear();
|
||||
usbclassesmap.clear();
|
||||
usbsubclassesmap.clear();
|
||||
usbprotocolsmap.clear();
|
||||
extractIDs(
|
||||
&usbidsfile,
|
||||
&usbvendorsmap, &usbdevicesmap,
|
||||
&usbclassesmap, &usbsubclassesmap, &usbprotocolsmap
|
||||
);
|
||||
// qDebug() << Q_FUNC_INFO << usbvendorsmap;
|
||||
|
||||
const QString kde4usbids = KStandardDirs::locate("data", QString::fromLatin1("kdevicedatabase/kde4_usb.ids"));
|
||||
QFile kde4usbidsfile(kde4usbids);
|
||||
if (!kde4usbidsfile.open(QFile::ReadOnly)) {
|
||||
kDebug() << "KDE USB IDs database not found";
|
||||
} else {
|
||||
extractIDs(
|
||||
&kde4usbidsfile,
|
||||
&usbvendorsmap, &usbdevicesmap,
|
||||
&usbclassesmap, &usbsubclassesmap, &usbprotocolsmap
|
||||
);
|
||||
}
|
||||
|
||||
// qDebug() << Q_FUNC_INFO << usbvendorsmap;
|
||||
m_usbcached = true;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue