Sync from F-9:

* Mon Sep 08 2008 Lukáš Tinkl <ltinkl@redhat.com> 4.1.1-6
- fix crashes in plugin selector
- fix problems in various kdeui widgets
This commit is contained in:
Kevin Kofler 2008-09-12 20:32:08 +00:00
parent b8077df49f
commit 488e7455b6
3 changed files with 169 additions and 1 deletions

View File

@ -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 = "<p style=\" margin-top:0px; margin-bottom:0px; "
"margin-left:0px; margin-right:0px; -qt-block-indent:0; "
"text-indent:0px; -qt-user-state:0;\">";
-
+
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("<p.*>(.*)</p>");
+ QRegExp paragraphEnd("</p>");
+ 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 &nbsp 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(), "<br></p>");
+ }
+
+ // 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<KTabWidget*>(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.

View File

@ -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()

View File

@ -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 <ltinkl@redhat.com> 4.1.1-6
- fix crashes in plugin selector
- fix problems in various kdeui widgets
* Wed Sep 03 2008 Lukáš Tinkl <ltinkl@redhat.com> 4.1.1-5
- fixed crash on setting cookies on empty domains (like the file
system), KDE bug #170147