diff --git a/src/widgets/kpropertiesdialog.cpp b/src/widgets/kpropertiesdialog.cpp --- a/src/widgets/kpropertiesdialog.cpp +++ b/src/widgets/kpropertiesdialog.cpp @@ -1149,48 +1149,47 @@ } } - if (hasDirs) { // only for directories - sep = new KSeparator(Qt::Horizontal, d->m_frame); - grid->addWidget(sep, curRow, 0, 1, 3); - ++curRow; + // Show volume information only for the root level of a mounted volume + if (isLocal) { + KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(url.toLocalFile()); - if (isLocal) { - KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(url.toLocalFile()); + if (mp && (mp->mountPoint() == directory || mp->mountPoint() == url.toLocalFile())) { + sep = new KSeparator(Qt::Horizontal, d->m_frame); + grid->addWidget(sep, curRow, 0, 1, 3); + ++curRow; - if (mp) { - l = new QLabel(i18n("File System:"), d->m_frame); - grid->addWidget(l, curRow, 0, Qt::AlignRight); + l = new QLabel(i18n("File System:"), d->m_frame); + grid->addWidget(l, curRow, 0, Qt::AlignRight); - l = new QLabel(d->m_frame); - grid->addWidget(l, curRow++, 2); - l->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); - l->setText(mp->mountType()); + l = new QLabel(d->m_frame); + grid->addWidget(l, curRow++, 2); + l->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); + l->setText(mp->mountType()); - l = new QLabel(i18n("Mounted on:"), d->m_frame); - grid->addWidget(l, curRow, 0, Qt::AlignRight); + l = new QLabel(i18n("Mounted on:"), d->m_frame); + grid->addWidget(l, curRow, 0, Qt::AlignRight); - l = new KSqueezedTextLabel(mp->mountPoint(), d->m_frame); - l->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); - grid->addWidget(l, curRow++, 2); + l = new KSqueezedTextLabel(mp->mountPoint(), d->m_frame); + l->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); + grid->addWidget(l, curRow++, 2); - l = new QLabel(i18n("Mounted from:"), d->m_frame); - grid->addWidget(l, curRow, 0, Qt::AlignRight); + l = new QLabel(i18n("Mounted from:"), d->m_frame); + grid->addWidget(l, curRow, 0, Qt::AlignRight); - l = new QLabel(mp->mountedFrom(), d->m_frame); - grid->addWidget(l, curRow++, 2); - l->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); - } - } + l = new QLabel(mp->mountedFrom(), d->m_frame); + grid->addWidget(l, curRow++, 2); + l->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); - l = new QLabel(i18nc("Amount of used and available space on this device or partition", "Free space:"), d->m_frame); - grid->addWidget(l, curRow, 0, Qt::AlignRight); + l = new QLabel(i18nc("Amount of used and available space on this device or partition", "Free space:"), d->m_frame); + grid->addWidget(l, curRow, 0, Qt::AlignRight); - d->m_capacityBar = new KCapacityBar(KCapacityBar::DrawTextOutline, d->m_frame); - d->m_capacityBar->setText(i18nc("@info:status", "Unknown size")); - grid->addWidget(d->m_capacityBar, curRow++, 2); + d->m_capacityBar = new KCapacityBar(KCapacityBar::DrawTextOutline, d->m_frame); + d->m_capacityBar->setText(i18nc("@info:status", "Unknown size")); + grid->addWidget(d->m_capacityBar, curRow++, 2); - KIO::FileSystemFreeSpaceJob *job = KIO::fileSystemFreeSpace(url); - connect(job, &KIO::FileSystemFreeSpaceJob::result, this, &KFilePropsPlugin::slotFreeSpaceResult); + KIO::FileSystemFreeSpaceJob *job = KIO::fileSystemFreeSpace(url); + connect(job, &KIO::FileSystemFreeSpaceJob::result, this, &KFilePropsPlugin::slotFreeSpaceResult); + } } vbl->addStretch(1);