]>
cloud.milkyroute.net Git - dolphin.git/blob - src/panels/places/placesitemsignalhandler.h
2 * SPDX-FileCopyrightText: 2012 Peter Penz <peter.penz19@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #ifndef PLACESITEMSIGNALHANDLER_H
8 #define PLACESITEMSIGNALHANDLER_H
15 * @brief Helper class for PlacesItem to be able to listen to signals
16 * and performing a corresponding action.
18 * PlacesItem is derived from KStandardItem, which is no QObject-class
19 * on purpose. To be able to internally listen to signals and performing a
20 * corresponding action, PlacesItemSignalHandler is used.
22 * E.g. if the PlacesItem wants to react on accessibility-changes of a storage-access,
23 * the signal-handler can be used like this:
25 * QObject::connect(storageAccess, SIGNAL(accessibilityChanged(bool,QString)),
26 * signalHandler, SLOT(onAccessibilityChanged()));
29 * The slot PlacesItemSignalHandler::onAccessibilityChanged() will call
30 * the method PlacesItem::onAccessibilityChanged().
32 class PlacesItemSignalHandler
: public QObject
37 explicit PlacesItemSignalHandler(PlacesItem
* item
, QObject
* parent
= nullptr);
38 ~PlacesItemSignalHandler() override
;
42 * Calls PlacesItem::onAccessibilityChanged()
44 void onAccessibilityChanged();
46 void onTearDownRequested(const QString
& udi
);
48 void onTrashEmptinessChanged(bool isTrashEmpty
);
51 void tearDownExternallyRequested(const QString
& udi
);