From 488e7455b67bf467157081aeb7914e13e761fde7 Mon Sep 17 00:00:00 2001
From: Kevin Kofler
Date: Fri, 12 Sep 2008 20:32:08 +0000
Subject: [PATCH] Sync from F-9:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Mon Sep 08 2008 Lukáš Tinkl 4.1.1-6
- fix crashes in plugin selector
- fix problems in various kdeui widgets
---
kdelibs-4.1.1-kdeui-widgets-fixes.patch | 120 ++++++++++++++++++++++++
kdelibs-4.1.1-kutils-fixes.patch | 40 ++++++++
kdelibs.spec | 10 +-
3 files changed, 169 insertions(+), 1 deletion(-)
create mode 100644 kdelibs-4.1.1-kdeui-widgets-fixes.patch
create mode 100644 kdelibs-4.1.1-kutils-fixes.patch
diff --git a/kdelibs-4.1.1-kdeui-widgets-fixes.patch b/kdelibs-4.1.1-kdeui-widgets-fixes.patch
new file mode 100644
index 0000000..a456fc1
--- /dev/null
+++ b/kdelibs-4.1.1-kdeui-widgets-fixes.patch
@@ -0,0 +1,120 @@
+Index: kdeui/widgets/krichtextedit.cpp
+===================================================================
+--- kdeui/widgets/krichtextedit.cpp (revision 857817)
++++ kdeui/widgets/krichtextedit.cpp (revision 857818)
+@@ -492,7 +492,7 @@
+ static QString evilline = "";
+-
++
+ QString result;
+ QStringList lines = toHtml().split("\n");
+ foreach(QString tempLine, lines ) {
+@@ -507,6 +507,33 @@
+ result += tempLine;
+ }
+ }
++
++ // ### HACK to fix bug 86925: A completely empty line is ignored in HTML-mode
++ int offset = 0;
++ QRegExp paragraphFinder("
(.*)
");
++ QRegExp paragraphEnd("");
++ paragraphFinder.setMinimal(true);
++
++ while (offset != -1) {
++
++ // Find the next paragraph
++ offset = paragraphFinder.indexIn(result, offset);
++
++ if (offset != -1) {
++
++ // If the text in the paragraph is empty, add a   there.
++ if (paragraphFinder.capturedTexts().size() == 2 &&
++ paragraphFinder.capturedTexts()[1].isEmpty()) {
++ int end = paragraphEnd.indexIn(result, offset);
++ Q_ASSERT(end != -1 && end > offset);
++ result.replace(end, paragraphEnd.pattern().length(), "
");
++ }
++
++ // Avoid finding the same match again
++ offset++;
++ }
++ }
++
+ return result;
+ }
+
+Index: kdeui/fonts/kfontchooser.cpp
+===================================================================
+--- kdeui/fonts/kfontchooser.cpp (revision 858147)
++++ kdeui/fonts/kfontchooser.cpp (revision 858148)
+@@ -444,6 +444,10 @@
+ QPalette pal = d->sampleEdit->palette();
+ pal.setColor( QPalette::Active, QPalette::Text, col );
+ d->sampleEdit->setPalette( pal );
++ QTextCursor cursor = d->sampleEdit->textCursor();
++ d->sampleEdit->selectAll();
++ d->sampleEdit->setTextColor( col );
++ d->sampleEdit->setTextCursor( cursor );
+ }
+
+ QColor KFontChooser::color() const
+Index: kdeui/widgets/khelpmenu.cpp
+===================================================================
+--- kdeui/widgets/khelpmenu.cpp (revision 858312)
++++ kdeui/widgets/khelpmenu.cpp (revision 858313)
+@@ -162,6 +162,7 @@
+ d->mWhatsThisAction = new KAction(KIcon("help-contextual"), i18n( "What's &This" ), d->mMenu);
+ d->mWhatsThisAction->setShortcut(Qt::SHIFT + Qt::Key_F1);
+ connect(d->mWhatsThisAction, SIGNAL(triggered(bool)), this, SLOT(contextHelpActivated()));
++ d->mMenu->addAction(d->mWhatsThisAction);
+ need_separator = true;
+ }
+Index: kdeui/widgets/ktabwidget.cpp
+===================================================================
+--- kdeui/widgets/ktabwidget.cpp (revision 858490)
++++ kdeui/widgets/ktabwidget.cpp (revision 858491)
+@@ -281,14 +281,22 @@
+
+ QString KTabWidget::tabText( int index ) const
+ {
+- if ( d->m_automaticResizeTabs ) {
+- if ( index >= 0 && index < count() )
+- return d->m_tabNames[ index ];
++ if ( d->m_automaticResizeTabs ) {
++ if (index >= 0 && index < count()) {
++ if (index >= d->m_tabNames.count()) {
++ // Ooops, the tab exists, but tabInserted wasn't called yet.
++ // This can happen when inserting the first tab,
++ // and calling tabText from slotCurrentChanged,
++ // see KTabWidget_UnitTest.
++ const_cast(this)->tabInserted(index);
++ }
++ return d->m_tabNames[ index ];
++ }
++ else
++ return QString();
++ }
+ else
+- return QString();
+- }
+- else
+- return QTabWidget::tabText( index );
++ return QTabWidget::tabText( index );
+ }
+
+ void KTabWidget::setTabText( int index, const QString &text )
+Index: kdeui/widgets/ktabwidget.h
+===================================================================
+--- kdeui/widgets/ktabwidget.h (revision 858490)
++++ kdeui/widgets/ktabwidget.h (revision 858491)
+@@ -187,7 +187,7 @@
+ * Removes the widget, reimplemented for
+ * internal reasons (keeping labels in sync).
+ */
+- virtual void removeTab(int index);
++ virtual void removeTab(int index); // but it's not virtual in QTabWidget...
+
+ /**
+ * If \a enable is true, tab reordering with middle button will be enabled.
diff --git a/kdelibs-4.1.1-kutils-fixes.patch b/kdelibs-4.1.1-kutils-fixes.patch
new file mode 100644
index 0000000..cb02a3d
--- /dev/null
+++ b/kdelibs-4.1.1-kutils-fixes.patch
@@ -0,0 +1,40 @@
+Index: kutils/kpluginselector.cpp
+===================================================================
+--- kutils/kpluginselector.cpp (revision 856658)
++++ kutils/kpluginselector.cpp (revision 856659)
+@@ -410,7 +410,8 @@
+
+ if (!pluginEntryList.contains(pluginEntry) && !listToAdd.contains(pluginEntry) &&
+ (!pluginInfo.property("X-KDE-PluginInfo-Category").isValid() ||
+- !pluginInfo.property("X-KDE-PluginInfo-Category").toString().compare(categoryKey, Qt::CaseInsensitive))) {
++ !pluginInfo.property("X-KDE-PluginInfo-Category").toString().compare(categoryKey, Qt::CaseInsensitive)) &&
++ !pluginInfo.service()->noDisplay()) {
+ listToAdd << pluginEntry;
+
+ if (!pluginSelector_d->showIcons && !pluginInfo.icon().isEmpty()) {
+Index: kutils/kpluginselector.cpp
+===================================================================
+--- kutils/kpluginselector.cpp (revision 856718)
++++ kutils/kpluginselector.cpp (revision 856719)
+@@ -411,7 +411,7 @@
+ if (!pluginEntryList.contains(pluginEntry) && !listToAdd.contains(pluginEntry) &&
+ (!pluginInfo.property("X-KDE-PluginInfo-Category").isValid() ||
+ !pluginInfo.property("X-KDE-PluginInfo-Category").toString().compare(categoryKey, Qt::CaseInsensitive)) &&
+- !pluginInfo.service()->noDisplay()) {
++ (pluginInfo.service().isNull() || !pluginInfo.service()->noDisplay())) {
+ listToAdd << pluginEntry;
+
+ if (!pluginSelector_d->showIcons && !pluginInfo.icon().isEmpty()) {
+Index: kutils/kcmoduleproxy.cpp
+===================================================================
+--- kutils/kcmoduleproxy.cpp (revision 857917)
++++ kutils/kcmoduleproxy.cpp (revision 857918)
+@@ -228,7 +228,7 @@
+ Q_Q(KCModuleProxy);
+ changed = c;
+ emit q->changed(c);
+- emit q->changed(this);
++ emit q->changed(q);
+ }
+
+ void KCModuleProxyPrivate::_k_moduleDestroyed()
diff --git a/kdelibs.spec b/kdelibs.spec
index 44f3541..ba258e2 100644
--- a/kdelibs.spec
+++ b/kdelibs.spec
@@ -2,7 +2,7 @@
Summary: K Desktop Environment 4 - Libraries
Version: 4.1.1
-Release: 5%{?dist}
+Release: 6%{?dist}
%if 0%{?fedora} > 8
Name: kdelibs
@@ -84,6 +84,8 @@ Patch19: kdelibs-4.1.0-#455130.patch
Patch100: kdelibs-4.1.1-kde#169447-khtml-regression.patch
Patch101: kdelibs-4.1.1-kde#856379-cookiejar.patch
Patch102: kdelibs-4.1.1-kde#856403-urlnav.patch
+Patch103: kdelibs-4.1.1-kutils-fixes.patch
+Patch104: kdelibs-4.1.1-kdeui-widgets-fixes.patch
BuildRequires: qt4-devel >= 4.4.0
Requires: qt4 >= %{_qt4_version}
@@ -213,6 +215,8 @@ sed -i -e "s|@@VERSION_RELEASE@@|%{version}-%{release}|" kio/kio/kprotocolmanage
%patch100 -p0 -b .kde#169447-khtml-regression
%patch101 -p0 -b .kde#856379-cookiejar
%patch102 -p0 -b .kde#856403-urlnav
+%patch103 -p0 -b .kutils-fixes
+%patch104 -p0 -b .kdeui-widgets-fixes
%build
@@ -373,6 +377,10 @@ rm -rf %{buildroot}
%changelog
+* Mon Sep 08 2008 Lukáš Tinkl 4.1.1-6
+- fix crashes in plugin selector
+- fix problems in various kdeui widgets
+
* Wed Sep 03 2008 Lukáš Tinkl 4.1.1-5
- fixed crash on setting cookies on empty domains (like the file
system), KDE bug #170147