]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/statusbar/mountpointobservercache.cpp
Output of licensedigger + manual cleanup afterwards.
[dolphin.git] / src / statusbar / mountpointobservercache.cpp
index 5be2a9f9553c6b45d2b0e297d703090f31e23585..9bab3d5f2869be57a320d038531ae4367238abe8 100644 (file)
@@ -1,27 +1,13 @@
-/***************************************************************************
- *   Copyright (C) 2014 by Frank Reininghaus <frank78ac@googlemail.com>    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
- ***************************************************************************/
+/*
+ * SPDX-FileCopyrightText: 2014 Frank Reininghaus <frank78ac@googlemail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #include "mountpointobservercache.h"
 
 #include "mountpointobserver.h"
 
-#include <KGlobal>
 #include <KMountPoint>
 
 #include <QTimer>
@@ -31,13 +17,13 @@ class MountPointObserverCacheSingleton
 public:
     MountPointObserverCache instance;
 };
-K_GLOBAL_STATIC(MountPointObserverCacheSingleton, s_MountPointObserverCache)
+Q_GLOBAL_STATIC(MountPointObserverCacheSingleton, s_MountPointObserverCache)
 
 
 MountPointObserverCache::MountPointObserverCache() :
     m_observerForMountPoint(),
     m_mountPointForObserver(),
-    m_updateTimer(0)
+    m_updateTimer(nullptr)
 {
     m_updateTimer = new QTimer(this);
 }
@@ -63,10 +49,10 @@ MountPointObserver* MountPointObserverCache::observerForUrl(const QUrl& url)
         } else {
             // Even if determining the mount point failed, the observer might still
             // be able to retrieve information about the url.
-            cachedObserverUrl = url.toLocalFile();
+            cachedObserverUrl = url;
         }
     } else {
-        cachedObserverUrl = url.url();
+        cachedObserverUrl = url;
     }
 
     MountPointObserver* observer = m_observerForMountPoint.value(cachedObserverUrl);
@@ -79,7 +65,7 @@ MountPointObserver* MountPointObserverCache::observerForUrl(const QUrl& url)
         connect(observer, &MountPointObserver::destroyed, this, &MountPointObserverCache::slotObserverDestroyed);
 
         if (!m_updateTimer->isActive()) {
-            m_updateTimer->start(10000);
+            m_updateTimer->start(60000); // 1 minute
         }
 
         connect(m_updateTimer, &QTimer::timeout, observer, &MountPointObserver::update);