[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:54:21 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 339ddf3329d1ff7976add46339136b92048287e5
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 18 23:39:18 2002 +0000
Top level:
* coding_guidelines.txt: Updated to describe format for private
fields.
WebCore:
Avoid static initialization of objects as much as possible. Order
of static initializers is unpredictable and we had some
cross-dependencies, so avoid this practice as much as possible to
fix various startup crashes.
* src/kwq/KWQApplication.mm: (QApplication::palette),
(QApplication::globalStrut):
* src/kwq/KWQChar.mm:
* src/kwq/KWQColor.mm:
* src/kwq/KWQCursor.mm: (QCursor::QCursor), (QCursor::~QCursor):
* src/kwq/KWQEvent.mm:
* src/kwq/KWQKConfigBase.mm: (KConfigBase::readEntry),
(KConfigBase::readColorEntry), (KConfigBase::readListEntry):
* src/kwq/KWQKHTMLSettings.mm: (KHTMLSettings::encoding):
* src/kwq/KWQKJavaEmbed.mm: (KJavaEmbed::sizeHint),
(KJavaEmbed::minimumSizeHint):
* src/kwq/KWQKLocale.mm: (KLocale::language):
* src/kwq/KWQKMimeType.mm: (KMimeType::findByURL), (KMimeType::name):
* src/kwq/KWQKPrinter.mm: (KPrinter::margins):
* src/kwq/KWQKProtocolManager.mm: (KProtocolManager::httpProxy):
* src/kwq/KWQKWinModule.mm: (KWinModule::workArea):
* src/kwq/KWQKjobclasses.mm:
* src/kwq/KWQKnetaccess.mm:
* src/kwq/KWQPart.mm: (KParts::Part::widget), (KParts::ReadOnlyPart::url):
* src/kwq/KWQPixmap.mm: (QPixmap::mask):
* src/kwq/KWQToolTip.mm: (QToolTip::palette):
* src/kwq/kde/_kurl.cpp:
* src/kwq/kdecore/kurl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index f89b751..f6d09af 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,34 @@
+2002-01-18 Maciej Stachowiak <mjs at apple.com>
+
+ Avoid static initialization of objects as much as possible. Order
+ of static initializers is unpredictable and we had some
+ cross-dependencies, so avoid this practice as much as possible to
+ fix various startup crashes.
+
+ * src/kwq/KWQApplication.mm: (QApplication::palette),
+ (QApplication::globalStrut):
+ * src/kwq/KWQChar.mm:
+ * src/kwq/KWQColor.mm:
+ * src/kwq/KWQCursor.mm: (QCursor::QCursor), (QCursor::~QCursor):
+ * src/kwq/KWQEvent.mm:
+ * src/kwq/KWQKConfigBase.mm: (KConfigBase::readEntry),
+ (KConfigBase::readColorEntry), (KConfigBase::readListEntry):
+ * src/kwq/KWQKHTMLSettings.mm: (KHTMLSettings::encoding):
+ * src/kwq/KWQKJavaEmbed.mm: (KJavaEmbed::sizeHint),
+ (KJavaEmbed::minimumSizeHint):
+ * src/kwq/KWQKLocale.mm: (KLocale::language):
+ * src/kwq/KWQKMimeType.mm: (KMimeType::findByURL), (KMimeType::name):
+ * src/kwq/KWQKPrinter.mm: (KPrinter::margins):
+ * src/kwq/KWQKProtocolManager.mm: (KProtocolManager::httpProxy):
+ * src/kwq/KWQKWinModule.mm: (KWinModule::workArea):
+ * src/kwq/KWQKjobclasses.mm:
+ * src/kwq/KWQKnetaccess.mm:
+ * src/kwq/KWQPart.mm: (KParts::Part::widget), (KParts::ReadOnlyPart::url):
+ * src/kwq/KWQPixmap.mm: (QPixmap::mask):
+ * src/kwq/KWQToolTip.mm: (QToolTip::palette):
+ * src/kwq/kde/_kurl.cpp:
+ * src/kwq/kdecore/kurl.h:
+
2002-01-17 Maciej Stachowiak <mjs at apple.com>
Fix a couple of problems that kept `make -j3' from working from a
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index f89b751..f6d09af 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,34 @@
+2002-01-18 Maciej Stachowiak <mjs at apple.com>
+
+ Avoid static initialization of objects as much as possible. Order
+ of static initializers is unpredictable and we had some
+ cross-dependencies, so avoid this practice as much as possible to
+ fix various startup crashes.
+
+ * src/kwq/KWQApplication.mm: (QApplication::palette),
+ (QApplication::globalStrut):
+ * src/kwq/KWQChar.mm:
+ * src/kwq/KWQColor.mm:
+ * src/kwq/KWQCursor.mm: (QCursor::QCursor), (QCursor::~QCursor):
+ * src/kwq/KWQEvent.mm:
+ * src/kwq/KWQKConfigBase.mm: (KConfigBase::readEntry),
+ (KConfigBase::readColorEntry), (KConfigBase::readListEntry):
+ * src/kwq/KWQKHTMLSettings.mm: (KHTMLSettings::encoding):
+ * src/kwq/KWQKJavaEmbed.mm: (KJavaEmbed::sizeHint),
+ (KJavaEmbed::minimumSizeHint):
+ * src/kwq/KWQKLocale.mm: (KLocale::language):
+ * src/kwq/KWQKMimeType.mm: (KMimeType::findByURL), (KMimeType::name):
+ * src/kwq/KWQKPrinter.mm: (KPrinter::margins):
+ * src/kwq/KWQKProtocolManager.mm: (KProtocolManager::httpProxy):
+ * src/kwq/KWQKWinModule.mm: (KWinModule::workArea):
+ * src/kwq/KWQKjobclasses.mm:
+ * src/kwq/KWQKnetaccess.mm:
+ * src/kwq/KWQPart.mm: (KParts::Part::widget), (KParts::ReadOnlyPart::url):
+ * src/kwq/KWQPixmap.mm: (QPixmap::mask):
+ * src/kwq/KWQToolTip.mm: (QToolTip::palette):
+ * src/kwq/kde/_kurl.cpp:
+ * src/kwq/kdecore/kurl.h:
+
2002-01-17 Maciej Stachowiak <mjs at apple.com>
Fix a couple of problems that kept `make -j3' from working from a
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index f89b751..f6d09af 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,34 @@
+2002-01-18 Maciej Stachowiak <mjs at apple.com>
+
+ Avoid static initialization of objects as much as possible. Order
+ of static initializers is unpredictable and we had some
+ cross-dependencies, so avoid this practice as much as possible to
+ fix various startup crashes.
+
+ * src/kwq/KWQApplication.mm: (QApplication::palette),
+ (QApplication::globalStrut):
+ * src/kwq/KWQChar.mm:
+ * src/kwq/KWQColor.mm:
+ * src/kwq/KWQCursor.mm: (QCursor::QCursor), (QCursor::~QCursor):
+ * src/kwq/KWQEvent.mm:
+ * src/kwq/KWQKConfigBase.mm: (KConfigBase::readEntry),
+ (KConfigBase::readColorEntry), (KConfigBase::readListEntry):
+ * src/kwq/KWQKHTMLSettings.mm: (KHTMLSettings::encoding):
+ * src/kwq/KWQKJavaEmbed.mm: (KJavaEmbed::sizeHint),
+ (KJavaEmbed::minimumSizeHint):
+ * src/kwq/KWQKLocale.mm: (KLocale::language):
+ * src/kwq/KWQKMimeType.mm: (KMimeType::findByURL), (KMimeType::name):
+ * src/kwq/KWQKPrinter.mm: (KPrinter::margins):
+ * src/kwq/KWQKProtocolManager.mm: (KProtocolManager::httpProxy):
+ * src/kwq/KWQKWinModule.mm: (KWinModule::workArea):
+ * src/kwq/KWQKjobclasses.mm:
+ * src/kwq/KWQKnetaccess.mm:
+ * src/kwq/KWQPart.mm: (KParts::Part::widget), (KParts::ReadOnlyPart::url):
+ * src/kwq/KWQPixmap.mm: (QPixmap::mask):
+ * src/kwq/KWQToolTip.mm: (QToolTip::palette):
+ * src/kwq/kde/_kurl.cpp:
+ * src/kwq/kdecore/kurl.h:
+
2002-01-17 Maciej Stachowiak <mjs at apple.com>
Fix a couple of problems that kept `make -j3' from working from a
diff --git a/WebCore/kwq/KWQApplication.mm b/WebCore/kwq/KWQApplication.mm
index 83ee325..fa40d6e 100644
--- a/WebCore/kwq/KWQApplication.mm
+++ b/WebCore/kwq/KWQApplication.mm
@@ -30,12 +30,16 @@
#import "_KWQOwner.h"
// FIXME:
-static QPalette DEFAULT_PALETTE = QPalette();
-static QSize DEFAULT_SIZE = QSize(0,0);
+static QPalette *DEFAULT_PALETTE = NULL;
+static QSize *DEFAULT_SIZE = NULL;
QPalette QApplication::palette(const QWidget *p)
{
- return DEFAULT_PALETTE;
+ if (DEFAULT_PALETTE == NULL) {
+ DEFAULT_PALETTE = new QPalette();
+ }
+
+ return *DEFAULT_PALETTE;
}
@@ -58,7 +62,12 @@ int QApplication::startDragDistance()
QSize QApplication::globalStrut()
{
_logNotYetImplemented();
- return DEFAULT_SIZE;
+
+ if (DEFAULT_SIZE == NULL) {
+ DEFAULT_SIZE = new QSize(0,0);
+ }
+
+ return *DEFAULT_SIZE;
}
diff --git a/WebCore/kwq/KWQChar.mm b/WebCore/kwq/KWQChar.mm
index 1ca6471..b4722b8 100644
--- a/WebCore/kwq/KWQChar.mm
+++ b/WebCore/kwq/KWQChar.mm
@@ -33,6 +33,7 @@
static UniChar scratchUniChar;
+/* FIXME: use of this function is clearly not threadsafe! */
static CFMutableStringRef GetScratchUniCharString()
{
static CFMutableStringRef s = NULL;
diff --git a/WebCore/kwq/KWQColor.mm b/WebCore/kwq/KWQColor.mm
index 4ebb909..52c53aa 100644
--- a/WebCore/kwq/KWQColor.mm
+++ b/WebCore/kwq/KWQColor.mm
@@ -28,7 +28,7 @@
#include <kwqdebug.h>
-static NSDictionary *namedColors;
+static NSDictionary *namedColors = NULL;
#define ROUND_TO_INT(f) ((int)rint((f)))
diff --git a/WebCore/kwq/KWQCursor.mm b/WebCore/kwq/KWQCursor.mm
index 9948928..34a33ad 100644
--- a/WebCore/kwq/KWQCursor.mm
+++ b/WebCore/kwq/KWQCursor.mm
@@ -32,7 +32,7 @@ const QCursor & Qt::splitVCursor = QCursor();
QCursor::QCursor()
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY)
@@ -47,7 +47,7 @@ QCursor::QCursor(const QCursor &)
QCursor::~QCursor()
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
QPoint QCursor::pos()
diff --git a/WebCore/kwq/KWQEvent.mm b/WebCore/kwq/KWQEvent.mm
index ed4612b..3a7933e 100644
--- a/WebCore/kwq/KWQEvent.mm
+++ b/WebCore/kwq/KWQEvent.mm
@@ -26,9 +26,6 @@
#include <kwqdebug.h>
#include <qevent.h>
-// FIXME: replace this hack
-static const QPoint ORIGIN(0,0);
-
// class QEvent ================================================================
diff --git a/WebCore/kwq/KWQKConfigBase.mm b/WebCore/kwq/KWQKConfigBase.mm
index eb41897..50f4b2d 100644
--- a/WebCore/kwq/KWQKConfigBase.mm
+++ b/WebCore/kwq/KWQKConfigBase.mm
@@ -27,9 +27,10 @@
#include <kconfig.h>
//FIX ME:
-static QString tempQString = QString();
-static QColor tempQColor = QColor(0,0,0);
-static QStringList tempQStringList = QStringList();
+static QString *tempQString = NULL;
+static QColor *tempQColor = NULL;
+static QStringList *tempQStringList = NULL;
+
KConfigBase::KConfigBase()
{
@@ -62,7 +63,10 @@ QString KConfigBase::readEntry(const char *pKey,
const QString& aDefault=QString::null) const
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString();
+ }
+ return *tempQString;
}
@@ -93,14 +97,20 @@ bool KConfigBase::readBoolEntry(const char *pKey, bool nDefault=0) const
QColor KConfigBase::readColorEntry(const char *pKey, const QColor *pDefault=0L) const
{
_logNotYetImplemented();
- return tempQColor;
+ if (tempQColor == NULL) {
+ tempQColor = new QColor(0,0,0);
+ }
+ return *tempQColor;
}
QStringList KConfigBase::readListEntry(const QString &pKey, char sep=',') const
{
_logNotYetImplemented();
- return tempQStringList;
+ if (tempQStringList == NULL) {
+ tempQStringList = new QStringList();
+ }
+ return *tempQStringList;
}
diff --git a/WebCore/kwq/KWQKHTMLSettings.mm b/WebCore/kwq/KWQKHTMLSettings.mm
index 0006b7d..2f8f58a 100644
--- a/WebCore/kwq/KWQKHTMLSettings.mm
+++ b/WebCore/kwq/KWQKHTMLSettings.mm
@@ -26,7 +26,7 @@
#include <khtml_settings.h>
// FIXME: remove this hack
-static const QString DEFAULT_ENCODING = NSSTRING_TO_QSTRING(@"NSISOLatin1StringEncoding");
+static const QString *DEFAULT_ENCODING = NULL;
KHTMLSettings::KHTMLSettings()
{
@@ -106,7 +106,10 @@ const QString &KHTMLSettings::encoding() const
{
_logNotYetImplemented();
// FIXME: remove this hack
- return DEFAULT_ENCODING;
+ if (DEFAULT_ENCODING == NULL) {
+ DEFAULT_ENCODING = new QString(NSSTRING_TO_QSTRING(@"NSISOLatin1StringEncoding"));
+ }
+ return *DEFAULT_ENCODING;
}
diff --git a/WebCore/kwq/KWQKIONetAccess.mm b/WebCore/kwq/KWQKIONetAccess.mm
index dae2840..61433ce 100644
--- a/WebCore/kwq/KWQKIONetAccess.mm
+++ b/WebCore/kwq/KWQKIONetAccess.mm
@@ -27,7 +27,7 @@
#include <netaccess.h>
//FIX ME:
-static QString tempQString = QString();
+static QString *tempQString;
namespace KIO {
@@ -41,7 +41,11 @@ bool NetAccess::stat(const KURL &, KIO::UDSEntry &)
QString NetAccess::lastErrorString()
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString();
+ }
+
+ return *tempQString;
}
diff --git a/WebCore/kwq/KWQKJavaEmbed.mm b/WebCore/kwq/KWQKJavaEmbed.mm
index d2febbd..4a79b2e 100644
--- a/WebCore/kwq/KWQKJavaEmbed.mm
+++ b/WebCore/kwq/KWQKJavaEmbed.mm
@@ -28,7 +28,7 @@ to work better with java applets.
#include <javaembed.h>
//FIX ME:
-static QSize tempQSize = QSize(0,0);
+static QSize *tempQSize = NULL;
KJavaEmbed::KJavaEmbed( QWidget *parent=0, const char *name=0, WFlags f = 0 )
{
@@ -51,14 +51,20 @@ void KJavaEmbed::embed( WId w )
QSize KJavaEmbed::sizeHint() const
{
_logNotYetImplemented();
- return tempQSize;
+ if (tempQSize == NULL) {
+ tempQSize = new QSize(0,0);
+ }
+ return *tempQSize;
}
QSize KJavaEmbed::minimumSizeHint() const
{
_logNotYetImplemented();
- return tempQSize;
+ if (tempQSize == NULL) {
+ tempQSize = new QSize(0,0);
+ }
+ return *tempQSize;
}
diff --git a/WebCore/kwq/KWQKJobClasses.mm b/WebCore/kwq/KWQKJobClasses.mm
index 722027f..df23749 100644
--- a/WebCore/kwq/KWQKJobClasses.mm
+++ b/WebCore/kwq/KWQKJobClasses.mm
@@ -31,7 +31,7 @@
#include <Foundation/Foundation.h>
#include <WCURICache.h>
-static const QString DEFAULT_ERROR_TEXT = "DEFAULT_ERROR_TEXT";
+static const QString *DEFAULT_ERROR_TEXT = NULL;
namespace KIO {
@@ -52,7 +52,11 @@ int Job::error()
const QString &Job::errorText()
{
_logNotYetImplemented();
- return DEFAULT_ERROR_TEXT;
+ if (DEFAULT_ERROR_TEXT == NULL) {
+ DEFAULT_ERROR_TEXT = new QString("DEFAULT_ERROR_TEXT");
+ }
+
+ return *DEFAULT_ERROR_TEXT;
}
diff --git a/WebCore/kwq/KWQKLocale.mm b/WebCore/kwq/KWQKLocale.mm
index fa40785..e04960b 100644
--- a/WebCore/kwq/KWQKLocale.mm
+++ b/WebCore/kwq/KWQKLocale.mm
@@ -27,7 +27,7 @@
#include <klocale.h>
//FIX ME:
-static QString tempQString = QString("en_US");
+static QString *tempQString = NULL;
QString i18n(const char* text)
{
@@ -40,6 +40,9 @@ QString i18n(const char* text)
QString KLocale::language() const
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString("en_US");
+ }
+ return *tempQString;
}
diff --git a/WebCore/kwq/KWQKMimeType.mm b/WebCore/kwq/KWQKMimeType.mm
index b79558e..af8c479 100644
--- a/WebCore/kwq/KWQKMimeType.mm
+++ b/WebCore/kwq/KWQKMimeType.mm
@@ -27,13 +27,16 @@
#include <kmimetype.h>
//FIX ME:
-static QString tempQString = QString();
-static KMimeType::Ptr tempPtr = KMimeType::Ptr();
+static QString *tempQString = NULL;
+static KMimeType::Ptr *tempPtr = NULL;
KMimeType::Ptr KMimeType::findByURL(const KURL &, mode_t=0, bool=false, bool)
{
_logNotYetImplemented();
- return tempPtr;
+ if (tempPtr == NULL) {
+ tempPtr = new KMimeType::Ptr();
+ }
+ return *tempPtr;
}
@@ -46,5 +49,8 @@ KMimeType::~KMimeType()
QString KMimeType::name() const
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString();
+ }
+ return *tempQString;
}
diff --git a/WebCore/kwq/KWQKPrinter.mm b/WebCore/kwq/KWQKPrinter.mm
index b7d78fd..af72d95 100644
--- a/WebCore/kwq/KWQKPrinter.mm
+++ b/WebCore/kwq/KWQKPrinter.mm
@@ -27,7 +27,7 @@
#include <kprinter.h>
//FIX ME:
-static QSize tempQSize = QSize(0,0);
+static QSize *tempQSize = NULL;
bool KPrinter::setup(QWidget *parent=0)
{
@@ -64,7 +64,11 @@ void KPrinter::setFullPage(bool)
QSize KPrinter::margins() const
{
_logNeverImplemented();
- return tempQSize;
+ if (tempQSize == NULL) {
+ tempQSize = new QSize(0,0);
+ }
+
+ return *tempQSize;
}
diff --git a/WebCore/kwq/KWQKProtocolManager.mm b/WebCore/kwq/KWQKProtocolManager.mm
index fa5efeb..da12bf4 100644
--- a/WebCore/kwq/KWQKProtocolManager.mm
+++ b/WebCore/kwq/KWQKProtocolManager.mm
@@ -30,7 +30,7 @@
#include <kprotocolmanager.h>
//FIX ME:
-static QString tempQString = QString();
+static QString *tempQString = NULL;
bool KProtocolManager::useProxy()
{
@@ -41,7 +41,11 @@ bool KProtocolManager::useProxy()
QString KProtocolManager::httpProxy()
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString();
+ }
+
+ return *tempQString;
}
QString KProtocolManager::userAgentForHost( const QString& )
diff --git a/WebCore/kwq/KWQKURL.h b/WebCore/kwq/KWQKURL.h
index c527726..823da9e 100644
--- a/WebCore/kwq/KWQKURL.h
+++ b/WebCore/kwq/KWQKURL.h
@@ -33,6 +33,7 @@
// USING_BORROWED_KURL =========================================================
#ifdef USING_BORROWED_KURL
+
#include <_kurl.h>
#else
@@ -122,4 +123,4 @@ private:
#endif
-#endif // USING_BORROWED_KURL
\ No newline at end of file
+#endif // USING_BORROWED_KURL
diff --git a/WebCore/kwq/KWQKWinModule.mm b/WebCore/kwq/KWQKWinModule.mm
index 968edd2..3e69649 100644
--- a/WebCore/kwq/KWQKWinModule.mm
+++ b/WebCore/kwq/KWQKWinModule.mm
@@ -27,7 +27,7 @@
#include <kwinmodule.h>
//FIX ME:
-static QRect tempQRect = QRect(0,0,0,0);
+static QRect *tempQRect = NULL;
KWinModule::KWinModule(QObject* parent=0)
{
@@ -44,7 +44,12 @@ KWinModule::~KWinModule()
QRect KWinModule::workArea(int desktop=-1) const
{
_logNotYetImplemented();
- return tempQRect;
+
+ if (tempQRect == NULL) {
+ tempQRect = new QRect(0,0,0,0);
+ }
+
+ return *tempQRect;
}
diff --git a/WebCore/kwq/KWQKnetaccess.mm b/WebCore/kwq/KWQKnetaccess.mm
index dae2840..61433ce 100644
--- a/WebCore/kwq/KWQKnetaccess.mm
+++ b/WebCore/kwq/KWQKnetaccess.mm
@@ -27,7 +27,7 @@
#include <netaccess.h>
//FIX ME:
-static QString tempQString = QString();
+static QString *tempQString;
namespace KIO {
@@ -41,7 +41,11 @@ bool NetAccess::stat(const KURL &, KIO::UDSEntry &)
QString NetAccess::lastErrorString()
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString();
+ }
+
+ return *tempQString;
}
diff --git a/WebCore/kwq/KWQPart.mm b/WebCore/kwq/KWQPart.mm
index 56299b4..b56e03c 100644
--- a/WebCore/kwq/KWQPart.mm
+++ b/WebCore/kwq/KWQPart.mm
@@ -42,10 +42,15 @@ KParts::Part::~Part()
}
-static QWidget *theWidget = new QWidget();
+static QWidget *theWidget = NULL;
QWidget *KParts::Part::widget()
{
_logNotYetImplemented();
+
+ if (theWidget == NULL) {
+ theWidget = new QWidget();
+ }
+
return theWidget;
}
@@ -70,10 +75,15 @@ KParts::ReadOnlyPart::~ReadOnlyPart()
}
-static const KURL emptyURL = KURL();
+static KURL *emptyURL = NULL;
const KURL &KParts::ReadOnlyPart::url() const
{
// must override
_logNeverImplemented();
- return emptyURL;
+
+ if (emptyURL == NULL) {
+ emptyURL = new KURL();
+ }
+
+ return *emptyURL;
}
diff --git a/WebCore/kwq/KWQPixmap.mm b/WebCore/kwq/KWQPixmap.mm
index 17f8b04..8d66700 100644
--- a/WebCore/kwq/KWQPixmap.mm
+++ b/WebCore/kwq/KWQPixmap.mm
@@ -109,10 +109,15 @@ void QPixmap::setMask(const QBitmap &)
_logNotYetImplemented();
}
-static QBitmap *theMask = new QBitmap();
+static QBitmap *theMask = NULL;
const QBitmap *QPixmap::mask() const
{
_logNotYetImplemented();
+
+ if (theMask == NULL) {
+ theMask = new QBitmap();
+ }
+
return theMask;
}
diff --git a/WebCore/kwq/KWQToolTip.mm b/WebCore/kwq/KWQToolTip.mm
index 17b06c9..ed8b2c7 100644
--- a/WebCore/kwq/KWQToolTip.mm
+++ b/WebCore/kwq/KWQToolTip.mm
@@ -27,12 +27,16 @@
#include <qtooltip.h>
// FIXME:
-static QPalette DEFAULT_PALETTE = QPalette();
+static QPalette *DEFAULT_PALETTE = NULL;
QPalette QToolTip::palette()
{
_logNotYetImplemented();
- return DEFAULT_PALETTE;
+ if (DEFAULT_PALETTE == NULL) {
+ DEFAULT_PALETTE = new QPalette();
+ }
+
+ return *DEFAULT_PALETTE;
}
diff --git a/WebCore/kwq/kde/_kurl.cpp b/WebCore/kwq/kde/_kurl.cpp
index 1f95203..d0181e1 100644
--- a/WebCore/kwq/kde/_kurl.cpp
+++ b/WebCore/kwq/kde/_kurl.cpp
@@ -33,6 +33,8 @@
#include <qtextcodec.h>
#include <kcharsets.h>
+#if USING_BORROWED_KURL
+
static QTextCodec * codecForHint( int encoding_hint /* not 0 ! */ )
{
/*
@@ -1545,3 +1547,4 @@ bool urlcmp( const QString& _url1, const QString& _url2, bool _ignore_trailing,
return true;
}
+#endif
diff --git a/WebCore/kwq/kdecore/kurl.h b/WebCore/kwq/kdecore/kurl.h
index c527726..823da9e 100644
--- a/WebCore/kwq/kdecore/kurl.h
+++ b/WebCore/kwq/kdecore/kurl.h
@@ -33,6 +33,7 @@
// USING_BORROWED_KURL =========================================================
#ifdef USING_BORROWED_KURL
+
#include <_kurl.h>
#else
@@ -122,4 +123,4 @@ private:
#endif
-#endif // USING_BORROWED_KURL
\ No newline at end of file
+#endif // USING_BORROWED_KURL
diff --git a/WebCore/src/kwq/KWQApplication.mm b/WebCore/src/kwq/KWQApplication.mm
index 83ee325..fa40d6e 100644
--- a/WebCore/src/kwq/KWQApplication.mm
+++ b/WebCore/src/kwq/KWQApplication.mm
@@ -30,12 +30,16 @@
#import "_KWQOwner.h"
// FIXME:
-static QPalette DEFAULT_PALETTE = QPalette();
-static QSize DEFAULT_SIZE = QSize(0,0);
+static QPalette *DEFAULT_PALETTE = NULL;
+static QSize *DEFAULT_SIZE = NULL;
QPalette QApplication::palette(const QWidget *p)
{
- return DEFAULT_PALETTE;
+ if (DEFAULT_PALETTE == NULL) {
+ DEFAULT_PALETTE = new QPalette();
+ }
+
+ return *DEFAULT_PALETTE;
}
@@ -58,7 +62,12 @@ int QApplication::startDragDistance()
QSize QApplication::globalStrut()
{
_logNotYetImplemented();
- return DEFAULT_SIZE;
+
+ if (DEFAULT_SIZE == NULL) {
+ DEFAULT_SIZE = new QSize(0,0);
+ }
+
+ return *DEFAULT_SIZE;
}
diff --git a/WebCore/src/kwq/KWQChar.mm b/WebCore/src/kwq/KWQChar.mm
index 1ca6471..b4722b8 100644
--- a/WebCore/src/kwq/KWQChar.mm
+++ b/WebCore/src/kwq/KWQChar.mm
@@ -33,6 +33,7 @@
static UniChar scratchUniChar;
+/* FIXME: use of this function is clearly not threadsafe! */
static CFMutableStringRef GetScratchUniCharString()
{
static CFMutableStringRef s = NULL;
diff --git a/WebCore/src/kwq/KWQColor.mm b/WebCore/src/kwq/KWQColor.mm
index 4ebb909..52c53aa 100644
--- a/WebCore/src/kwq/KWQColor.mm
+++ b/WebCore/src/kwq/KWQColor.mm
@@ -28,7 +28,7 @@
#include <kwqdebug.h>
-static NSDictionary *namedColors;
+static NSDictionary *namedColors = NULL;
#define ROUND_TO_INT(f) ((int)rint((f)))
diff --git a/WebCore/src/kwq/KWQCursor.mm b/WebCore/src/kwq/KWQCursor.mm
index 9948928..34a33ad 100644
--- a/WebCore/src/kwq/KWQCursor.mm
+++ b/WebCore/src/kwq/KWQCursor.mm
@@ -32,7 +32,7 @@ const QCursor & Qt::splitVCursor = QCursor();
QCursor::QCursor()
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY)
@@ -47,7 +47,7 @@ QCursor::QCursor(const QCursor &)
QCursor::~QCursor()
{
- _logNotYetImplemented();
+ //_logNotYetImplemented();
}
QPoint QCursor::pos()
diff --git a/WebCore/src/kwq/KWQEvent.mm b/WebCore/src/kwq/KWQEvent.mm
index ed4612b..3a7933e 100644
--- a/WebCore/src/kwq/KWQEvent.mm
+++ b/WebCore/src/kwq/KWQEvent.mm
@@ -26,9 +26,6 @@
#include <kwqdebug.h>
#include <qevent.h>
-// FIXME: replace this hack
-static const QPoint ORIGIN(0,0);
-
// class QEvent ================================================================
diff --git a/WebCore/src/kwq/KWQKConfigBase.mm b/WebCore/src/kwq/KWQKConfigBase.mm
index eb41897..50f4b2d 100644
--- a/WebCore/src/kwq/KWQKConfigBase.mm
+++ b/WebCore/src/kwq/KWQKConfigBase.mm
@@ -27,9 +27,10 @@
#include <kconfig.h>
//FIX ME:
-static QString tempQString = QString();
-static QColor tempQColor = QColor(0,0,0);
-static QStringList tempQStringList = QStringList();
+static QString *tempQString = NULL;
+static QColor *tempQColor = NULL;
+static QStringList *tempQStringList = NULL;
+
KConfigBase::KConfigBase()
{
@@ -62,7 +63,10 @@ QString KConfigBase::readEntry(const char *pKey,
const QString& aDefault=QString::null) const
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString();
+ }
+ return *tempQString;
}
@@ -93,14 +97,20 @@ bool KConfigBase::readBoolEntry(const char *pKey, bool nDefault=0) const
QColor KConfigBase::readColorEntry(const char *pKey, const QColor *pDefault=0L) const
{
_logNotYetImplemented();
- return tempQColor;
+ if (tempQColor == NULL) {
+ tempQColor = new QColor(0,0,0);
+ }
+ return *tempQColor;
}
QStringList KConfigBase::readListEntry(const QString &pKey, char sep=',') const
{
_logNotYetImplemented();
- return tempQStringList;
+ if (tempQStringList == NULL) {
+ tempQStringList = new QStringList();
+ }
+ return *tempQStringList;
}
diff --git a/WebCore/src/kwq/KWQKHTMLSettings.mm b/WebCore/src/kwq/KWQKHTMLSettings.mm
index 0006b7d..2f8f58a 100644
--- a/WebCore/src/kwq/KWQKHTMLSettings.mm
+++ b/WebCore/src/kwq/KWQKHTMLSettings.mm
@@ -26,7 +26,7 @@
#include <khtml_settings.h>
// FIXME: remove this hack
-static const QString DEFAULT_ENCODING = NSSTRING_TO_QSTRING(@"NSISOLatin1StringEncoding");
+static const QString *DEFAULT_ENCODING = NULL;
KHTMLSettings::KHTMLSettings()
{
@@ -106,7 +106,10 @@ const QString &KHTMLSettings::encoding() const
{
_logNotYetImplemented();
// FIXME: remove this hack
- return DEFAULT_ENCODING;
+ if (DEFAULT_ENCODING == NULL) {
+ DEFAULT_ENCODING = new QString(NSSTRING_TO_QSTRING(@"NSISOLatin1StringEncoding"));
+ }
+ return *DEFAULT_ENCODING;
}
diff --git a/WebCore/src/kwq/KWQKJavaEmbed.mm b/WebCore/src/kwq/KWQKJavaEmbed.mm
index d2febbd..4a79b2e 100644
--- a/WebCore/src/kwq/KWQKJavaEmbed.mm
+++ b/WebCore/src/kwq/KWQKJavaEmbed.mm
@@ -28,7 +28,7 @@ to work better with java applets.
#include <javaembed.h>
//FIX ME:
-static QSize tempQSize = QSize(0,0);
+static QSize *tempQSize = NULL;
KJavaEmbed::KJavaEmbed( QWidget *parent=0, const char *name=0, WFlags f = 0 )
{
@@ -51,14 +51,20 @@ void KJavaEmbed::embed( WId w )
QSize KJavaEmbed::sizeHint() const
{
_logNotYetImplemented();
- return tempQSize;
+ if (tempQSize == NULL) {
+ tempQSize = new QSize(0,0);
+ }
+ return *tempQSize;
}
QSize KJavaEmbed::minimumSizeHint() const
{
_logNotYetImplemented();
- return tempQSize;
+ if (tempQSize == NULL) {
+ tempQSize = new QSize(0,0);
+ }
+ return *tempQSize;
}
diff --git a/WebCore/src/kwq/KWQKLocale.mm b/WebCore/src/kwq/KWQKLocale.mm
index fa40785..e04960b 100644
--- a/WebCore/src/kwq/KWQKLocale.mm
+++ b/WebCore/src/kwq/KWQKLocale.mm
@@ -27,7 +27,7 @@
#include <klocale.h>
//FIX ME:
-static QString tempQString = QString("en_US");
+static QString *tempQString = NULL;
QString i18n(const char* text)
{
@@ -40,6 +40,9 @@ QString i18n(const char* text)
QString KLocale::language() const
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString("en_US");
+ }
+ return *tempQString;
}
diff --git a/WebCore/src/kwq/KWQKMimeType.mm b/WebCore/src/kwq/KWQKMimeType.mm
index b79558e..af8c479 100644
--- a/WebCore/src/kwq/KWQKMimeType.mm
+++ b/WebCore/src/kwq/KWQKMimeType.mm
@@ -27,13 +27,16 @@
#include <kmimetype.h>
//FIX ME:
-static QString tempQString = QString();
-static KMimeType::Ptr tempPtr = KMimeType::Ptr();
+static QString *tempQString = NULL;
+static KMimeType::Ptr *tempPtr = NULL;
KMimeType::Ptr KMimeType::findByURL(const KURL &, mode_t=0, bool=false, bool)
{
_logNotYetImplemented();
- return tempPtr;
+ if (tempPtr == NULL) {
+ tempPtr = new KMimeType::Ptr();
+ }
+ return *tempPtr;
}
@@ -46,5 +49,8 @@ KMimeType::~KMimeType()
QString KMimeType::name() const
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString();
+ }
+ return *tempQString;
}
diff --git a/WebCore/src/kwq/KWQKPrinter.mm b/WebCore/src/kwq/KWQKPrinter.mm
index b7d78fd..af72d95 100644
--- a/WebCore/src/kwq/KWQKPrinter.mm
+++ b/WebCore/src/kwq/KWQKPrinter.mm
@@ -27,7 +27,7 @@
#include <kprinter.h>
//FIX ME:
-static QSize tempQSize = QSize(0,0);
+static QSize *tempQSize = NULL;
bool KPrinter::setup(QWidget *parent=0)
{
@@ -64,7 +64,11 @@ void KPrinter::setFullPage(bool)
QSize KPrinter::margins() const
{
_logNeverImplemented();
- return tempQSize;
+ if (tempQSize == NULL) {
+ tempQSize = new QSize(0,0);
+ }
+
+ return *tempQSize;
}
diff --git a/WebCore/src/kwq/KWQKProtocolManager.mm b/WebCore/src/kwq/KWQKProtocolManager.mm
index fa5efeb..da12bf4 100644
--- a/WebCore/src/kwq/KWQKProtocolManager.mm
+++ b/WebCore/src/kwq/KWQKProtocolManager.mm
@@ -30,7 +30,7 @@
#include <kprotocolmanager.h>
//FIX ME:
-static QString tempQString = QString();
+static QString *tempQString = NULL;
bool KProtocolManager::useProxy()
{
@@ -41,7 +41,11 @@ bool KProtocolManager::useProxy()
QString KProtocolManager::httpProxy()
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString();
+ }
+
+ return *tempQString;
}
QString KProtocolManager::userAgentForHost( const QString& )
diff --git a/WebCore/src/kwq/KWQKWinModule.mm b/WebCore/src/kwq/KWQKWinModule.mm
index 968edd2..3e69649 100644
--- a/WebCore/src/kwq/KWQKWinModule.mm
+++ b/WebCore/src/kwq/KWQKWinModule.mm
@@ -27,7 +27,7 @@
#include <kwinmodule.h>
//FIX ME:
-static QRect tempQRect = QRect(0,0,0,0);
+static QRect *tempQRect = NULL;
KWinModule::KWinModule(QObject* parent=0)
{
@@ -44,7 +44,12 @@ KWinModule::~KWinModule()
QRect KWinModule::workArea(int desktop=-1) const
{
_logNotYetImplemented();
- return tempQRect;
+
+ if (tempQRect == NULL) {
+ tempQRect = new QRect(0,0,0,0);
+ }
+
+ return *tempQRect;
}
diff --git a/WebCore/src/kwq/KWQKjobclasses.mm b/WebCore/src/kwq/KWQKjobclasses.mm
index 722027f..df23749 100644
--- a/WebCore/src/kwq/KWQKjobclasses.mm
+++ b/WebCore/src/kwq/KWQKjobclasses.mm
@@ -31,7 +31,7 @@
#include <Foundation/Foundation.h>
#include <WCURICache.h>
-static const QString DEFAULT_ERROR_TEXT = "DEFAULT_ERROR_TEXT";
+static const QString *DEFAULT_ERROR_TEXT = NULL;
namespace KIO {
@@ -52,7 +52,11 @@ int Job::error()
const QString &Job::errorText()
{
_logNotYetImplemented();
- return DEFAULT_ERROR_TEXT;
+ if (DEFAULT_ERROR_TEXT == NULL) {
+ DEFAULT_ERROR_TEXT = new QString("DEFAULT_ERROR_TEXT");
+ }
+
+ return *DEFAULT_ERROR_TEXT;
}
diff --git a/WebCore/src/kwq/KWQKnetaccess.mm b/WebCore/src/kwq/KWQKnetaccess.mm
index dae2840..61433ce 100644
--- a/WebCore/src/kwq/KWQKnetaccess.mm
+++ b/WebCore/src/kwq/KWQKnetaccess.mm
@@ -27,7 +27,7 @@
#include <netaccess.h>
//FIX ME:
-static QString tempQString = QString();
+static QString *tempQString;
namespace KIO {
@@ -41,7 +41,11 @@ bool NetAccess::stat(const KURL &, KIO::UDSEntry &)
QString NetAccess::lastErrorString()
{
_logNotYetImplemented();
- return tempQString;
+ if (tempQString == NULL) {
+ tempQString = new QString();
+ }
+
+ return *tempQString;
}
diff --git a/WebCore/src/kwq/KWQPart.mm b/WebCore/src/kwq/KWQPart.mm
index 56299b4..b56e03c 100644
--- a/WebCore/src/kwq/KWQPart.mm
+++ b/WebCore/src/kwq/KWQPart.mm
@@ -42,10 +42,15 @@ KParts::Part::~Part()
}
-static QWidget *theWidget = new QWidget();
+static QWidget *theWidget = NULL;
QWidget *KParts::Part::widget()
{
_logNotYetImplemented();
+
+ if (theWidget == NULL) {
+ theWidget = new QWidget();
+ }
+
return theWidget;
}
@@ -70,10 +75,15 @@ KParts::ReadOnlyPart::~ReadOnlyPart()
}
-static const KURL emptyURL = KURL();
+static KURL *emptyURL = NULL;
const KURL &KParts::ReadOnlyPart::url() const
{
// must override
_logNeverImplemented();
- return emptyURL;
+
+ if (emptyURL == NULL) {
+ emptyURL = new KURL();
+ }
+
+ return *emptyURL;
}
diff --git a/WebCore/src/kwq/KWQPixmap.mm b/WebCore/src/kwq/KWQPixmap.mm
index 17f8b04..8d66700 100644
--- a/WebCore/src/kwq/KWQPixmap.mm
+++ b/WebCore/src/kwq/KWQPixmap.mm
@@ -109,10 +109,15 @@ void QPixmap::setMask(const QBitmap &)
_logNotYetImplemented();
}
-static QBitmap *theMask = new QBitmap();
+static QBitmap *theMask = NULL;
const QBitmap *QPixmap::mask() const
{
_logNotYetImplemented();
+
+ if (theMask == NULL) {
+ theMask = new QBitmap();
+ }
+
return theMask;
}
diff --git a/WebCore/src/kwq/KWQToolTip.mm b/WebCore/src/kwq/KWQToolTip.mm
index 17b06c9..ed8b2c7 100644
--- a/WebCore/src/kwq/KWQToolTip.mm
+++ b/WebCore/src/kwq/KWQToolTip.mm
@@ -27,12 +27,16 @@
#include <qtooltip.h>
// FIXME:
-static QPalette DEFAULT_PALETTE = QPalette();
+static QPalette *DEFAULT_PALETTE = NULL;
QPalette QToolTip::palette()
{
_logNotYetImplemented();
- return DEFAULT_PALETTE;
+ if (DEFAULT_PALETTE == NULL) {
+ DEFAULT_PALETTE = new QPalette();
+ }
+
+ return *DEFAULT_PALETTE;
}
diff --git a/WebCore/src/kwq/kde/_kurl.cpp b/WebCore/src/kwq/kde/_kurl.cpp
index 1f95203..d0181e1 100644
--- a/WebCore/src/kwq/kde/_kurl.cpp
+++ b/WebCore/src/kwq/kde/_kurl.cpp
@@ -33,6 +33,8 @@
#include <qtextcodec.h>
#include <kcharsets.h>
+#if USING_BORROWED_KURL
+
static QTextCodec * codecForHint( int encoding_hint /* not 0 ! */ )
{
/*
@@ -1545,3 +1547,4 @@ bool urlcmp( const QString& _url1, const QString& _url2, bool _ignore_trailing,
return true;
}
+#endif
diff --git a/WebCore/src/kwq/kdecore/kurl.h b/WebCore/src/kwq/kdecore/kurl.h
index c527726..823da9e 100644
--- a/WebCore/src/kwq/kdecore/kurl.h
+++ b/WebCore/src/kwq/kdecore/kurl.h
@@ -33,6 +33,7 @@
// USING_BORROWED_KURL =========================================================
#ifdef USING_BORROWED_KURL
+
#include <_kurl.h>
#else
@@ -122,4 +123,4 @@ private:
#endif
-#endif // USING_BORROWED_KURL
\ No newline at end of file
+#endif // USING_BORROWED_KURL
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list