From kde-pim Sun May 21 21:55:50 2006 From: =?utf-8?q?Ingo=20Kl=C3=B6cker?= Date: Sun, 21 May 2006 21:55:50 +0000 To: kde-pim Subject: [Kde-pim] branches/KDE/3.5/kdepim/libkdepim Message-Id: <1148248550.598201.29063.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-pim&m=114824855903321 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 _______________________________________________ kde-pim mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim kde-pim home page at http://pim.kde.org/