Bug 127677 - Message subject unnecessarily HTML-encoded in download status popup
Summary: Message subject unnecessarily HTML-encoded in download status popup
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: IMAP (show other bugs)
Version: 1.9.1
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-19 19:29 UTC by Ilya Konstantinov
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Konstantinov 2006-05-19 19:29:45 UTC
Version:           1.9.1 (using KDE KDE 3.5.2)
Installed from:    Debian testing/unstable Packages

Message subject unnecessarily HTML-encoded (e.g. & replaced with &) in download status popup (the popup you see when you expand the download progress bar by clicking its arrow button).
Comment 1 Ingo Klöcker 2006-05-21 23:55:55 UTC
SVN commit 543387 by kloecker:

Fix bug 127677 (Message subject unnecessarily HTML-encoded in download status popup)
Apparently, QLabel's rich text auto-detection fails for 'bla & fasel'. Therefore we explicitly set the text format to rich text, albeit without automatic word wrapping.
Update the API docs of KPIM::ProgressManager to make clear that the label and the status texts will be interpreted as rich text and thus might need to be escaped. I'll fix all callers of ProgressManager::createProgressItem with the next commit.
BUG:127677
CCMAIL:kde-pim@kde.org


 M  +7 -1      progressdialog.cpp  
 M  +10 -3     progressmanager.h  


--- branches/KDE/3.5/kdepim/libkdepim/progressdialog.cpp #543386:543387
@@ -157,6 +157,9 @@
   h->setSpacing( 5 );
 
   mItemLabel = new QLabel( item->label(), h );
+  // always interpret the label text as RichText, but disable word wrapping
+  mItemLabel->setTextFormat( Qt::RichText );
+  mItemLabel->setAlignment( Qt::AlignAuto | Qt::AlignVCenter | Qt::SingleLine );
   h->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) );
 
   mProgress = new QProgressBar( 100, h );
@@ -174,7 +177,10 @@
   h->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) );
   mSSLLabel = new SSLLabel( h );
   mSSLLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
-  mItemStatus =  new QLabel( item->status(), h );
+  mItemStatus = new QLabel( item->status(), h );
+  // always interpret the status text as RichText, but disable word wrapping
+  mItemStatus->setTextFormat( Qt::RichText );
+  mItemStatus->setAlignment( Qt::AlignAuto | Qt::AlignVCenter | Qt::SingleLine );
   setCrypto( item->usesCrypto() );
   if( first ) hideHLine();
 }
--- branches/KDE/3.5/kdepim/libkdepim/progressmanager.h #543386:543387
@@ -61,7 +61,8 @@
     const QString& label() const { return mLabel; }
 
     /**
-     * @param v Set the user visible string identifying this item.
+     * @param v Set the user visible string identifying this item. @p v will
+                be interpreted as rich text, so it might have to be escaped.
      */
     void setLabel( const QString& v );
 
@@ -71,6 +72,7 @@
     const QString& status() const { return mStatus; }
     /**
      * Set the string to be used for showing this item's current status.
+     * @p v will be interpreted as rich text, so it might have to be escaped.
      * @param v The status string.
      */
     void setStatus( const QString& v );
@@ -263,6 +265,9 @@
       * Creates a ProgressItem with a unique id and the given label.
       * This is the simplest way to aquire a progress item. It will not
       * have a parent and will be set to be cancellable and not using crypto.
+      *
+      * @param label The text to be displayed by progress handlers. It will be
+      *              interpreted as rich text, so it might have to be escaped.
       */
      static ProgressItem * createProgressItem( const QString &label ) {
        return instance()->createProgressItemImpl( 0, getUniqueID(), label,
@@ -275,8 +280,10 @@
      *
      * @param parent Specify an already existing item as the parent of this one.
      * @param id Used to identify this operation for cancel and progress info.
-     * @param label The text to be displayed by progress handlers
-     * @param status Additional text to be displayed for the item.
+     * @param label The text to be displayed by progress handlers. It will be
+     *              interpreted as rich text, so it might have to be escaped.
+     * @param status Additional text to be displayed for the item. It will be
+     *               interpreted as rich text, so it might have to be escaped.
      * @param canBeCanceled can the user cancel this operation?
      * @param usesCrypto does the operation use secure transports (SSL)
      * Cancelling the parent will cancel the children as well (if they can be