[83585] trunk/dports/kde/kdeutils4

snc at macports.org snc at macports.org
Tue Sep 6 11:12:24 PDT 2011


Revision: 83585
          http://trac.macports.org/changeset/83585
Author:   snc at macports.org
Date:     2011-09-06 11:12:21 -0700 (Tue, 06 Sep 2011)
Log Message:
-----------
kdeutils4: add Filelight patches, #31081

Modified Paths:
--------------
    trunk/dports/kde/kdeutils4/Portfile

Added Paths:
-----------
    trunk/dports/kde/kdeutils4/files/fix-filelight-cache.diff
    trunk/dports/kde/kdeutils4/files/fix-filelight-mounts.diff

Modified: trunk/dports/kde/kdeutils4/Portfile
===================================================================
--- trunk/dports/kde/kdeutils4/Portfile	2011-09-06 15:40:58 UTC (rev 83584)
+++ trunk/dports/kde/kdeutils4/Portfile	2011-09-06 18:12:21 UTC (rev 83585)
@@ -6,7 +6,7 @@
 
 name                kdeutils4
 version             4.7.0
-revision            1
+revision            2
 conflicts           kdelibs4-experimental
 categories          kde kde4
 maintainers         snc sharky
@@ -28,7 +28,9 @@
                     port:libzip port:libarchive
 
 patch.dir           ${workpath}/${distname}
-patchfiles          fix-namespace.diff
+patchfiles          fix-namespace.diff \
+                    fix-filelight-cache.diff \
+                    fix-filelight-mounts.diff
 
 configure.args-append   -DWITH_SIP=OFF \
                         -DBUILD_printer-applet=OFF

Added: trunk/dports/kde/kdeutils4/files/fix-filelight-cache.diff
===================================================================
--- trunk/dports/kde/kdeutils4/files/fix-filelight-cache.diff	                        (rev 0)
+++ trunk/dports/kde/kdeutils4/files/fix-filelight-cache.diff	2011-09-06 18:12:21 UTC (rev 83585)
@@ -0,0 +1,58 @@
+--- filelight/src/part/scan.cpp	2010-10-05 07:38:31.000000000 -0400
++++ filelight/src/part/scan.cpp	2011-08-31 21:56:45.000000000 -0400
+@@ -42,6 +42,7 @@
+ {
+     Filelight::LocalLister::readMounts();
+     connect(this, SIGNAL(branchCompleted(Folder*, bool)), this, SLOT(cacheTree(Folder*, bool)), Qt::QueuedConnection);
++    connect(this, SIGNAL(branchCacheHit(Folder*)), this, SLOT(foundCached(Folder*)), Qt::QueuedConnection);
+ }
+ 
+ ScanManager::~ScanManager()
+@@ -112,6 +113,8 @@
+ 
+                     const Link<File> *end = d->end();
+                     QString s = split.first();
++                    if (s.isEmpty()) //found the dir
++                      break;
+                     s += QLatin1Char( '/' );
+ 
+                     for (d = 0; jt != end; ++jt)
+@@ -131,7 +134,7 @@
+                     //we found a completed tree, thus no need to scan
+                     kDebug() << "Found cache-handle, generating map.." << endl;
+ 
+-                    emit branchCompleted(d, true);
++                    emit branchCacheHit(d);
+ 
+                     return true;
+                 }
+@@ -221,6 +224,13 @@
+ 
+     QApplication::restoreOverrideCursor();
+ }
++
++void
++ScanManager::foundCached(Folder *tree)
++{
++    emit completed(tree);
++    QApplication::restoreOverrideCursor();
++}
+ }
+ 
+ #include "scan.moc"
+--- filelight/src/part/scan.h	2010-10-05 07:38:31.000000000 -0400
++++ filelight/src/part/scan.h	2011-08-31 23:08:11.000000000 -0400
+@@ -54,11 +54,13 @@
+     bool abort();
+     void emptyCache();
+     void cacheTree(Folder*, bool);
++    void foundCached(Folder*);
+ 
+ signals:
+     void completed(Folder*);
+     void aboutToEmptyCache();
+     void branchCompleted(Folder* tree, bool finished);
++    void branchCacheHit(Folder* tree);
+ 
+ private:
+     bool m_abort;

