From 8f40bfdb219f33a5713527ed6a45b08d42997eb7 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 24 Dec 2007 23:31:52 +0000 Subject: [PATCH] If the font name is not available, show '-' to the user (instead of nothing). TODO for the string unfreeze: add a better string. svn path=/trunk/KDE/kdegraphics/okular/; revision=752578 --- ui/propertiesdialog.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/propertiesdialog.cpp b/ui/propertiesdialog.cpp index 3e074aad5..373342233 100644 --- a/ui/propertiesdialog.cpp +++ b/ui/propertiesdialog.cpp @@ -272,13 +272,17 @@ QVariant FontsListModel::data( const QModelIndex &index, int role ) const switch ( index.column() ) { - case 0: return m_fonts.at( index.row() ).name(); break; + case 0: + { + QString fontname = m_fonts.at( index.row() ).name(); + return fontname.isEmpty() ? QString::fromLatin1( "-" ) : fontname; // TODO i18n + break; + } case 1: return descriptionForFontType( m_fonts.at( index.row() ).type() ); break; case 2: return descriptionForEmbedType( m_fonts.at( index.row() ).embedType() ); break; case 3: return m_fonts.at( index.row() ).file(); break; - default: - return QVariant(); } + return QVariant(); } QVariant FontsListModel::headerData( int section, Qt::Orientation orientation, int role ) const