Changeset View
Changeset View
Standalone View
Standalone View
Modules/usbview/usbdb.cpp
Show All 15 Lines | |||||
16 | #include <QRegExp> | 16 | #include <QRegExp> | ||
17 | #include <QTextStream> | 17 | #include <QTextStream> | ||
18 | #include <QStandardPaths> | 18 | #include <QStandardPaths> | ||
19 | #include <QDebug> | 19 | #include <QDebug> | ||
20 | 20 | | |||
21 | USBDB::USBDB() { | 21 | USBDB::USBDB() { | ||
22 | QString db = QStringLiteral("/usr/share/hwdata/usb.ids"); /* on Fedora and Arch*/ | 22 | QString db = QStringLiteral("/usr/share/hwdata/usb.ids"); /* on Fedora and Arch*/ | ||
23 | if (!QFile::exists(db)) { | 23 | if (!QFile::exists(db)) { | ||
24 | db = QStringLiteral("/usr/share/misc/usb.ids"); /* on Gentoo */ | ||||
25 | } | ||||
26 | if (!QFile::exists(db)) { | ||||
24 | //cannot use locate(AppDataLocation) as the app is kinfocenter | 27 | //cannot use locate(AppDataLocation) as the app is kinfocenter | ||
25 | db = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kcmusb"), QStandardPaths::LocateDirectory); | 28 | db = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kcmusb"), QStandardPaths::LocateDirectory); | ||
26 | if (!db.isEmpty()) | 29 | if (!db.isEmpty()) | ||
27 | db+=QLatin1String("/usb.ids"); | 30 | db+=QLatin1String("/usb.ids"); | ||
28 | } | 31 | } | ||
29 | if (db.isEmpty()) | 32 | if (db.isEmpty()) | ||
30 | return; | 33 | return; | ||
31 | 34 | | |||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |