diff --git a/core/device.cpp b/core/device.cpp index 75bbcded8..816b37a56 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -560,6 +560,11 @@ void Device::setName(const QString &name) } } +Device::PairStatus Device::pairStatus() const +{ + return m_pairStatus; +} + KdeConnectPlugin* Device::plugin(const QString& pluginName) const { return m_plugins[pluginName]; diff --git a/core/device.h b/core/device.h index 908333a7d..e692c4404 100644 --- a/core/device.h +++ b/core/device.h @@ -48,6 +48,7 @@ class KDECONNECTCORE_EXPORT Device Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChanged) Q_PROPERTY(QStringList unsupportedPlugins READ unsupportedPlugins NOTIFY pluginsChanged) +public: enum PairStatus { NotPaired, Requested, @@ -62,10 +63,7 @@ class KDECONNECTCORE_EXPORT Device Phone, Tablet, }; - static DeviceType str2type(const QString &deviceType); - static QString type2str(DeviceType deviceType); -public: /** * Restores the @p device from the saved configuration * @@ -109,6 +107,8 @@ public: void setPluginEnabled(const QString& pluginName, bool enabled); bool isPluginEnabled(const QString& pluginName) const; + PairStatus pairStatus() const; + DeviceLink::ConnectionStarted connectionSource() const; public Q_SLOTS: @@ -139,6 +139,9 @@ Q_SIGNALS: QT_DEPRECATED Q_SCRIPTABLE void unpaired(); private: //Methods + static DeviceType str2type(const QString &deviceType); + static QString type2str(DeviceType deviceType); + void setName(const QString &name); QString iconForStatus(bool reachable, bool paired) const; void unpairInternal();