summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-17 18:34:15 (GMT)
committerElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-17 18:34:15 (GMT)
commit5696ec946c6d3c510b10d4a5943a39d8e07dc58b (patch)
tree6983ed412cd17e6ebd9d5c5a584db505e102bbd0
parent5e3906ccf56dc54d373970fddae66fcdc35047b0 (diff)
Enable KMessageWidget word-wrapping if kwidgetsaddons >= 5.29
KWidgetsAddons 5.29 has an important fix for word-wrapping in KMessageWidget. So we enable word-wrapping only if the version detected at runtime is 5.29 or higher. Differential Revision: D3409
-rw-r--r--kerfuffle/compressionoptionswidget.cpp6
-rw-r--r--part/part.cpp6
2 files changed, 11 insertions, 1 deletions
diff --git a/kerfuffle/compressionoptionswidget.cpp b/kerfuffle/compressionoptionswidget.cpp
index dad86f8..6d6a000 100644
--- a/kerfuffle/compressionoptionswidget.cpp
+++ b/kerfuffle/compressionoptionswidget.cpp
@@ -33,6 +33,7 @@
#include <KColorScheme>
#include <KPluginMetaData>
+#include <kwidgetsaddons_version.h>
#include <QMimeDatabase>
@@ -58,6 +59,11 @@ CompressionOptionsWidget::CompressionOptionsWidget(QWidget *parent,
// Convert from kilobytes.
volumeSizeSpinbox->setValue(static_cast<double>(m_opts.volumeSize()) / 1024);
}
+
+ // KWidgetsAddons 5.29 fixes KMessageWidget word-wrapping.
+ if (KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 29, 0)) {
+ warningMsgWidget->setWordWrap(true);
+ }
}
CompressionOptions CompressionOptionsWidget::commpressionOptions() const
diff --git a/part/part.cpp b/part/part.cpp
index 3906d7d..d174a15 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -56,6 +56,7 @@
#include <KStandardGuiItem>
#include <KToggleAction>
#include <KLocalizedString>
+#include <kwidgetsaddons_version.h>
#include <KXMLGUIFactory>
#include <QAction>
@@ -123,7 +124,10 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList& args)
m_commentBox->setLayout(vbox);
m_messageWidget = new KMessageWidget(parentWidget);
- m_messageWidget->setWordWrap(true);
+ // KWidgetsAddons 5.29 fixes KMessageWidget word-wrapping.
+ if (KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 29, 0)) {
+ m_messageWidget->setWordWrap(true);
+ }
m_messageWidget->hide();
m_commentMsgWidget = new KMessageWidget();