]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use KStringHandler::preProcessWrap() to assure, that file names in the Information...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 29 May 2010 12:03:56 +0000 (12:03 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 29 May 2010 12:03:56 +0000 (12:03 +0000)
E. g.
     dolphinviewcontainer.cp
              p
gets wrapped as
     dolphinviewcontainer.
             cpp
now.

svn path=/trunk/KDE/kdebase/apps/; revision=1132031

src/panels/information/informationpanelcontent.cpp

index 73f2626c470f8b8d2b0911f1cc28be3eb1da3642..8d8c21549d6a5c1e03a0715da21433e4321c58e4 100644 (file)
@@ -30,6 +30,7 @@
 #include <klocale.h>
 #include <kmenu.h>
 #include <kseparator.h>
 #include <klocale.h>
 #include <kmenu.h>
 #include <kseparator.h>
+#include <kstringhandler.h>
 
 #include <Phonon/BackendCapabilities>
 #include <Phonon/MediaObject>
 
 #include <Phonon/BackendCapabilities>
 #include <Phonon/MediaObject>
@@ -374,19 +375,21 @@ void InformationPanelContent::setNameLabelText(const QString& text)
     QTextOption textOption;
     textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
 
     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;
     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());
 
     // 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()) {
 
         line = textLayout.createLine();
         if (line.isValid()) {