Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/fstab/fstabmanager.cpp
Show All 16 Lines | |||||
17 | FstabManager::FstabManager(QObject *parent) | 17 | FstabManager::FstabManager(QObject *parent) | ||
18 | : Solid::Ifaces::DeviceManager(parent) | 18 | : Solid::Ifaces::DeviceManager(parent) | ||
19 | { | 19 | { | ||
20 | m_supportedInterfaces << Solid::DeviceInterface::StorageAccess; | 20 | m_supportedInterfaces << Solid::DeviceInterface::StorageAccess; | ||
21 | m_supportedInterfaces << Solid::DeviceInterface::NetworkShare; | 21 | m_supportedInterfaces << Solid::DeviceInterface::NetworkShare; | ||
22 | 22 | | |||
23 | m_deviceList = FstabHandling::deviceList(); | 23 | m_deviceList = FstabHandling::deviceList(); | ||
24 | 24 | | |||
25 | connect(FstabWatcher::instance(), SIGNAL(fstabChanged()), this, SLOT(onFstabChanged())); | 25 | connect(FstabWatcher::instance(), &FstabWatcher::fstabChanged, this, &FstabManager::onFstabChanged); | ||
26 | connect(FstabWatcher::instance(), SIGNAL(mtabChanged()), this, SLOT(onMtabChanged())); | 26 | connect(FstabWatcher::instance(), &FstabWatcher::mtabChanged, this, &FstabManager::onMtabChanged); | ||
27 | } | 27 | } | ||
28 | 28 | | |||
29 | QString FstabManager::udiPrefix() const | 29 | QString FstabManager::udiPrefix() const | ||
30 | { | 30 | { | ||
31 | return QString::fromLatin1(FSTAB_UDI_PREFIX); | 31 | return QString::fromLatin1(FSTAB_UDI_PREFIX); | ||
32 | } | 32 | } | ||
33 | 33 | | |||
34 | QSet<Solid::DeviceInterface::Type> FstabManager::supportedInterfaces() const | 34 | QSet<Solid::DeviceInterface::Type> FstabManager::supportedInterfaces() const | ||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 78 | { | |||
87 | 87 | | |||
88 | } else { | 88 | } else { | ||
89 | // global device manager makes sure udi starts with udi prefix + '/' | 89 | // global device manager makes sure udi starts with udi prefix + '/' | ||
90 | QString internalName = udi.mid(udiPrefix().length() + 1, -1); | 90 | QString internalName = udi.mid(udiPrefix().length() + 1, -1); | ||
91 | if (!m_deviceList.contains(internalName)) { | 91 | if (!m_deviceList.contains(internalName)) { | ||
92 | return nullptr; | 92 | return nullptr; | ||
93 | } | 93 | } | ||
94 | 94 | | |||
95 | QObject *device = new FstabDevice(udi); | 95 | FstabDevice *device = new FstabDevice(udi); | ||
96 | connect(this, SIGNAL(mtabChanged(QString)), device, SLOT(onMtabChanged(QString))); | 96 | connect(this, &FstabManager::mtabChanged, device, &FstabDevice::onMtabChanged); | ||
97 | return device; | 97 | return device; | ||
98 | 98 | | |||
99 | } | 99 | } | ||
100 | } | 100 | } | ||
101 | 101 | | |||
102 | void FstabManager::onFstabChanged() | 102 | void FstabManager::onFstabChanged() | ||
103 | { | 103 | { | ||
104 | FstabHandling::flushFstabCache(); | 104 | FstabHandling::flushFstabCache(); | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |