#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.
{
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);
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);
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.
*/
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