From: Peter Penz Date: Thu, 11 Nov 2010 18:27:14 +0000 (+0000) Subject: The string freeze is near: Add a string that may contain the file-name as paramater. X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/943cb0c1c79629e5780163825422cf6827ef6008 The string freeze is near: Add a string that may contain the file-name as paramater. svn path=/trunk/KDE/kdebase/apps/; revision=1195670 --- diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index 6ab1362c8..0ff9e9b1d 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -81,6 +81,11 @@ void DolphinSearchBox::setSearchPath(const KUrl& url) { m_searchPath = url; m_filterButton->setVisible(m_nepomukActivated && isSearchPathIndexed()); + + QFontMetrics metrics(m_fromHereButton->font()); + const int maxWidth = metrics.averageCharWidth() * 15; + const QString fileName = metrics.elidedText(url.fileName(), Qt::ElideMiddle, maxWidth); + m_fromHereButton->setText(i18nc("action:button", "From Here (%1)", fileName)); } KUrl DolphinSearchBox::searchPath() const