Changeset View
Changeset View
Standalone View
Standalone View
src/panels/places/placesitemmodel.h
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | 52 | public: | |||
---|---|---|---|---|---|
97 | * of the item. | 97 | * of the item. | ||
98 | */ | 98 | */ | ||
99 | void appendItemToGroup(PlacesItem* item); | 99 | void appendItemToGroup(PlacesItem* item); | ||
100 | 100 | | |||
101 | QAction* ejectAction(int index) const; | 101 | QAction* ejectAction(int index) const; | ||
102 | QAction* teardownAction(int index) const; | 102 | QAction* teardownAction(int index) const; | ||
103 | 103 | | |||
104 | void requestEject(int index); | 104 | void requestEject(int index); | ||
105 | void requestTeardown(int index); | 105 | void requestTearDown(int index); | ||
106 | 106 | | |||
107 | bool storageSetupNeeded(int index) const; | 107 | bool storageSetupNeeded(int index) const; | ||
108 | void requestStorageSetup(int index); | 108 | void requestStorageSetup(int index); | ||
109 | 109 | | |||
110 | virtual QMimeData* createMimeData(const KItemSet& indexes) const Q_DECL_OVERRIDE; | 110 | virtual QMimeData* createMimeData(const KItemSet& indexes) const Q_DECL_OVERRIDE; | ||
111 | 111 | | |||
112 | virtual bool supportsDropping(int index) const Q_DECL_OVERRIDE; | 112 | virtual bool supportsDropping(int index) const Q_DECL_OVERRIDE; | ||
113 | 113 | | |||
114 | void dropMimeDataBefore(int index, const QMimeData* mimeData); | 114 | void dropMimeDataBefore(int index, const QMimeData* mimeData); | ||
115 | 115 | | |||
116 | /** | 116 | /** | ||
117 | * @return Converts the URL, which contains "virtual" URLs for system-items like | 117 | * @return Converts the URL, which contains "virtual" URLs for system-items like | ||
118 | * "search:/documents" into a Query-URL that will be handled by | 118 | * "search:/documents" into a Query-URL that will be handled by | ||
119 | * the corresponding IO-slave. Virtual URLs for bookmarks are used to | 119 | * the corresponding IO-slave. Virtual URLs for bookmarks are used to | ||
120 | * be independent from internal format changes. | 120 | * be independent from internal format changes. | ||
121 | */ | 121 | */ | ||
122 | static QUrl convertedUrl(const QUrl& url); | 122 | static QUrl convertedUrl(const QUrl& url); | ||
123 | 123 | | |||
124 | virtual void clear() Q_DECL_OVERRIDE; | 124 | virtual void clear() Q_DECL_OVERRIDE; | ||
125 | 125 | | |||
126 | void proceedWithTearDown(); | ||||
127 | | ||||
126 | /** | 128 | /** | ||
127 | * Saves the bookmarks and indicates to other applications that the | 129 | * Saves the bookmarks and indicates to other applications that the | ||
128 | * state of the bookmarks has been changed. Is only called by the | 130 | * state of the bookmarks has been changed. Is only called by the | ||
129 | * timeout of m_saveBookmarksTimer to prevent unnecessary savings. | 131 | * timeout of m_saveBookmarksTimer to prevent unnecessary savings. | ||
130 | */ | 132 | */ | ||
131 | void saveBookmarks(); | 133 | void saveBookmarks(); | ||
132 | 134 | | |||
133 | signals: | 135 | signals: | ||
134 | void errorMessage(const QString& message); | 136 | void errorMessage(const QString& message); | ||
135 | void storageSetupDone(int index, bool success); | 137 | void storageSetupDone(int index, bool success); | ||
138 | void storageTearDownRequested(const QString& mountPath); | ||||
139 | void storageTearDownExternallyRequested(const QString& mountPath); | ||||
136 | 140 | | |||
137 | protected: | 141 | protected: | ||
138 | virtual void onItemInserted(int index) Q_DECL_OVERRIDE; | 142 | virtual void onItemInserted(int index) Q_DECL_OVERRIDE; | ||
139 | virtual void onItemRemoved(int index, KStandardItem* removedItem) Q_DECL_OVERRIDE; | 143 | virtual void onItemRemoved(int index, KStandardItem* removedItem) Q_DECL_OVERRIDE; | ||
140 | virtual void onItemChanged(int index, const QSet<QByteArray>& changedRoles) Q_DECL_OVERRIDE; | 144 | virtual void onItemChanged(int index, const QSet<QByteArray>& changedRoles) Q_DECL_OVERRIDE; | ||
141 | 145 | | |||
142 | private slots: | 146 | private slots: | ||
143 | void slotDeviceAdded(const QString& udi); | 147 | void slotDeviceAdded(const QString& udi); | ||
144 | void slotDeviceRemoved(const QString& udi); | 148 | void slotDeviceRemoved(const QString& udi); | ||
145 | void slotStorageTeardownDone(Solid::ErrorType error, const QVariant& errorData); | 149 | void slotStorageTearDownDone(Solid::ErrorType error, const QVariant& errorData); | ||
146 | void slotStorageSetupDone(Solid::ErrorType error, const QVariant& errorData, const QString& udi); | 150 | void slotStorageSetupDone(Solid::ErrorType error, const QVariant& errorData, const QString& udi); | ||
147 | void hideItem(); | 151 | void hideItem(); | ||
148 | 152 | | |||
149 | /** | 153 | /** | ||
150 | * Updates the bookmarks from the model corresponding to the changed | 154 | * Updates the bookmarks from the model corresponding to the changed | ||
151 | * bookmarks stored by the bookmark-manager. Is called whenever the bookmarks | 155 | * bookmarks stored by the bookmark-manager. Is called whenever the bookmarks | ||
152 | * have been changed by another application. | 156 | * have been changed by another application. | ||
153 | */ | 157 | */ | ||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Line(s) | 253 | private: | |||
276 | QList<PlacesItem*> m_bookmarkedItems; | 280 | QList<PlacesItem*> m_bookmarkedItems; | ||
277 | 281 | | |||
278 | // Index of the hidden item that should be removed in | 282 | // Index of the hidden item that should be removed in | ||
279 | // removeHiddenItem(). The removing must be done | 283 | // removeHiddenItem(). The removing must be done | ||
280 | // asynchronously as in the scope of onItemChanged() | 284 | // asynchronously as in the scope of onItemChanged() | ||
281 | // removing an item is not allowed. | 285 | // removing an item is not allowed. | ||
282 | int m_hiddenItemToRemove; | 286 | int m_hiddenItemToRemove; | ||
283 | 287 | | |||
288 | Solid::StorageAccess *m_deviceToTearDown; | ||||
289 | | ||||
284 | QTimer* m_updateBookmarksTimer; | 290 | QTimer* m_updateBookmarksTimer; | ||
285 | 291 | | |||
286 | QHash<QObject*, int> m_storageSetupInProgress; | 292 | QHash<QObject*, int> m_storageSetupInProgress; | ||
287 | }; | 293 | }; | ||
288 | 294 | | |||
289 | #endif | 295 | #endif | ||
290 | 296 | | |||
291 | 297 | |