From 4500f491ef09e0fa564f2a965fa948e2a832ac27 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 20 Apr 2008 09:40:23 +0000 Subject: [PATCH] when a file attachment annotation has no description, show that there's no description available, instead of nothing svn path=/trunk/KDE/kdegraphics/okular/; revision=799073 --- ui/annotationwidgets.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/annotationwidgets.cpp b/ui/annotationwidgets.cpp index b4698494e..c0821aac6 100644 --- a/ui/annotationwidgets.cpp +++ b/ui/annotationwidgets.cpp @@ -517,6 +517,7 @@ QWidget * FileAttachmentAnnotationWidget::createExtraWidget() Okular::EmbeddedFile *ef = m_attachAnn->embeddedFile(); const int size = ef->size(); const QString sizeString = size <= 0 ? i18nc( "Not available size", "N/A" ) : KGlobal::locale()->formatByteSize( size ); + const QString descString = ef->description().isEmpty() ? i18n( "No description available." ) : ef->description(); QGridLayout * lay = new QGridLayout( widget ); lay->setMargin( 0 ); @@ -530,7 +531,7 @@ QWidget * FileAttachmentAnnotationWidget::createExtraWidget() tmplabel = new QLabel( i18n( "Description:" ), widget ); lay->addWidget( tmplabel, 2, 0 ); - tmplabel = new KSqueezedTextLabel( ef->description(), widget ); + tmplabel = new KSqueezedTextLabel( descString, widget ); tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); lay->addWidget( tmplabel, 3, 0, 1, 2 );