Plasma5Support
soliddeviceengine.cpp
46 connect(this, &Plasma5Support::DataEngine::sourceRemoved, this, &SolidDeviceEngine::sourceWasRemoved);
67 connect(m_notifier, &Solid::DeviceNotifier::deviceRemoved, this, &SolidDeviceEngine::deviceRemoved);
85 for (const auto devices = Solid::Device::listFromQuery(predicate); const Solid::Device &device : devices) {
131 setData(name, kli18n("Can Change Frequency").untranslatedText(), processor->canChangeFrequency());
170 bus << kli18n("Ide").untranslatedText() << kli18n("Usb").untranslatedText() << kli18n("Ieee1394").untranslatedText()
171 << kli18n("Scsi").untranslatedText() << kli18n("Sata").untranslatedText() << kli18n("Platform").untranslatedText();
173 drivetype << kli18n("Hard Disk").untranslatedText() << kli18n("Cdrom Drive").untranslatedText() << kli18n("Floppy").untranslatedText()
174 << kli18n("Tape").untranslatedText() << kli18n("Compact Flash").untranslatedText() << kli18n("Memory Stick").untranslatedText()
175 << kli18n("Smart Media").untranslatedText() << kli18n("SdMmc").untranslatedText() << kli18n("Xd").untranslatedText();
178 setData(name, kli18n("Drive Type").untranslatedText(), drivetype.at((int)storagedrive->driveType()));
276 usagetypes << i18n("Other") << i18n("Unused") << i18n("File System") << i18n("Partition Table") << i18n("Raid") << i18n("Encrypted");
334 disctypes << kli18n("Unknown Disc Type").untranslatedText() << kli18n("CD Rom").untranslatedText() << kli18n("CD Recordable").untranslatedText()
335 << kli18n("CD Rewritable").untranslatedText() << kli18n("DVD Rom").untranslatedText() << kli18n("DVD Ram").untranslatedText()
337 << kli18n("DVD Plus Recordable").untranslatedText() << kli18n("DVD Plus Rewritable").untranslatedText()
338 << kli18n("DVD Plus Recordable Duallayer").untranslatedText() << kli18n("DVD Plus Rewritable Duallayer").untranslatedText()
341 << kli18n("HD DVD Recordable").untranslatedText() << kli18n("HD DVD Rewritable").untranslatedText();
343 setData(name, kli18n("Disc Type").untranslatedText(), disctypes.at((int)opticaldisc->discType() + 1));
371 setData(name, kli18n("Supported Protocols").untranslatedText(), mediaplayer->supportedProtocols());
386 batterytype << kli18n("Unknown Battery").untranslatedText() << kli18n("PDA Battery").untranslatedText() << kli18n("UPS Battery").untranslatedText()
388 << kli18n("Keyboard Battery").untranslatedText() << kli18n("Keyboard Mouse Battery").untranslatedText()
389 << kli18n("Camera Battery").untranslatedText() << kli18n("Phone Battery").untranslatedText() << kli18n("Monitor Battery").untranslatedText()
390 << kli18n("Gaming Input Battery").untranslatedText() << kli18n("Bluetooth Battery").untranslatedText()
391 << kli18n("Tablet Battery").untranslatedText() << kli18n("Headphone Battery").untranslatedText()
392 << kli18n("Headset Battery").untranslatedText() << kli18n("Touchpad Battery").untranslatedText();
395 chargestate << kli18n("Not Charging").untranslatedText() << kli18n("Charging").untranslatedText() << kli18n("Discharging").untranslatedText()
398 setData(name, kli18n("Plugged In").untranslatedText(), battery->isPresent()); // FIXME Rename when interested parties are adjusted
402 setData(name, kli18n("Charge State").untranslatedText(), chargestate.at((int)battery->chargeState()));
427 setData(name, kli18n("Type Description").untranslatedText(), Solid::DeviceInterface::typeDescription(typeOrder[i]));
451 connect(drive, &Solid::OpticalDrive::ejectRequested, this, &SolidDeviceEngine::setUnmountingState);
456 if (m_devicemap.contains(udi) && containerForSource(udi)->data().value(kli18n("Size").untranslatedText()).toULongLong() == 0) {
460 connect(iface, SIGNAL(propertyChanged(QMap<QString, int>)), this, SLOT(deviceChanged(QMap<QString, int>)));
466 connect(access, &Solid::StorageAccess::setupRequested, this, &SolidDeviceEngine::setMountingState);
468 connect(access, &Solid::StorageAccess::teardownRequested, this, &SolidDeviceEngine::setUnmountingState);
486void SolidDeviceEngine::setIdleState(Solid::ErrorType error, QVariant errorData, const QString &udi)
514 if (iface && iface->isValid() && props.contains(QLatin1String("Size")) && iface->property(QStringLiteral("Size")).toInt() > 0) {
535 KNotification::event(KNotification::Error, i18n("Filesystem is not responding"), i18n("Filesystem mounted at '%1' is not responding", path));
554 setData(udi, kli18n("Free Space Text").untranslatedText(), KFormat().formatByteSize(available));
582 setData(udi, kli18n("Temperature").untranslatedText(), m_temperature->data(block->device(), HddTemp::Temperature));
583 setData(udi, kli18n("Temperature Unit").untranslatedText(), m_temperature->data(block->device(), HddTemp::Unit));
681void SolidDeviceEngine::deviceChanged(const QString &udi, const QString &property, const QVariant &value)
KIO::filesize_t availableSize() const
KIO::filesize_t size() const
int error() const
void result(KJob *job)
static KNotification * event(const QString &eventId, const QString &text=QString(), const QPixmap &pixmap=QPixmap(), const NotificationFlags &flags=CloseOnTimeout, const QString &componentName=QString())
#define K_PLUGIN_CLASS_WITH_JSON(classname, jsonFile)
void forceImmediateUpdateOfAllVisualizations()
Forces an immediate update to all connected sources, even those with timeouts that haven't yet expire...
Definition dataengine.cpp:347
void setData(const QString &source, const QVariant &value)
Sets a value for a data source.
Definition dataengine.cpp:121
Q_INVOKABLE DataContainer * containerForSource(const QString &source)
Retrieves a pointer to the DataContainer for a given source.
Definition dataengine.cpp:106
void sourceRemoved(const QString &source)
Emitted when a data source is removed.
This class provides a generic API for write access to settings or services.
Definition service.h:78
This class evaluates the basic expressions given in the interface.
Definition soliddeviceengine.h:43
bool updateSourceEvent(const QString &source) override
Called by internal updating mechanisms to trigger the engine to refresh the data contained in a given...
Definition soliddeviceengine.cpp:638
bool sourceRequestEvent(const QString &name) override
When a source that does not currently exist is requested by the consumer, this method is called to gi...
Definition soliddeviceengine.cpp:70
Plasma5Support::Service * serviceForSource(const QString &source) override
Definition soliddeviceengine.cpp:53
Solid::Battery::BatteryType type() const
int chargePercent() const
Solid::Battery::ChargeState chargeState() const
bool isPresent() const
bool isRechargeable() const
int deviceMinor() const
QString device() const
int deviceMajor() const
bool isValid() const
static QString typeDescription(Type type)
void deviceRemoved(const QString &udi)
void deviceAdded(const QString &udi)
QString description() const
QStringList emblems() const
QString udi() const
QString parentUdi() const
QString icon() const
Device parent() const
QString vendor() const
bool is() const
static QList< Device > listFromQuery(const Predicate &predicate, const QString &parentUdi=QString())
bool isValid() const
QString product() const
DevIface * as()
QVariant property(const QString &key) const
bool isAppendable() const
qulonglong capacity() const
DiscType discType() const
bool isBlank() const
bool isRewritable() const
ContentTypes availableContent() const
MediumTypes supportedMedia() const
QList< int > writeSpeeds() const
void ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
int readSpeed() const
int writeSpeed() const
void ejectRequested(const QString &udi)
QStringList supportedProtocols() const
QStringList supportedDrivers(QString protocol=QString()) const
bool matches(const Device &device) const
bool isValid() const
static Predicate fromString(const QString &predicate)
int number() const
int maxSpeed() const
bool canChangeFrequency() const
void setupRequested(const QString &udi)
QString filePath() const
void teardownRequested(const QString &udi)
bool isAccessible() const
void teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
void setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi)
bool isInUse() const
DriveType driveType() const
bool isHotpluggable() const
bool isRemovable() const
Bus bus() const
QString label() const
UsageType usage() const
QString fsType() const
Device encryptedContainer() const
QString uuid() const
bool isIgnored() const
Q_SCRIPTABLE QString camera()
QString i18n(const char *text, const TYPE &arg...)
std::optional< QSqlQuery > query(const QString &queryStatement)
KIOCORE_EXPORT FileSystemFreeSpaceJob * fileSystemFreeSpace(const QUrl &url)
qulonglong filesize_t
QString path(const QString &relativePath)
QString name(StandardAction id)
QDateTime currentDateTimeUtc()
bool testFlag(Enum flag) const const
const_reference at(qsizetype i) const const
qsizetype count() const const
T value(qsizetype i) const const
const_iterator cbegin() const const
const_iterator cend() const const
bool contains(const Key &key) const const
QList< Key > keys() const const
size_type remove(const Key &key)
T value(const Key &key, const T &defaultValue) const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
bool disconnect(const QMetaObject::Connection &connection)
QVariant property(const char *name) const const
T qobject_cast(QObject *object)
QObject * sender() const const
bool setProperty(const char *name, QVariant &&value)
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
bool remove(const T &value)
bool isEmpty() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void setSingleShot(bool singleShot)
void start()
void stop()
void timeout()
QUrl fromLocalFile(const QString &localFile)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.