2 * SPDX-FileCopyrightText: 2014 Frank Reininghaus <frank78ac@googlemail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #ifndef MOUNTPOINTOBSERVERCACHE_H
8 #define MOUNTPOINTOBSERVERCACHE_H
13 class MountPointObserver
;
16 class MountPointObserverCache
: public QObject
20 MountPointObserverCache();
21 ~MountPointObserverCache() override
;
24 static MountPointObserverCache
*instance();
27 * Returns a MountPointObserver for the given \a url. A new observer is created if necessary.
29 MountPointObserver
*observerForUrl(const QUrl
&url
);
33 * Removes the given \a observer from the cache.
35 void slotObserverDestroyed(QObject
*observer
);
38 QHash
<QUrl
, MountPointObserver
*> m_observerForMountPoint
;
39 QHash
<QObject
*, QUrl
> m_mountPointForObserver
;
40 QTimer
*m_updateTimer
;
42 friend class MountPointObserverCacheSingleton
;