From 5aa8e5a81cfa1b7a45f5b1642d4706962ee821ed Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 12 Apr 2012 13:37:43 +0200 Subject: Remove QPaintBufferSignalProxy and QPaintBufferResource. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing seems to use these... Change-Id: I58b3e5f8536e43b3076da0a86d9093a6e11b947a Reviewed-by: Samuel Rødal --- src/gui/painting/qpaintbuffer.cpp | 54 --------------------------------------- src/gui/painting/qpaintbuffer_p.h | 35 ------------------------- 2 files changed, 89 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp index 9a57404169..309b619082 100644 --- a/src/gui/painting/qpaintbuffer.cpp +++ b/src/gui/painting/qpaintbuffer.cpp @@ -96,19 +96,6 @@ QTextItemIntCopy::~QTextItemIntCopy() delete m_item.fontEngine; } -/************************************************************************ - * - * QPaintBufferSignalProxy - * - ************************************************************************/ - -Q_GLOBAL_STATIC(QPaintBufferSignalProxy, theSignalProxy) - -QPaintBufferSignalProxy *QPaintBufferSignalProxy::instance() -{ - return theSignalProxy(); -} - /************************************************************************ * * QPaintBufferPrivate @@ -124,8 +111,6 @@ QPaintBufferPrivate::QPaintBufferPrivate() QPaintBufferPrivate::~QPaintBufferPrivate() { - QPaintBufferSignalProxy::instance()->emitAboutToDestroy(this); - for (int i = 0; i < commands.size(); ++i) { const QPaintBufferCommand &cmd = commands.at(i); if (cmd.id == QPaintBufferPrivate::Cmd_DrawTextItem) @@ -2058,45 +2043,6 @@ void QPaintEngineExReplayer::process(const QPaintBufferCommand &cmd) } } -QPaintBufferResource::QPaintBufferResource(FreeFunc f, QObject *parent) : QObject(parent), free(f) -{ - connect(QPaintBufferSignalProxy::instance(), SIGNAL(aboutToDestroy(const QPaintBufferPrivate*)), this, SLOT(remove(const QPaintBufferPrivate*))); -} - -QPaintBufferResource::~QPaintBufferResource() -{ - for (Cache::iterator it = m_cache.begin(); it != m_cache.end(); ++it) - free(it.value()); -} - -void QPaintBufferResource::insert(const QPaintBufferPrivate *key, void *value) -{ - Cache::iterator it = m_cache.find(key); - if (it != m_cache.end()) { - free(it.value()); - it.value() = value; - } else { - m_cache.insert(key, value); - } -} - -void *QPaintBufferResource::value(const QPaintBufferPrivate *key) -{ - Cache::iterator it = m_cache.find(key); - if (it != m_cache.end()) - return it.value(); - return 0; -} - -void QPaintBufferResource::remove(const QPaintBufferPrivate *key) -{ - Cache::iterator it = m_cache.find(key); - if (it != m_cache.end()) { - free(it.value()); - m_cache.erase(it); - } -} - QDataStream &operator<<(QDataStream &stream, const QPaintBufferCommand &command) { quint32 id = command.id; diff --git a/src/gui/painting/qpaintbuffer_p.h b/src/gui/painting/qpaintbuffer_p.h index 0a049fa06e..24886076f5 100644 --- a/src/gui/painting/qpaintbuffer_p.h +++ b/src/gui/painting/qpaintbuffer_p.h @@ -421,41 +421,6 @@ public: mutable QPainterState *m_created_state; }; -class Q_GUI_EXPORT QPaintBufferSignalProxy : public QObject -{ - Q_OBJECT -public: - QPaintBufferSignalProxy() : QObject() {} - void emitAboutToDestroy(const QPaintBufferPrivate *buffer) { - emit aboutToDestroy(buffer); - } - static QPaintBufferSignalProxy *instance(); -Q_SIGNALS: - void aboutToDestroy(const QPaintBufferPrivate *buffer); -}; - -// One resource per paint buffer and vice versa. -class Q_GUI_EXPORT QPaintBufferResource : public QObject -{ - Q_OBJECT -public: - typedef void (*FreeFunc)(void *); - - QPaintBufferResource(FreeFunc f, QObject *parent = 0); - ~QPaintBufferResource(); - // Set resource 'value' for 'key'. - void insert(const QPaintBufferPrivate *key, void *value); - // Return resource for 'key'. - void *value(const QPaintBufferPrivate *key); -public slots: - // Remove entry 'key' from cache and delete resource. - void remove(const QPaintBufferPrivate *key); -private: - typedef QHash Cache; - Cache m_cache; - FreeFunc free; -}; - QT_END_NAMESPACE #endif // QPAINTBUFFER_P_H -- cgit v1.2.3