]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placesitem.h
Merge branch 'KDE/4.14'
[dolphin.git] / src / panels / places / placesitem.h
index c21a8ca9acda65110c22511b24e3c2b2151bfd0c..4c636ec63412e088d37103c22835fa823fd9b140 100644 (file)
 #include <Solid/OpticalDisc>
 #include <Solid/StorageAccess>
 #include <Solid/StorageVolume>
+#include <Solid/PortableMediaPlayer>
 
-class PlacesItemStorageAccessListener;
+class KDirLister;
+class PlacesItemSignalHandler;
 
 /**
  * @brief Extends KStandardItem by places-specific properties.
@@ -38,8 +40,15 @@ class PlacesItem : public KStandardItem
 {
 
 public:
+    enum GroupType
+    {
+        PlacesType,
+        SearchForType,
+        RecentlySavedType,
+        DevicesType
+    };
+
     explicit PlacesItem(const KBookmark& bookmark, PlacesItem* parent = 0);
-    explicit PlacesItem(const PlacesItem& item);
     virtual ~PlacesItem();
 
     void setUrl(const KUrl& url);
@@ -59,11 +68,14 @@ public:
     void setBookmark(const KBookmark& bookmark);
     KBookmark bookmark() const;
 
+    GroupType groupType() const;
+
+    bool storageSetupNeeded() const;
+
     static KBookmark createBookmark(KBookmarkManager* manager,
                                     const QString& text,
                                     const KUrl& url,
-                                    const QString& iconName,
-                                    PlacesItem* after = 0);
+                                    const QString& iconName);
     static KBookmark createDeviceBookmark(KBookmarkManager* manager,
                                           const QString& udi);
 
@@ -76,14 +88,22 @@ protected:
                                const QHash<QByteArray, QVariant>& previous);
 
 private:
+    PlacesItem(const PlacesItem& item);
+
     void initializeDevice(const QString& udi);
 
     /**
-     * Is invoked by m_accessListener if the accessibility
-     * of the storage access m_access has been changed.
+     * Is invoked if the accessibility of the storage access
+     * m_access has been changed and updates the emblem.
      */
     void onAccessibilityChanged();
 
+    /**
+     * Is invoked if the listing of the trash has been completed.
+     * Updates the state of the trash-icon to be empty or full.
+     */
+    void onTrashDirListerCompleted();
+
     /**
      * Applies the data-value from the role to m_bookmark.
      */
@@ -96,10 +116,12 @@ private:
     QPointer<Solid::StorageAccess> m_access;
     QPointer<Solid::StorageVolume> m_volume;
     QPointer<Solid::OpticalDisc> m_disc;
-    QPointer<PlacesItemStorageAccessListener> m_accessListener;
+    QPointer<Solid::PortableMediaPlayer> m_mtp;
+    QPointer<PlacesItemSignalHandler> m_signalHandler;
+    QPointer<KDirLister> m_trashDirLister;
     KBookmark m_bookmark;
 
-    friend class PlacesItemStorageAccessListener; // Calls onAccessibilityChanged()
+    friend class PlacesItemSignalHandler; // Calls onAccessibilityChanged()
 };
 
 #endif