From 36ae0b6185e310113e0e31e247919da866d7f91b Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 11 Nov 2009 18:59:29 +0000 Subject: * don't show the "Add Tags..." and "Add Comments..." links for the meta data inside a tooltip * minor cleanup of thread-interface to allow a proper sorting/merging on client side svn path=/trunk/KDE/kdebase/apps/; revision=1047662 --- src/panels/information/kcommentwidget.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/panels/information/kcommentwidget.cpp') diff --git a/src/panels/information/kcommentwidget.cpp b/src/panels/information/kcommentwidget.cpp index 770b6c10c..c1f7ab757 100644 --- a/src/panels/information/kcommentwidget.cpp +++ b/src/panels/information/kcommentwidget.cpp @@ -29,6 +29,7 @@ KCommentWidget::KCommentWidget(QWidget* parent) : QWidget(parent), + m_readOnly(false), m_label(0), m_comment() { @@ -51,11 +52,22 @@ KCommentWidget::~KCommentWidget() void KCommentWidget::setText(const QString& comment) { - if (comment.isEmpty()) { - m_label->setText("" + i18nc("@label", "Add Comment...") + ""); + QString text; + if (comment.isEmpty()) { + if (m_readOnly) { + text = "-"; + } else { + text = "" + i18nc("@label", "Add Comment...") + ""; + } } else { - m_label->setText("

" + comment + " " + i18nc("@label", "Change...") + "

"); + if (m_readOnly) { + text = comment; + } else { + text = "

" + comment + " " + i18nc("@label", "Change...") + "

"; + } } + + m_label->setText(text); m_comment = comment; } @@ -64,6 +76,17 @@ QString KCommentWidget::text() const return m_comment; } +void KCommentWidget::setReadOnly(bool readOnly) +{ + m_readOnly = readOnly; + setText(m_comment); +} + +bool KCommentWidget::isReadOnly() const +{ + return m_readOnly; +} + void KCommentWidget::slotLinkActivated(const QString& link) { KDialog dialog(this, Qt::Dialog); -- cgit v1.3