Added: trunk/dports/kde/kdeutils4/files/fix-filelight-mounts.diff
===================================================================
--- trunk/dports/kde/kdeutils4/files/fix-filelight-mounts.diff	                        (rev 0)
+++ trunk/dports/kde/kdeutils4/files/fix-filelight-mounts.diff	2011-09-06 18:12:21 UTC (rev 83585)
@@ -0,0 +1,99 @@
+--- filelight/src/part/localLister.cpp	2011-05-20 16:16:55.000000000 -0400
++++ filelight/src/part/localLister.cpp	2011-08-31 23:21:57.000000000 -0400
+@@ -45,6 +45,10 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+ 
++#ifdef __APPLE_KDE__
++#include <sys/mount.h>
++#endif
++
+ #ifdef HAVE_MNTENT_H
+ #include <mntent.h>
+ #endif
+@@ -250,7 +254,25 @@
+         }
+     }
+ 
+-    kDebug() << "Found the following remote filesystems: " << s_remoteMounts;
++#ifdef __APPLE_KDE__
++    struct statfs *mounts;
++    int nmounts = getmntinfo(&mounts, MNT_WAIT);
++    for (int i = 0; i < nmounts; ++i) {
++    	struct statfs *m = mounts + i;
++    	if (m->f_flags & MNT_ROOTFS)
++    		continue;
++	
++    	QString str = QString::fromUtf8(m->f_mntonname);
++    	str += QLatin1Char('/');
++	
++    	QStringList &list = (m->f_flags & MNT_LOCAL)
++    		? s_localMounts : s_remoteMounts;
++    	if (!list.contains(str))
++    		list.append(str);
++    }
++#endif
++
++	kDebug() << "Found the following remote filesystems: " << s_remoteMounts;
+     kDebug() << "Found the following local filesystems: " << s_localMounts;
+ }
+ 
+--- filelight/src/part/summaryWidget.cpp	2010-10-05 07:38:31.000000000 -0400
++++ filelight/src/part/summaryWidget.cpp	2011-08-31 23:23:12.000000000 -0400
+@@ -45,6 +45,11 @@
+ #include <QtGui/QMouseEvent>
+ #include <QtGui/QLayout>
+ 
++#ifdef __APPLE_KDE__
++#include <QFileIconProvider>
++#include <sys/mount.h>
++#endif
++
+ struct Disk
+ {
+     QString mount;
+@@ -137,7 +142,12 @@
+         QLabel *label = new QLabel(text, this);
+         horizontalLayout->addWidget(label);
+         QLabel *icon = new QLabel(this);
++#ifdef __APPLE_KDE__
++		QIcon i = QFileIconProvider().icon(QFileInfo(disk.mount));
++        icon->setPixmap(i.pixmap(32,32));
++#else
+         icon->setPixmap(KIcon(disk.icon).pixmap(16,16));
++#endif
+         horizontalLayout->addWidget(icon);
+ 
+         horizontalLayout->setAlignment(Qt::AlignCenter);
+@@ -159,6 +169,25 @@
+ 
+ DiskList::DiskList()
+ {
++#ifdef __APPLE_KDE__
++	struct statfs *mounts;
++	int nmounts = getmntinfo(&mounts, MNT_WAIT);
++	for (int i = 0; i < nmounts; ++i) {
++		struct statfs *m = mounts + i;
++		
++		char *path = m->f_mntonname;
++		if (m->f_blocks == 0 || m->f_flags & MNT_DONTBROWSE ||
++				access(path, R_OK | X_OK) != 0)
++			continue;
++		
++		Disk disk;
++		disk.mount = QString::fromUtf8(path);
++		disk.size = m->f_blocks * m->f_bsize / 1024;
++		disk.free = m->f_bfree * m->f_bsize / 1024;
++		disk.used = disk.size - disk.free;
++        *this += disk;
++    }
++#else
+     const Solid::StorageAccess *partition;
+     QStringList partitions;
+ 
+@@ -186,4 +215,5 @@
+ 
+         *this += disk;
+     }
++#endif
+ }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110906/fcf5e57e/attachment.html>


More information about the macports-changes mailing list