Changeset View
Changeset View
Standalone View
Standalone View
src/kcommentwidget.cpp
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | |||||
57 | { | 57 | { | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | void KCommentWidget::setText(const QString& comment) | 60 | void KCommentWidget::setText(const QString& comment) | ||
61 | { | 61 | { | ||
62 | QString text; | 62 | QString text; | ||
63 | if (comment.isEmpty()) { | 63 | if (comment.isEmpty()) { | ||
64 | if (m_readOnly) { | 64 | if (m_readOnly) { | ||
65 | text = "-"; | 65 | text = QStringLiteral("-"); | ||
66 | } else { | 66 | } else { | ||
67 | text = "<a href=\"addComment\">" + i18nc("@label", "Add...") + "</a>"; | 67 | text = QStringLiteral("<a href=\"addComment\">") + i18nc("@label", "Add...") + QStringLiteral("</a>"); | ||
68 | } | 68 | } | ||
69 | } else { | 69 | } else { | ||
70 | if (m_readOnly) { | 70 | if (m_readOnly) { | ||
71 | text = QString(comment).toHtmlEscaped(); | 71 | text = comment.toHtmlEscaped(); | ||
72 | } else { | 72 | } else { | ||
73 | text = "<p>" + QString(comment).toHtmlEscaped() + " <a href=\"editComment\">" + i18nc("@label", "Edit...") + "</a></p>"; | 73 | text = QStringLiteral("<p>") + comment.toHtmlEscaped() + QStringLiteral(" <a href=\"editComment\">") + i18nc("@label", "Edit...") + QStringLiteral("</a></p>"); | ||
bruns: `... + comment.toHtmlEscaped() + ...` | |||||
74 | } | 74 | } | ||
75 | } | 75 | } | ||
76 | 76 | | |||
77 | m_label->setText(text); | 77 | m_label->setText(text); | ||
78 | m_sizeHintHelper->setText(text); | 78 | m_sizeHintHelper->setText(text); | ||
79 | m_comment = comment; | 79 | m_comment = comment; | ||
80 | } | 80 | } | ||
81 | 81 | | |||
Show All 28 Lines | 109 | { | |||
110 | if (event->type() == QEvent::Polish) { | 110 | if (event->type() == QEvent::Polish) { | ||
111 | m_label->setForegroundRole(foregroundRole()); | 111 | m_label->setForegroundRole(foregroundRole()); | ||
112 | } | 112 | } | ||
113 | return QWidget::event(event); | 113 | return QWidget::event(event); | ||
114 | } | 114 | } | ||
115 | 115 | | |||
116 | void KCommentWidget::slotLinkActivated(const QString& link) | 116 | void KCommentWidget::slotLinkActivated(const QString& link) | ||
117 | { | 117 | { | ||
118 | const QString caption = (link == "editComment") ? | 118 | const QString caption = (link == QLatin1String("editComment")) ? | ||
119 | i18nc("@title:window", "Edit Comment") : | 119 | i18nc("@title:window", "Edit Comment") : | ||
120 | i18nc("@title:window", "Add Comment"); | 120 | i18nc("@title:window", "Add Comment"); | ||
121 | 121 | | |||
122 | QPointer<KEditCommentDialog> dialog = new KEditCommentDialog(this, m_comment, caption); | 122 | QPointer<KEditCommentDialog> dialog = new KEditCommentDialog(this, m_comment, caption); | ||
123 | 123 | | |||
124 | KConfigGroup dialogConfig(KSharedConfig::openConfig(), "Baloo KEditCommentDialog"); | 124 | KConfigGroup dialogConfig(KSharedConfig::openConfig(), "Baloo KEditCommentDialog"); | ||
125 | KWindowConfig::restoreWindowSize(dialog->windowHandle(), dialogConfig); | 125 | KWindowConfig::restoreWindowSize(dialog->windowHandle(), dialogConfig); | ||
126 | 126 | | |||
Show All 16 Lines |
... + comment.toHtmlEscaped() + ...