Remove QPaintBufferSignalProxy and QPaintBufferResource.

Nothing seems to use these...

Change-Id: I58b3e5f8536e43b3076da0a86d9093a6e11b947a
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
bb10
Robin Burchell 2012-04-12 13:37:43 +02:00 committed by Qt by Nokia
parent 6b39f614d1
commit 5aa8e5a81c
2 changed files with 0 additions and 89 deletions

View File

@ -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;

View File

@ -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<const QPaintBufferPrivate *, void *> Cache;
Cache m_cache;
FreeFunc free;
};
QT_END_NAMESPACE
#endif // QPAINTBUFFER_P_H