Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/favoritecollectionwidget.cpp
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Line(s) | 230 | if (!model() || model()->rowCount() == 0) { | |||
---|---|---|---|---|---|
239 | } | 239 | } | ||
240 | p.setPen(d->textColor); | 240 | p.setPen(d->textColor); | ||
241 | 241 | | |||
242 | p.drawText(QRect(0, 0, width(), height()), Qt::AlignCenter, i18n("Drop your favorite folders here...")); | 242 | p.drawText(QRect(0, 0, width(), height()), Qt::AlignCenter, i18n("Drop your favorite folders here...")); | ||
243 | } else { | 243 | } else { | ||
244 | Akonadi::EntityListView::paintEvent(event); | 244 | Akonadi::EntityListView::paintEvent(event); | ||
245 | } | 245 | } | ||
246 | } | 246 | } | ||
247 | void FavoriteCollectionWidget::dragEnterEvent(QDragEnterEvent *event) | ||||
248 | { | ||||
249 | if (event->source() == this) { | ||||
250 | // skip EntityListView logic (we want to reorder favorites, not trigger moving/copying of actual folders) | ||||
251 | QListView::dragEnterEvent(event); | ||||
252 | } else { | ||||
253 | Akonadi::EntityListView::dragEnterEvent(event); | ||||
254 | } | ||||
255 | } | ||||
256 | | ||||
257 | void FavoriteCollectionWidget::dragMoveEvent(QDragMoveEvent *event) | ||||
258 | { | ||||
259 | if (event->source() == this) { | ||||
260 | // skip EntityListView logic (we want to reorder favorites, not trigger moving/copying of actual folders) | ||||
261 | QListView::dragMoveEvent(event); | ||||
262 | } else { | ||||
263 | Akonadi::EntityListView::dragMoveEvent(event); | ||||
264 | } | ||||
265 | } | ||||
266 | | ||||
267 | void FavoriteCollectionWidget::dropEvent(QDropEvent *event) | ||||
268 | { | ||||
269 | if (event->source() == this) { | ||||
270 | // skip EntityListView logic (we want to reorder favorites, not trigger moving/copying of actual folders) | ||||
271 | QListView::dropEvent(event); | ||||
272 | } else { | ||||
273 | Akonadi::EntityListView::dropEvent(event); | ||||
274 | } | ||||
275 | } | ||||
276 | | ||||
277 | void FavoriteCollectionWidget::startDrag(Qt::DropActions supportedActions) | ||||
278 | { | ||||
279 | // skip EntityListView logic (we want to reorder favorites, not trigger moving/copying of actual folders) | ||||
280 | QListView::startDrag(supportedActions); | ||||
281 | } |