[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:00:13 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 493ce89ad32125e384ed9d7ee87c9bd1895b6caa
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Apr 2 19:34:39 2002 +0000
Fix some small storage leaks.
* src/kwq/KWQWidget.mm: (QWidget::QWidget): Use a single shared default style
instead of creating a new one for each widget.
(QWidget::setFont): Since we store a QFont here, we don't have to delete the
old font and we don't leak.
(QWidget::setCursor): Since now store a QCursor here, we don't have to delete
the old cursor.
Also removed a lot of unused code in here.
* src/kwq/KWQKURL.mm: Minor code cleanup.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index ca3a64f..8f850e9 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,17 @@
+2002-04-02 Darin Adler <darin at apple.com>
+
+ Fix some small storage leaks.
+
+ * src/kwq/KWQWidget.mm: (QWidget::QWidget): Use a single shared default style
+ instead of creating a new one for each widget.
+ (QWidget::setFont): Since we store a QFont here, we don't have to delete the
+ old font and we don't leak.
+ (QWidget::setCursor): Since now store a QCursor here, we don't have to delete
+ the old cursor.
+ Also removed a lot of unused code in here.
+
+ * src/kwq/KWQKURL.mm: Minor code cleanup.
+
2002-04-02 Richard Williamson <rjw at apple.com>
Added ref() of part from KHTMView.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index ca3a64f..8f850e9 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2002-04-02 Darin Adler <darin at apple.com>
+
+ Fix some small storage leaks.
+
+ * src/kwq/KWQWidget.mm: (QWidget::QWidget): Use a single shared default style
+ instead of creating a new one for each widget.
+ (QWidget::setFont): Since we store a QFont here, we don't have to delete the
+ old font and we don't leak.
+ (QWidget::setCursor): Since now store a QCursor here, we don't have to delete
+ the old cursor.
+ Also removed a lot of unused code in here.
+
+ * src/kwq/KWQKURL.mm: Minor code cleanup.
+
2002-04-02 Richard Williamson <rjw at apple.com>
Added ref() of part from KHTMView.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index ca3a64f..8f850e9 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2002-04-02 Darin Adler <darin at apple.com>
+
+ Fix some small storage leaks.
+
+ * src/kwq/KWQWidget.mm: (QWidget::QWidget): Use a single shared default style
+ instead of creating a new one for each widget.
+ (QWidget::setFont): Since we store a QFont here, we don't have to delete the
+ old font and we don't leak.
+ (QWidget::setCursor): Since now store a QCursor here, we don't have to delete
+ the old cursor.
+ Also removed a lot of unused code in here.
+
+ * src/kwq/KWQKURL.mm: Minor code cleanup.
+
2002-04-02 Richard Williamson <rjw at apple.com>
Added ref() of part from KHTMView.
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index 27a21a1..018eb23 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -364,7 +364,7 @@ QString KURL::normalizeURLString(const QString &s)
}
if (d.isNull()) {
- d = KWQRefPtr<KURL::KWQKURLPrivate>(new KURL::KWQKURLPrivate(qurl));
+ d = KWQRefPtr<KWQKURLPrivate>(new KWQKURLPrivate(qurl));
}
qurl = d->sURL;
@@ -681,7 +681,7 @@ QString KURL::prettyURL(int trailing=0) const
void KURL::swap(KURL &other)
{
- KWQRefPtr<KURL::KWQKURLPrivate> tmpD = other.d;
+ KWQRefPtr<KWQKURLPrivate> tmpD = other.d;
QString tmpString = other.urlString;
other.d = d;
@@ -710,14 +710,14 @@ void KURL::copyOnWrite()
{
parse();
if (d->refCount > 1) {
- d = KWQRefPtr<KURL::KWQKURLPrivate>(new KURL::KWQKURLPrivate(*d));
+ d = KWQRefPtr<KWQKURLPrivate>(new KWQKURLPrivate(*d));
}
}
void KURL::parse() const
{
if (d.isNull()) {
- d = KWQRefPtr<KURL::KWQKURLPrivate>(new KURL::KWQKURLPrivate(urlString));
+ d = KWQRefPtr<KWQKURLPrivate>(new KWQKURLPrivate(urlString));
}
}
@@ -730,4 +730,3 @@ void KURL::assemble()
}
#endif
-
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 570b2a1..c27165c 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -55,55 +55,31 @@ class QWidgetPrivate
friend class QWidget;
public:
- QWidgetPrivate(QWidget *widget) : pos(0,0), rect(0,0,0,0), pal()
- {
- view = [[KWQView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: widget];
- // FIXME! We really don't care about widget styles.
- style = new QStyle();
- font = 0L;
- cursor = 0L;
- }
+ QWidgetPrivate() { }
~QWidgetPrivate() {}
private:
- QPoint pos;
- QRect rect;
QWidget::FocusPolicy focusPolicy;
QStyle *style;
- QFont *font;
- QCursor *cursor;
- QPalette pal;
-#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
+ QFont font;
+ QCursor cursor;
+ QPalette pal;
NSView *view;
-#else
- void *view;
-#endif
- void *action();
};
QWidget::QWidget(QWidget *parent=0, const char *name=0, WFlags f=0)
{
- _initialize();
-}
-
-
-void QWidget::_initialize()
-{
- data = new QWidgetPrivate(this);
+ static QStyle *defaultStyle = new QStyle;
+
+ data = new QWidgetPrivate;
+ data->view = [[KWQView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: this];
+ data->style = defaultStyle;
}
-
-
QWidget::~QWidget()
{
[data->view release];
-
- // What about:
- // data->style
- // data->font
- // data->cursor
-
delete data;
}
@@ -291,7 +267,6 @@ const QPalette& QWidget::palette() const
void QWidget::setPalette(const QPalette &palette)
{
- // FIXME! What do we do about releasing the old palette?
data->pal = palette;
}
@@ -322,14 +297,13 @@ void QWidget::setStyle(QStyle *style)
QFont QWidget::font() const
{
- return *data->font;
+ return data->font;
}
void QWidget::setFont(const QFont &font)
{
- // FIXME Not clear what we should do with old font!
- data->font = new QFont (font);
+ data->font = font;
}
@@ -362,25 +336,19 @@ bool QWidget::isVisible() const
void QWidget::setCursor(const QCursor &cur)
{
_logNotYetImplemented();
- if (data->cursor)
- delete data->cursor;
- data->cursor = new QCursor (cur);
+ data->cursor = cur;
}
QCursor QWidget::cursor()
{
_logNotYetImplemented();
- if (!data->cursor) {
- data->cursor = new QCursor();
- }
- return *(data->cursor);
+ return data->cursor;
}
void QWidget::unsetCursor()
{
_logNotYetImplemented();
- if (!data->cursor)
- data->cursor = new QCursor();
+ data->cursor = QCursor();
}
bool QWidget::event(QEvent *)
@@ -503,10 +471,6 @@ QPoint QWidget::mapFromGlobal(const QPoint &point) const
return QPoint(0,0);
}
-
-
-#ifdef _KWQ_
-
void QWidget::paint (void *)
{
_logNotYetImplemented();
@@ -539,6 +503,3 @@ void QWidget::endEditing()
if ([firstResponder isKindOfClass: NSClassFromString(@"NSText")])
[window makeFirstResponder: nil];
}
-
-#endif _KWQ_
-
diff --git a/WebCore/src/kwq/KWQKURL.mm b/WebCore/src/kwq/KWQKURL.mm
index 27a21a1..018eb23 100644
--- a/WebCore/src/kwq/KWQKURL.mm
+++ b/WebCore/src/kwq/KWQKURL.mm
@@ -364,7 +364,7 @@ QString KURL::normalizeURLString(const QString &s)
}
if (d.isNull()) {
- d = KWQRefPtr<KURL::KWQKURLPrivate>(new KURL::KWQKURLPrivate(qurl));
+ d = KWQRefPtr<KWQKURLPrivate>(new KWQKURLPrivate(qurl));
}
qurl = d->sURL;
@@ -681,7 +681,7 @@ QString KURL::prettyURL(int trailing=0) const
void KURL::swap(KURL &other)
{
- KWQRefPtr<KURL::KWQKURLPrivate> tmpD = other.d;
+ KWQRefPtr<KWQKURLPrivate> tmpD = other.d;
QString tmpString = other.urlString;
other.d = d;
@@ -710,14 +710,14 @@ void KURL::copyOnWrite()
{
parse();
if (d->refCount > 1) {
- d = KWQRefPtr<KURL::KWQKURLPrivate>(new KURL::KWQKURLPrivate(*d));
+ d = KWQRefPtr<KWQKURLPrivate>(new KWQKURLPrivate(*d));
}
}
void KURL::parse() const
{
if (d.isNull()) {
- d = KWQRefPtr<KURL::KWQKURLPrivate>(new KURL::KWQKURLPrivate(urlString));
+ d = KWQRefPtr<KWQKURLPrivate>(new KWQKURLPrivate(urlString));
}
}
@@ -730,4 +730,3 @@ void KURL::assemble()
}
#endif
-
diff --git a/WebCore/src/kwq/KWQWidget.mm b/WebCore/src/kwq/KWQWidget.mm
index 570b2a1..c27165c 100644
--- a/WebCore/src/kwq/KWQWidget.mm
+++ b/WebCore/src/kwq/KWQWidget.mm
@@ -55,55 +55,31 @@ class QWidgetPrivate
friend class QWidget;
public:
- QWidgetPrivate(QWidget *widget) : pos(0,0), rect(0,0,0,0), pal()
- {
- view = [[KWQView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: widget];
- // FIXME! We really don't care about widget styles.
- style = new QStyle();
- font = 0L;
- cursor = 0L;
- }
+ QWidgetPrivate() { }
~QWidgetPrivate() {}
private:
- QPoint pos;
- QRect rect;
QWidget::FocusPolicy focusPolicy;
QStyle *style;
- QFont *font;
- QCursor *cursor;
- QPalette pal;
-#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
+ QFont font;
+ QCursor cursor;
+ QPalette pal;
NSView *view;
-#else
- void *view;
-#endif
- void *action();
};
QWidget::QWidget(QWidget *parent=0, const char *name=0, WFlags f=0)
{
- _initialize();
-}
-
-
-void QWidget::_initialize()
-{
- data = new QWidgetPrivate(this);
+ static QStyle *defaultStyle = new QStyle;
+
+ data = new QWidgetPrivate;
+ data->view = [[KWQView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: this];
+ data->style = defaultStyle;
}
-
-
QWidget::~QWidget()
{
[data->view release];
-
- // What about:
- // data->style
- // data->font
- // data->cursor
-
delete data;
}
@@ -291,7 +267,6 @@ const QPalette& QWidget::palette() const
void QWidget::setPalette(const QPalette &palette)
{
- // FIXME! What do we do about releasing the old palette?
data->pal = palette;
}
@@ -322,14 +297,13 @@ void QWidget::setStyle(QStyle *style)
QFont QWidget::font() const
{
- return *data->font;
+ return data->font;
}
void QWidget::setFont(const QFont &font)
{
- // FIXME Not clear what we should do with old font!
- data->font = new QFont (font);
+ data->font = font;
}
@@ -362,25 +336,19 @@ bool QWidget::isVisible() const
void QWidget::setCursor(const QCursor &cur)
{
_logNotYetImplemented();
- if (data->cursor)
- delete data->cursor;
- data->cursor = new QCursor (cur);
+ data->cursor = cur;
}
QCursor QWidget::cursor()
{
_logNotYetImplemented();
- if (!data->cursor) {
- data->cursor = new QCursor();
- }
- return *(data->cursor);
+ return data->cursor;
}
void QWidget::unsetCursor()
{
_logNotYetImplemented();
- if (!data->cursor)
- data->cursor = new QCursor();
+ data->cursor = QCursor();
}
bool QWidget::event(QEvent *)
@@ -503,10 +471,6 @@ QPoint QWidget::mapFromGlobal(const QPoint &point) const
return QPoint(0,0);
}
-
-
-#ifdef _KWQ_
-
void QWidget::paint (void *)
{
_logNotYetImplemented();
@@ -539,6 +503,3 @@ void QWidget::endEditing()
if ([firstResponder isKindOfClass: NSClassFromString(@"NSText")])
[window makeFirstResponder: nil];
}
-
-#endif _KWQ_
-
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list