--- src/part/summaryWidget.cpp.orig 2013-11-24 22:07:54.000000000 +0900 +++ src/part/summaryWidget.cpp 2013-11-24 22:06:42.000000000 +0900 @@ -45,6 +45,13 @@ #include #include +#ifdef __APPLE_KDE__ +#include +#include +#include +#include +#endif + struct Disk { QString mount; @@ -137,7 +144,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 +171,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 +217,5 @@ *this += disk; } +#endif }