diff --git a/src/radialMap/widgetEvents.cpp b/src/radialMap/widgetEvents.cpp --- a/src/radialMap/widgetEvents.cpp +++ b/src/radialMap/widgetEvents.cpp @@ -150,24 +150,45 @@ { setCursor(Qt::PointingHandCursor); + QString string; + + if (isSummary()) { + if (strcmp("used", m_focus->file()->name8Bit()) == 0) { + string = i18nc("Tooltip of used space on the partition, %1 is path, %2 is size", "%1\nUsed: %2", + m_focus->file()->parent()->displayPath(), + m_focus->file()->humanReadableSize()); + } else if (strcmp("free", m_focus->file()->name8Bit()) == 0) { + string = i18nc("Tooltip of free space on the partition, %1 is path, %2 is size", "%1\nFree: %2", + m_focus->file()->parent()->displayPath(), + m_focus->file()->humanReadableSize()); + } else { + string = i18nc("Tooltip of file/folder, %1 is path, %2 is size", "%1\n%2", + m_focus->file()->displayPath(), + m_focus->file()->humanReadableSize()); + } + } else { + string = i18nc("Tooltip of file/folder, %1 is path, %2 is size", "%1\n%2", + m_focus->file()->displayPath(), + m_focus->file()->humanReadableSize()); + + if (m_focus->file()->isFolder()) { + int files = static_cast(m_focus->file())->children(); + const uint percent = uint((100 * files) / (double)m_tree->children()); + + string += QLatin1Char('\n'); + if (percent > 0) { + string += i18ncp("Tooltip of folder, %1 is number of files", + "%1 File (%2%)", "%1 Files (%2%)", files, percent); + } else { + string += i18ncp("Tooltip of folder, %1 is number of files", + "%1 File", "%1 Files", files); + } + } - QString string = m_focus->file()->displayPath() - + QLatin1Char('\n') - + m_focus->file()->humanReadableSize(); - - if (m_focus->file()->isFolder()) { - int files = static_cast(m_focus->file())->children(); - const uint percent = uint((100 * files) / (double)m_tree->children()); - string += QLatin1Char('\n'); - string += i18np("File: %1", "Files: %1", files); - - - if (percent > 0) string += QString(QLatin1String(" (%1%)")).arg(percent); - } - - const QUrl url = Widget::url(m_focus->file()); - if (m_focus == m_rootSegment && url != KIO::upUrl(url)) { - string += i18n("\nClick to go up to parent directory"); + const QUrl url = Widget::url(m_focus->file()); + if (m_focus == m_rootSegment && url != KIO::upUrl(url)) { + string += i18n("\nClick to go up to parent directory"); + } } // Calculate a semi-sane size for the tooltip diff --git a/src/summaryWidget.cpp b/src/summaryWidget.cpp --- a/src/summaryWidget.cpp +++ b/src/summaryWidget.cpp @@ -109,9 +109,6 @@ { DiskList disks; - const QByteArray free = i18nc("Free space on the disks/partitions", "Free").toUtf8(); - const QByteArray used = i18nc("Used space on the disks/partitions", "Used").toUtf8(); - QString text; for (DiskList::ConstIterator it = disks.constBegin(), end = disks.constEnd(); it != end; ++it) @@ -148,8 +145,8 @@ qobject_cast(layout())->addWidget(volume, layout()->count()/2, layout()->count() % 2); Folder *tree = new Folder(disk.mount.toUtf8().constData()); - tree->append(free.constData(), disk.free); - tree->append(used.constData(), disk.used); + tree->append("free", disk.free); + tree->append("used", disk.used); map->create(tree); //must be done when visible