diff options
| author | Alexander Lohnau <[email protected]> | 2020-06-23 17:42:06 +0200 |
|---|---|---|
| committer | Alexander Lohnau <[email protected]> | 2020-06-23 17:42:06 +0200 |
| commit | d1baf3398e53931735b724672d5ae48649b44a18 (patch) | |
| tree | fff51f74a27d1b08d672bd47407bffc15abce586 /src | |
| parent | f57ee4b64d924fca85c6ce0be659cd6235f959a9 (diff) | |
| parent | 37df39b93bf23b89ca760d4dd793788833d9a3e1 (diff) | |
Merge branch 'release/20.04'
Diffstat (limited to 'src')
| -rw-r--r-- | src/panels/places/placesitem.cpp | 13 | ||||
| -rw-r--r-- | src/panels/places/placesitem.h | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index 16ee5cff4..b1f24e401 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -37,7 +37,7 @@ PlacesItem::PlacesItem(const KBookmark& bookmark, PlacesItem* parent) : m_access(), m_volume(), m_disc(), - m_mtp(), + m_player(), m_signalHandler(nullptr), m_bookmark() { @@ -140,7 +140,7 @@ void PlacesItem::setBookmark(const KBookmark& bookmark) delete m_access; delete m_volume; delete m_disc; - delete m_mtp; + delete m_player; const QString udi = bookmark.metaDataItem(QStringLiteral("UDI")); if (udi.isEmpty()) { @@ -207,7 +207,7 @@ void PlacesItem::initializeDevice(const QString& udi) m_access = m_device.as<Solid::StorageAccess>(); m_volume = m_device.as<Solid::StorageVolume>(); m_disc = m_device.as<Solid::OpticalDisc>(); - m_mtp = m_device.as<Solid::PortableMediaPlayer>(); + m_player = m_device.as<Solid::PortableMediaPlayer>(); setText(m_device.displayName()); setIcon(m_device.icon()); @@ -228,8 +228,11 @@ void PlacesItem::initializeDevice(const QString& udi) } else { setUrl(QUrl(QStringLiteral("audiocd:/"))); } - } else if (m_mtp) { - setUrl(QUrl(QStringLiteral("mtp:udi=%1").arg(m_device.udi()))); + } else if (m_player) { + const QStringList protocols = m_player->supportedProtocols(); + if (!protocols.isEmpty()) { + setUrl(QUrl(QStringLiteral("%1:udi=%2").arg(protocols.first(), m_device.udi()))); + } } } diff --git a/src/panels/places/placesitem.h b/src/panels/places/placesitem.h index eccd297fa..1eff7a380 100644 --- a/src/panels/places/placesitem.h +++ b/src/panels/places/placesitem.h @@ -106,7 +106,7 @@ private: QPointer<Solid::StorageAccess> m_access; QPointer<Solid::StorageVolume> m_volume; QPointer<Solid::OpticalDisc> m_disc; - QPointer<Solid::PortableMediaPlayer> m_mtp; + QPointer<Solid::PortableMediaPlayer> m_player; QPointer<PlacesItemSignalHandler> m_signalHandler; KBookmark m_bookmark; |
