KDE 4.3.3

This commit is contained in:
Lukas Tinkl 2009-11-09 13:48:31 +00:00
parent bbda798c67
commit 261774ceb6
8 changed files with 199 additions and 321 deletions

View File

@ -1 +1 @@
kdelibs-4.3.2.tar.bz2
kdelibs-4.3.3.tar.bz2

View File

@ -1,14 +0,0 @@
Index: khtml/khtml_part.cpp
===================================================================
--- khtml/khtml_part.cpp (revision 1033983)
+++ khtml/khtml_part.cpp (revision 1033984)
@@ -609,7 +609,8 @@
if ( d->m_view )
{
- widget()->hide();
+ if (widget())
+ widget()->hide();
d->m_view->m_part = 0;
}

View File

@ -1,31 +0,0 @@
Subject: branches/KDE/4.3/kdelibs/khtml
Date: Thursday 08 October 2009
From: David Faure <faure@kde.org>
To: kde-commits@kde.org
Cc: khtml-cvs@kde.org
SVN commit 1032787 by dfaure:
Backport fix for 207173/209876: Hide the whole widget, not just the view and
the
viewport. Otherwise the findbar stays around, receives focus, and this makes
the
partmanager activate the part that we're currently deleting...
Forgot to do this before 4.3.2, so the fix will be in 4.3.3 :(
CCBUG: 207173
M +1 -2 khtml_part.cpp
--- branches/KDE/4.3/kdelibs/khtml/khtml_part.cpp #1032786:1032787
@@ -609,8 +609,7 @@
if ( d->m_view )
{
- d->m_view->hide();
- d->m_view->viewport()->hide();
+ widget()->hide();
d->m_view->m_part = 0;
}

View File

@ -1,256 +0,0 @@
Index: kdecore/localization/klocale_p.h
===================================================================
--- kdecore/localization/klocale_p.h (Revision 0)
+++ kdecore/localization/klocale_p.h (Revision 1032185)
@@ -0,0 +1,10 @@
+#ifndef KLOCALE_P_H
+#define KLOCALE_P_H
+
+class QMutex;
+
+// Used by both KLocale and KLocalizedString, since they call each other.
+QMutex* kLocaleMutex();
+
+#endif /* KLOCALE_P_H */
+
Index: kdecore/localization/klocalizedstring.cpp
===================================================================
--- kdecore/localization/klocalizedstring.cpp (Revision 1032184)
+++ kdecore/localization/klocalizedstring.cpp (Revision 1032185)
@@ -24,6 +24,7 @@
#include <kglobal.h>
#include <kdebug.h>
#include <klocale.h>
+#include <klocale_p.h>
#include <kcomponentdata.h>
#include <klibrary.h>
#include <kstandarddirs.h>
@@ -126,8 +127,6 @@
QHash<QString, KuitSemantics*> formatters;
- QMutex mutex;
-
KLocalizedStringPrivateStatics () :
theFence("|/|"),
startInterp("$["),
@@ -144,9 +143,7 @@
translits(),
- formatters(),
-
- mutex(QMutex::Recursive)
+ formatters()
{}
~KLocalizedStringPrivateStatics ()
@@ -216,7 +213,7 @@
QString KLocalizedStringPrivate::toString (const KLocale *locale) const
{
KLocalizedStringPrivateStatics *s = staticsKLSP;
- QMutexLocker lock(&s->mutex);
+ QMutexLocker lock(kLocaleMutex());
// Assure the message has been supplied.
if (msg.isEmpty())
@@ -474,7 +471,7 @@
const QString &ctxt) const
{
KLocalizedStringPrivateStatics *s = staticsKLSP;
- QMutexLocker lock(&s->mutex);
+ QMutexLocker lock(kLocaleMutex());
QString final = text;
@@ -499,7 +496,7 @@
bool &fallback) const
{
KLocalizedStringPrivateStatics *s = staticsKLSP;
- QMutexLocker lock(&s->mutex);
+ QMutexLocker lock(kLocaleMutex());
if (s->ktrs == NULL)
// Scripting engine not available.
@@ -564,7 +561,7 @@
// fallback is set to true if Transcript evaluation requested so.
KLocalizedStringPrivateStatics *s = staticsKLSP;
- QMutexLocker lock(&s->mutex);
+ QMutexLocker lock(kLocaleMutex());
result.clear();
fallback = false;
@@ -716,7 +713,7 @@
QVariant KLocalizedStringPrivate::segmentToValue (const QString &seg) const
{
KLocalizedStringPrivateStatics *s = staticsKLSP;
- QMutexLocker lock(&s->mutex);
+ QMutexLocker lock(kLocaleMutex());
// Return invalid variant if segment is either not a proper
// value reference, or the reference is out of bounds.
@@ -751,7 +748,7 @@
const QString &final) const
{
KLocalizedStringPrivateStatics *s = staticsKLSP;
- QMutexLocker lock(&s->mutex);
+ QMutexLocker lock(kLocaleMutex());
if (s->ktrs == NULL)
// Scripting engine not available.
@@ -945,7 +942,7 @@
void KLocalizedStringPrivate::loadTranscript ()
{
KLocalizedStringPrivateStatics *s = staticsKLSP;
- QMutexLocker lock(&s->mutex);
+ QMutexLocker lock(kLocaleMutex());
s->loadTranscriptCalled = true;
s->ktrs = NULL; // null indicates that Transcript is not available
@@ -979,7 +976,8 @@
return;
}
KLocalizedStringPrivateStatics *s = staticsKLSP;
- QMutexLocker lock(&s->mutex);
+ // Very important: do not the mutex here.
+ //QMutexLocker lock(kLocaleMutex());
// Find script modules for all included language/catalogs that have them,
// and remember their paths.
Index: kdecore/localization/klocale.cpp
===================================================================
--- kdecore/localization/klocale.cpp (Revision 1032184)
+++ kdecore/localization/klocale.cpp (Revision 1032185)
@@ -22,6 +22,7 @@
*/
#include "klocale.h"
+#include "klocale_p.h"
#include <config.h>
@@ -242,7 +243,6 @@
// Handling of translation catalogs
QStringList languageList;
- QMutex* mutex;
QList<KCatalogName> catalogNames; // list of all catalogs (regardless of language)
QList<KCatalog> catalogs; // list of all found catalogs, one instance per catalog name and language
int numberOfSysCatalogs; // number of catalogs that each app draws from
@@ -276,7 +276,6 @@
KLocalePrivate::KLocalePrivate(const QString& catalog, KConfig *config, const QString &language_, const QString &country_)
: language(language_),
country(country_),
- mutex(new QMutex(QMutex::Recursive)),
useTranscript(false),
codecForEncoding(0),
languages(0), calendar(0),
@@ -311,7 +310,7 @@
void KLocalePrivate::initMainCatalogs()
{
KLocaleStaticData *s = staticData;
- QMutexLocker lock(mutex);
+ QMutexLocker lock(kLocaleMutex());
if (!s->maincatalog.isEmpty()) {
// If setMainCatalog was called, then we use that (e.g. korgac calls setMainCatalog("korganizer") to use korganizer.po)
@@ -541,7 +540,7 @@
bool KLocalePrivate::setLanguage(const QString & _language, KConfig *config)
{
- QMutexLocker lock(mutex);
+ QMutexLocker lock(kLocaleMutex());
languageList.removeAll( _language );
languageList.prepend( _language ); // let us consider this language to be the most important one
@@ -563,7 +562,7 @@
bool KLocalePrivate::setLanguage(const QStringList & languages)
{
- QMutexLocker lock(mutex);
+ QMutexLocker lock(kLocaleMutex());
// This list might contain
// 1) some empty strings that we have to eliminate
// 2) duplicate entries like in de:fr:de, where we have to keep the first occurrence of a language in order
@@ -685,7 +684,7 @@
void KLocale::insertCatalog( const QString & catalog )
{
- QMutexLocker lock(d->mutex);
+ QMutexLocker lock(kLocaleMutex());
int pos = d->catalogNames.indexOf(KCatalogName(catalog));
if (pos != -1) {
++d->catalogNames[pos].loadCount;
@@ -736,7 +735,7 @@
void KLocale::removeCatalog(const QString &catalog)
{
- QMutexLocker lock(d->mutex);
+ QMutexLocker lock(kLocaleMutex());
int pos = d->catalogNames.indexOf(KCatalogName(catalog));
if (pos == -1)
return;
@@ -749,7 +748,7 @@
void KLocale::setActiveCatalog(const QString &catalog)
{
- QMutexLocker lock(d->mutex);
+ QMutexLocker lock(kLocaleMutex());
int pos = d->catalogNames.indexOf(KCatalogName(catalog));
if (pos == -1)
return;
@@ -759,7 +758,6 @@
KLocale::~KLocale()
{
- delete d->mutex;
delete d->calendar;
delete d->languages;
delete d;
@@ -788,7 +786,7 @@
<< "Fix the program" << endl;
}
- QMutexLocker locker(mutex);
+ QMutexLocker locker(kLocaleMutex());
// determine the fallback string
QString fallback;
if ( msgid_plural == NULL )
@@ -1370,7 +1368,7 @@
//Kibi-byte KiB 2^10 1,024 bytes
if (d->byteSizeFmt.size() == 0) {
- QMutexLocker lock(d->mutex);
+ QMutexLocker lock(kLocaleMutex());
// Pretranslated format strings for byte sizes.
#define CACHEBYTEFMT(x) { \
QString s; \
@@ -2568,7 +2566,6 @@
{
d->languages = 0; // Don't copy languages
d->calendar = 0; // Don't copy the calendar
- d->mutex = 0; // Don't copy the mutex
}
KLocale & KLocale::operator=(const KLocale & rhs)
@@ -2583,8 +2580,7 @@
void KLocale::copyCatalogsTo(KLocale *locale)
{
- QMutexLocker lock(d->mutex);
- QMutexLocker lockOther(locale->d->mutex);
+ QMutexLocker lock(kLocaleMutex());
locale->d->catalogNames = d->catalogNames;
locale->d->updateCatalogs();
}
@@ -2656,3 +2652,9 @@
{
return d->dateTimeDigitSet;
}
+
+Q_GLOBAL_STATIC_WITH_ARGS(QMutex, s_kLocaleMutex, (QMutex::Recursive))
+QMutex* kLocaleMutex()
+{
+ return s_kLocaleMutex();
+}

View File

@ -0,0 +1,156 @@
Index: khtml/khtml_settings.h
===================================================================
--- khtml/khtml_settings.h (revision 1027233)
+++ khtml/khtml_settings.h (revision 1027234)
@@ -186,7 +186,23 @@
bool isPluginsEnabled( const QString& hostname = QString() ) const;
// AdBlocK Filtering
+
+ /** tests whether @p url is filtered.
+ * @param url the URL to test.
+ * @return @c true if the URL is blacklisted and is not whitelisted.
+ */
bool isAdFiltered( const QString &url ) const;
+
+ /** identify the filter which matches @p url.
+ * @param url the URL to test.
+ * @param isWhiteListed if not @c NULL, set to @c true if the URL matched
+ * a whitelist filter; set to @c false if it matched a blacklist filter.
+ * @return the filter string that matched,
+ * or @c QString() if no filter matched.
+ * @since 4.4
+ */
+ QString adFilteredBy( const QString &url, bool *isWhiteListed = 0 ) const;
+
bool isAdFilterEnabled() const;
bool isHideAdsEnabled() const;
void addAdFilter( const QString &url );
Index: khtml/khtml_filter_p.h
===================================================================
--- khtml/khtml_filter_p.h (revision 1027233)
+++ khtml/khtml_filter_p.h (revision 1027234)
@@ -35,8 +35,9 @@
// add filter to matching set
void addString(const QString& pattern);
- // check if string match at least one string from matching set
- bool isMatched(const QString& str) const;
+ // check if string matches at least one string from matching set,
+ // optionally return the matching string or filter
+ bool isMatched(const QString& str, QString *by = 0) const;
// add filter to matching set with wildcards (*,?) in it
void addWildedString(const QString& prefix, const QRegExp& rx);
@@ -60,9 +61,10 @@
// Parses and registers a filter. This will also strip @@ for exclusion rules, skip comments, etc.
// The user does have to split black and white lists into separate sets, however
void addFilter(const QString& filter);
-
+
bool isUrlMatched(const QString& url);
-
+ QString urlMatchedBy(const QString& url);
+
void clear();
private:
Index: khtml/khtml_settings.cpp
===================================================================
--- khtml/khtml_settings.cpp (revision 1027233)
+++ khtml/khtml_settings.cpp (revision 1027234)
@@ -743,6 +743,27 @@
return false;
}
+QString KHTMLSettings::adFilteredBy( const QString &url, bool *isWhiteListed ) const
+{
+ QString m = d->adWhiteList.urlMatchedBy(url);
+ if (!m.isEmpty())
+ {
+ if (isWhiteListed != 0)
+ *isWhiteListed = true;
+ return (m);
+ }
+
+ m = d->adBlackList.urlMatchedBy(url);
+ if (!m.isEmpty())
+ {
+ if (isWhiteListed != 0)
+ *isWhiteListed = false;
+ return (m);
+ }
+
+ return (QString());
+}
+
void KHTMLSettings::addAdFilter( const QString &url )
{
KConfigGroup config = KSharedConfig::openConfig( "khtmlrc", KConfig::NoGlobals )->group( "Filter Settings" );
Index: khtml/khtml_filter.cpp
===================================================================
--- khtml/khtml_filter.cpp (revision 1027233)
+++ khtml/khtml_filter.cpp (revision 1027234)
@@ -133,6 +133,25 @@
return false;
}
+QString FilterSet::urlMatchedBy(const QString& url)
+{
+ QString by;
+
+ if (stringFiltersMatcher.isMatched(url, &by))
+ return by;
+
+ for (int c = 0; c < reFilters.size(); ++c)
+ {
+ if (url.contains(reFilters[c]))
+ {
+ by = reFilters[c].pattern();
+ break;
+ }
+ }
+
+ return by;
+}
+
void FilterSet::clear()
{
reFilters.clear();
@@ -196,12 +215,15 @@
}
}
-bool StringsMatcher::isMatched(const QString& str) const
+bool StringsMatcher::isMatched(const QString& str, QString *by) const
{
// check short strings first
for (int i = 0; i < shortStringFilters.size(); ++i) {
if (str.contains(shortStringFilters[i]))
+ {
+ if (by != 0) *by = shortStringFilters[i];
return true;
+ }
}
int len = str.length();
@@ -235,13 +257,19 @@
if (index >= 0) {
int flen = stringFilters[index].length();
if (k - flen + 1 >= 0 && stringFilters[index] == str.midRef(k - flen + 1 , flen))
+ {
+ if (by != 0) *by = stringFilters[index];
return true;
+ }
} else {
index = -index - 1;
int flen = rePrefixes[index].length();
if (k - 8 + flen < len && rePrefixes[index] == str.midRef(k - 7, flen) &&
str.indexOf(reFilters[index], k - 7 + flen) == k - 7 + flen)
+ {
+ if (by != 0) *by = rePrefixes[index]+reFilters[index].pattern();
return true;
+ }
}
}
}

View File

@ -0,0 +1,21 @@
diff -ur kdelibs-4.3.3/kdecore/fakes.c kdelibs-4.3.3-fix-kdefakes-build/kdecore/fakes.c
--- kdelibs-4.3.3/kdecore/fakes.c 2008-05-21 13:09:15.000000000 +0200
+++ kdelibs-4.3.3-fix-kdefakes-build/kdecore/fakes.c 2009-11-06 01:47:27.000000000 +0100
@@ -313,6 +313,8 @@
#endif /* !HAVE_MKDTEMP */
#ifndef HAVE_STRLCPY
+#include <string.h>
+
KDECORE_EXPORT unsigned long strlcpy(char* d, const char* s, unsigned long bufsize)
{
unsigned long len, ret = strlen(s);
@@ -331,6 +333,8 @@
#endif
#ifndef HAVE_STRLCAT
+#include <string.h>
+
KDECORE_EXPORT unsigned long strlcat(char* d, const char* s, unsigned long bufsize)
{
char *cp;

View File

@ -3,8 +3,8 @@
%define strigi_ver 0.7
Summary: K Desktop Environment 4 - Libraries
Version: 4.3.2
Release: 5%{?dist}
Version: 4.3.3
Release: 2%{?dist}
Name: kdelibs
Epoch: 6
@ -76,22 +76,20 @@ Patch21: kdelibs-4.3.1-ossl-1.x.patch
# patch to fix keditbookmarks crash (kde#160679)
Patch22: kdelibs-4.3.0-bookmarks.patch
Patch24: kdelibs-4.3.1-drkonq.patch
# fix build of fakes.c due to missing #include <string.h>
Patch25: kdelibs-4.3.3-fix-kdefakes-build.patch
# upstream
# 4.3 branch
Patch100: kdelibs-4.3.2-kde#209712.patch
Patch101: kdelibs-4.3.2-kde#207173.patch
Patch102: kdelibs-4.3.2-kde#1033984.patch
# 4.4 trunk
# http://websvn.kde.org/?view=revision&revision=1027234
# add adFilteredBy API required for konq-plugins-4.3.3 to build
Patch100: kdelibs-4.3.3-adFilteredBy.patch
# security fix
Patch200: kdelibs-4.3.1-CVE-2009-2702.patch
# fix oCERT-2009-015 - unrestricted XMLHttpRequest access to local URLs
Patch201: kdelibs-4.3.3-oCERT-2009-015-xmlhttprequest.patch
BuildRequires: qt4-devel >= 4.5.0
# qt4%{_?_isa} isn't provided yet -- Rex
#Requires: qt4%{?_isa} >= %{_qt4_version}
Requires: qt4 >= %{_qt4_version}
Requires: qt4%{?_isa} >= %{_qt4_version}
Requires: xdg-utils
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@ -99,6 +97,7 @@ Requires(postun): /sbin/ldconfig
BuildRequires: alsa-lib-devel
BuildRequires: automoc4 >= 0.9.88
BuildRequires: avahi-devel
BuildRequires: bison flex
BuildRequires: bzip2-devel
BuildRequires: cmake >= 2.6.2-3
BuildRequires: cups-devel cups
@ -203,16 +202,14 @@ format for easy browsing.
%if 0%{?rhel} > 5
%patch24 -p1 -b .drkonq
%endif
%patch25 -p1 -b .fix-kdefakes-build
# upstream patches
# 4.3
%patch100 -p0 -b .kde#209712
%patch101 -p4 -b .kde#207173.patch
%patch102 -p0 -b .kde#1033984
# 4.4
%patch100 -p0 -b .adFilteredBy
# security fix
%patch200 -p1 -b .CVE-2009-2702
%patch201 -p0 -b .oCERT-2009-015-xmlhttprequest
%build
@ -402,8 +399,13 @@ rm -rf %{buildroot}
%changelog
* Mon Nov 2 2009 Lukáš Tinkl <ltinkl@redhat.com> - 4.3.2-5
- fix unrestricted XMLHttpRequest access to local URLs (oCERT-2009-015), #532428
* Fri Nov 06 2009 Kevin Kofler <Kevin@tigcc.ticalc.org> - 4.3.3-2
- backport adFilteredBy API from trunk, required to build konq-plugins-4.3.3
- BR flex and bison for the Solid predicate parser
- fix build of fakes.c due to missing #include <string.h>
* Fri Oct 30 2009 Rex Dieter <rdieter@fedoraproject.org> - 4.3.3-1
- 4.3.3
* Mon Oct 12 2009 Lukáš Tinkl <ltinkl@redhat.com> - 4.3.2-4
- khtml kpart crasher nr. 2 (rev.1033984)

View File

@ -1 +1 @@
0564ed8ba804a0f3f1cee9732a3d2d72 kdelibs-4.3.2.tar.bz2
20fd3793d9d23088ecb1d5aed0254216 kdelibs-4.3.3.tar.bz2