mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
solid: udev backend optimization
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d33233d7ab
commit
240e0d535e
5 changed files with 7 additions and 7 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
using namespace Solid::Backends::UDev;
|
||||
|
||||
static const QStringList powersupplysubsystems = QStringList() << QLatin1String("power_supply");
|
||||
static const QList<QByteArray> powersupplysubsystems = QList<QByteArray>() << "power_supply";
|
||||
|
||||
AcAdapter::AcAdapter(UDevDevice *device)
|
||||
: DeviceInterface(device),
|
||||
|
|
|
@ -27,7 +27,7 @@ using namespace Solid::Backends::UDev;
|
|||
// linux/drivers/power/supply/power_supply_sysfs.c
|
||||
// include/linux/power_supply.h
|
||||
|
||||
static const QStringList powersupplysubsystems = QStringList() << QLatin1String("power_supply");
|
||||
static const QList<QByteArray> powersupplysubsystems = QList<QByteArray>() << "power_supply";
|
||||
|
||||
Battery::Battery(UDevDevice *device)
|
||||
: DeviceInterface(device),
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
|
||||
UDevManager::Private::Private()
|
||||
{
|
||||
static const QStringList subsystems = QStringList()
|
||||
static const QList<QByteArray> subsystems = QList<QByteArray>()
|
||||
<< "block"
|
||||
<< "power_supply"
|
||||
<< "processor"
|
||||
|
|
|
@ -70,7 +70,7 @@ class Client : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Client(const QStringList &subsystems, QObject *parent = 0);
|
||||
Client(const QList<QByteArray> &subsystems, QObject *parent = 0);
|
||||
~Client();
|
||||
|
||||
DeviceList allDevices();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
namespace UdevQt {
|
||||
|
||||
Client::Client(const QStringList& subsystems, QObject *parent)
|
||||
Client::Client(const QList<QByteArray>& subsystems, QObject *parent)
|
||||
: QObject(parent), m_udev(udev_new()), m_monitor(0), m_monitorNotifier(0)
|
||||
{
|
||||
// create a listener
|
||||
|
@ -33,8 +33,8 @@ Client::Client(const QStringList& subsystems, QObject *parent)
|
|||
}
|
||||
|
||||
// apply subsystem filters
|
||||
foreach (const QString &it, subsystems) {
|
||||
udev_monitor_filter_add_match_subsystem_devtype(m_monitor, it.toLatin1().constData(), NULL);
|
||||
foreach (const QByteArray &it, subsystems) {
|
||||
udev_monitor_filter_add_match_subsystem_devtype(m_monitor, it.constData(), NULL);
|
||||
}
|
||||
|
||||
// start the monitor receiving
|
||||
|
|
Loading…
Add table
Reference in a new issue