From 261774ceb64662d51fd0779f3454f8b49effee7e Mon Sep 17 00:00:00 2001 From: Lukas Tinkl Date: Mon, 9 Nov 2009 13:48:31 +0000 Subject: [PATCH] KDE 4.3.3 --- .cvsignore | 2 +- kdelibs-4.3.2-kde#1033984.patch | 14 -- kdelibs-4.3.2-kde#207173.patch | 31 --- kdelibs-4.3.2-kde#209712.patch | 256 ------------------------- kdelibs-4.3.3-adFilteredBy.patch | 156 +++++++++++++++ kdelibs-4.3.3-fix-kdefakes-build.patch | 21 ++ kdelibs.spec | 38 ++-- sources | 2 +- 8 files changed, 199 insertions(+), 321 deletions(-) delete mode 100644 kdelibs-4.3.2-kde#1033984.patch delete mode 100644 kdelibs-4.3.2-kde#207173.patch delete mode 100644 kdelibs-4.3.2-kde#209712.patch create mode 100644 kdelibs-4.3.3-adFilteredBy.patch create mode 100644 kdelibs-4.3.3-fix-kdefakes-build.patch diff --git a/.cvsignore b/.cvsignore index f9d0c7d..ee175d7 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -kdelibs-4.3.2.tar.bz2 +kdelibs-4.3.3.tar.bz2 diff --git a/kdelibs-4.3.2-kde#1033984.patch b/kdelibs-4.3.2-kde#1033984.patch deleted file mode 100644 index c580e2c..0000000 --- a/kdelibs-4.3.2-kde#1033984.patch +++ /dev/null @@ -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; - } - diff --git a/kdelibs-4.3.2-kde#207173.patch b/kdelibs-4.3.2-kde#207173.patch deleted file mode 100644 index 6b66f46..0000000 --- a/kdelibs-4.3.2-kde#207173.patch +++ /dev/null @@ -1,31 +0,0 @@ -Subject: branches/KDE/4.3/kdelibs/khtml -Date: Thursday 08 October 2009 -From: David Faure -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; - } - diff --git a/kdelibs-4.3.2-kde#209712.patch b/kdelibs-4.3.2-kde#209712.patch deleted file mode 100644 index 26a50c7..0000000 --- a/kdelibs-4.3.2-kde#209712.patch +++ /dev/null @@ -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 - #include - #include -+#include - #include - #include - #include -@@ -126,8 +127,6 @@ - - QHash 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 - -@@ -242,7 +243,6 @@ - // Handling of translation catalogs - QStringList languageList; - -- QMutex* mutex; - QList catalogNames; // list of all catalogs (regardless of language) - QList 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(); -+} diff --git a/kdelibs-4.3.3-adFilteredBy.patch b/kdelibs-4.3.3-adFilteredBy.patch new file mode 100644 index 0000000..a844604 --- /dev/null +++ b/kdelibs-4.3.3-adFilteredBy.patch @@ -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; ++ } + } + } + } diff --git a/kdelibs-4.3.3-fix-kdefakes-build.patch b/kdelibs-4.3.3-fix-kdefakes-build.patch new file mode 100644 index 0000000..8fe1918 --- /dev/null +++ b/kdelibs-4.3.3-fix-kdefakes-build.patch @@ -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 ++ + 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 ++ + KDECORE_EXPORT unsigned long strlcat(char* d, const char* s, unsigned long bufsize) + { + char *cp; diff --git a/kdelibs.spec b/kdelibs.spec index 53f0768..928e292 100644 --- a/kdelibs.spec +++ b/kdelibs.spec @@ -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 +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 - 4.3.2-5 -- fix unrestricted XMLHttpRequest access to local URLs (oCERT-2009-015), #532428 +* Fri Nov 06 2009 Kevin Kofler - 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 + +* Fri Oct 30 2009 Rex Dieter - 4.3.3-1 +- 4.3.3 * Mon Oct 12 2009 Lukáš Tinkl - 4.3.2-4 - khtml kpart crasher nr. 2 (rev.1033984) diff --git a/sources b/sources index c16085c..d930cc0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0564ed8ba804a0f3f1cee9732a3d2d72 kdelibs-4.3.2.tar.bz2 +20fd3793d9d23088ecb1d5aed0254216 kdelibs-4.3.3.tar.bz2