[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/runtime/kioslave/trash
From:       Kevin Ottens <ervin () kde ! org>
Date:       2006-10-31 21:36:53
Message-ID: 1162330613.238618.20259.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 600807 by ervin:

Use Solid instead of KMountPoint.


 M  +2 -2      CMakeLists.txt  
 M  +1 -1      kfile-plugin/CMakeLists.txt  
 M  +18 -22    trashimpl.cpp  


--- trunk/KDE/kdebase/runtime/kioslave/trash/CMakeLists.txt #600806:600807
@@ -15,7 +15,7 @@
 
 kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kio_trash )
 
-target_link_libraries(kio_trash  ${KDE4_KIO_LIBS})
+target_link_libraries(kio_trash  ${KDE4_KIO_LIBS} ${KDE4_SOLID_LIBS})
 
 install(TARGETS kio_trash  DESTINATION ${PLUGIN_INSTALL_DIR} )
 
@@ -44,7 +44,7 @@
 
   kde4_add_executable(testtrash ${testtrash_SRCS})
 
-  target_link_libraries(testtrash  ${KDE4_KIO_LIBS} )
+  target_link_libraries(testtrash  ${KDE4_KIO_LIBS} ${KDE4_SOLID_LIBS})
 
   add_test(kioslave-testtrash ${EXECUTABLE_OUTPUT_PATH}/testtrash)
 
--- trunk/KDE/kdebase/runtime/kioslave/trash/kfile-plugin/CMakeLists.txt \
#600806:600807 @@ -9,7 +9,7 @@
 
 kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kfile_trash )
 
-target_link_libraries(kfile_trash  ${KDE4_KIO_LIBS} ${QT_QT3SUPPORT_LIBRARY} )
+target_link_libraries(kfile_trash  ${KDE4_KIO_LIBS} ${KDE4_SOLID_LIBS} \
${QT_QT3SUPPORT_LIBRARY} )  
 install(TARGETS kfile_trash  DESTINATION ${PLUGIN_INSTALL_DIR} )
 
--- trunk/KDE/kdebase/runtime/kioslave/trash/trashimpl.cpp #600806:600807
@@ -29,9 +29,11 @@
 #include <kglobal.h>
 #include <kstandarddirs.h>
 #include <kglobalsettings.h>
-#include <kmountpoint.h>
 #include <kfileitem.h>
 #include <kio/chmodjob.h>
+#include <solid/devicemanager.h>
+#include <solid/device.h>
+#include <solid/volume.h>
 
 #include <QApplication>
 #include <QEventLoop>
@@ -730,27 +732,21 @@
 
 void TrashImpl::scanTrashDirectories() const
 {
-    const KMountPoint::List lst = KMountPoint::currentMountPoints();
-    for ( KMountPoint::List::ConstIterator it = lst.begin() ; it != lst.end() ; ++it \
                ) {
-        const QByteArray str = (*it)->mountType().toLatin1();
-        // Skip pseudo-filesystems, there's no chance we'll find a .Trash on them :)
-        // ## Maybe we should also skip readonly filesystems
-        if ( str != "proc" && str != "devfs" && str != "usbdevfs" &&
-             str != "sysfs" && str != "devpts" && str != "subfs" /* #96259 */ &&
-             str != "autofs" /* #101116 */ ) {
-            QString topdir = (*it)->mountPoint();
-            QString trashDir = trashForMountPoint( topdir, false );
-            if ( !trashDir.isEmpty() ) {
-                // OK, trashDir is a valid trash directory. Ensure it's registered.
-                int trashId = idForTrashDirectory( trashDir );
-                if ( trashId == -1 ) {
-                    // new trash dir found, register it
-                    m_trashDirectories.insert( ++m_lastId, trashDir );
-                    kDebug() << k_funcinfo << "found " << trashDir << " gave it id " \
                << m_lastId << endl;
-                    if ( !topdir.endsWith( "/" ) )
-                        topdir += '/';
-                    m_topDirectories.insert( m_lastId, topdir );
-                }
+    Solid::DeviceList lst = \
Solid::DeviceManager::self().findDevicesFromQuery(QString(), \
Solid::Capability::Volume, +                                                          \
"Volume.mounted = true"); +    for ( Solid::DeviceList::Iterator it = lst.begin() ; \
it != lst.end() ; ++it ) { +        QString topdir = \
(*it).as<Solid::Volume>()->mountPoint(); +        QString trashDir = \
trashForMountPoint( topdir, false ); +        if ( !trashDir.isEmpty() ) {
+            // OK, trashDir is a valid trash directory. Ensure it's registered.
+            int trashId = idForTrashDirectory( trashDir );
+            if ( trashId == -1 ) {
+                // new trash dir found, register it
+                m_trashDirectories.insert( ++m_lastId, trashDir );
+                kDebug() << k_funcinfo << "found " << trashDir << " gave it id " << \
m_lastId << endl; +                if ( !topdir.endsWith( "/" ) )
+                    topdir += '/';
+                m_topDirectories.insert( m_lastId, topdir );
             }
         }
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic