diff options
| author | Peter Penz <[email protected]> | 2010-05-29 12:03:56 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2010-05-29 12:03:56 +0000 |
| commit | abf29a89efc569db4e51d582eec95d7740db36ad (patch) | |
| tree | 7920d0e0757d5998039b6722145d3d9f4d81eeb7 /src | |
| parent | c1f220595bf692876a75c51d8020733646031a67 (diff) | |
Use KStringHandler::preProcessWrap() to assure, that file names in the Information Panel are wrapped in a more clever way:
E. g.
dolphinviewcontainer.cp
p
gets wrapped as
dolphinviewcontainer.
cpp
now.
svn path=/trunk/KDE/kdebase/apps/; revision=1132031
Diffstat (limited to 'src')
| -rw-r--r-- | src/panels/information/informationpanelcontent.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 73f2626c4..8d8c21549 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -30,6 +30,7 @@ #include <klocale.h> #include <kmenu.h> #include <kseparator.h> +#include <kstringhandler.h> #include <Phonon/BackendCapabilities> #include <Phonon/MediaObject> @@ -374,19 +375,21 @@ void InformationPanelContent::setNameLabelText(const QString& text) QTextOption textOption; textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); - QTextLayout textLayout(text); + const QString processedText = KStringHandler::preProcessWrap(text); + + QTextLayout textLayout(processedText); textLayout.setFont(m_nameLabel->font()); textLayout.setTextOption(textOption); QString wrappedText; - wrappedText.reserve(text.length()); + wrappedText.reserve(processedText.length()); // wrap the text to fit into the width of m_nameLabel textLayout.beginLayout(); QTextLine line = textLayout.createLine(); while (line.isValid()) { line.setLineWidth(m_nameLabel->width()); - wrappedText += text.mid(line.textStart(), line.textLength()); + wrappedText += processedText.mid(line.textStart(), line.textLength()); line = textLayout.createLine(); if (line.isValid()) { |
