diff options
| author | Peter Penz <[email protected]> | 2011-10-06 16:41:29 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-10-06 16:45:15 +0200 |
| commit | 16d4f059c32899d284b202a26af5236cc899abc8 (patch) | |
| tree | e52173ac3304dc7dd09007e15e6bd4bd8f9295e5 /src/search/dolphinsearchbox.cpp | |
| parent | b1f6a546aa34da23a4fad7f63f95d67ad46aba14 (diff) | |
Use QFontMetrics::height() instead of averageCharWidth()
QFontMetrics::averageCharWidth() is quite slow and does not work
well on fonts with broken characters. In the
usecases required by Dolphin QFontMetrics::height() is a better
and faster alternative to get a font-dependent minimum width.
Thanks go to Christoph Feck for this hint!
Diffstat (limited to 'src/search/dolphinsearchbox.cpp')
| -rw-r--r-- | src/search/dolphinsearchbox.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/search/dolphinsearchbox.cpp b/src/search/dolphinsearchbox.cpp index d65eb5b7c..06644e1f3 100644 --- a/src/search/dolphinsearchbox.cpp +++ b/src/search/dolphinsearchbox.cpp @@ -91,7 +91,7 @@ void DolphinSearchBox::setSearchPath(const KUrl& url) m_searchPath = url; QFontMetrics metrics(m_fromHereButton->font()); - const int maxWidth = metrics.averageCharWidth() * 15; + const int maxWidth = metrics.height() * 8; QString location = url.fileName(); if (location.isEmpty()) { |
