]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'release/20.04'
authorAlexander Lohnau <alexander.lohnau@gmx.de>
Tue, 23 Jun 2020 15:42:06 +0000 (17:42 +0200)
committerAlexander Lohnau <alexander.lohnau@gmx.de>
Tue, 23 Jun 2020 15:42:06 +0000 (17:42 +0200)
1  2 
src/panels/places/placesitem.cpp

index 16ee5cff4c2dd3d4833f07b0d03ea25925cb8f7a,ea22700202d661e22f169204693e203f642ccaa8..b1f24e401f41a14c0b766f7b50a4a7b3fea19409
@@@ -37,7 -37,7 +37,7 @@@ PlacesItem::PlacesItem(const KBookmark
      m_access(),
      m_volume(),
      m_disc(),
-     m_mtp(),
+     m_player(),
      m_signalHandler(nullptr),
      m_bookmark()
  {
@@@ -140,7 -140,7 +140,7 @@@ void PlacesItem::setBookmark(const KBoo
      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,9 -207,9 +207,9 @@@ void PlacesItem::initializeDevice(cons
      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.description());
 +    setText(m_device.displayName());
      setIcon(m_device.icon());
      setIconOverlays(m_device.emblems());
      setUdi(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())));
+         }
      }
  }