summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-08-25 01:25:19 +0800
committerLars Knoll <lars.knoll@nokia.com>2011-08-26 13:35:49 +0200
commit30c23971d0e584a5cbfa1787f60e0f5837efd046 (patch)
tree21acf3c9f5a84fcc04edb9f8c9de047fac17ea2f /src
parent688d9f6ec0a0da5539a3d11fa1dc6e1ae0558cda (diff)
directfb: Follow coding standards, add hints of memleaks, remove vars
Use m_ for all member variables, document some classes that appear to lack proper destruction, remove unused variables from classes. Change-Id: Icec451149fa5d562d8d5f54cbe9a1aa1518bfc48 Reviewed-on: http://codereview.qt.nokia.com/3667 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/directfb/qdirectfbcursor.cpp18
-rw-r--r--src/plugins/platforms/directfb/qdirectfbcursor.h8
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.cpp33
-rw-r--r--src/plugins/platforms/directfb/qdirectfbintegration.h11
-rw-r--r--src/plugins/platforms/directfb/qdirectfbwindow.cpp2
5 files changed, 36 insertions, 36 deletions
diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.cpp b/src/plugins/platforms/directfb/qdirectfbcursor.cpp
index cd4130b18e..b39a3f3c0a 100644
--- a/src/plugins/platforms/directfb/qdirectfbcursor.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbcursor.cpp
@@ -43,24 +43,26 @@
#include "qdirectfbconvenience.h"
-QDirectFBCursor::QDirectFBCursor(QPlatformScreen* screen) :
- QPlatformCursor(screen), surface(0)
+QDirectFBCursor::QDirectFBCursor(QPlatformScreen *screen)
+ : QPlatformCursor(screen)
{
QDirectFbConvenience::dfbInterface()->GetDisplayLayer(QDirectFbConvenience::dfbInterface(),DLID_PRIMARY, &m_layer);
- image = new QPlatformCursorImage(0, 0, 0, 0, 0, 0);
+ m_image = new QPlatformCursorImage(0, 0, 0, 0, 0, 0);
}
-void QDirectFBCursor::changeCursor(QCursor * cursor, QWindow * window)
+#warning "Memory leak?"
+
+void QDirectFBCursor::changeCursor(QCursor *cursor, QWindow *)
{
int xSpot;
int ySpot;
QPixmap map;
if (cursor->shape() != Qt::BitmapCursor) {
- image->set(cursor->shape());
- xSpot = image->hotspot().x();
- ySpot = image->hotspot().y();
- QImage *i = image->image();
+ m_image->set(cursor->shape());
+ xSpot = m_image->hotspot().x();
+ ySpot = m_image->hotspot().y();
+ QImage *i = m_image->image();
map = QPixmap::fromImage(*i);
} else {
QPoint point = cursor->hotSpot();
diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.h b/src/plugins/platforms/directfb/qdirectfbcursor.h
index ab94d72153..22328da402 100644
--- a/src/plugins/platforms/directfb/qdirectfbcursor.h
+++ b/src/plugins/platforms/directfb/qdirectfbcursor.h
@@ -51,13 +51,11 @@ class QDirectFBCursor : public QPlatformCursor
{
public:
QDirectFBCursor(QPlatformScreen *screem);
- void changeCursor(QCursor * cursor, QWindow * window);
+ void changeCursor(QCursor *cursor, QWindow *window);
private:
- IDirectFBDisplayLayer * m_layer;
- IDirectFBSurface * surface;
- QPlatformCursorImage * image;
- QDirectFbBlitter *blitter;
+ IDirectFBDisplayLayer *m_layer;
+ QPlatformCursorImage *m_image;
};
#endif // QDIRECTFBCURSOR_H
diff --git a/src/plugins/platforms/directfb/qdirectfbintegration.cpp b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
index 28b0979df7..7bf26b433a 100644
--- a/src/plugins/platforms/directfb/qdirectfbintegration.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.cpp
@@ -60,7 +60,7 @@
QT_BEGIN_NAMESPACE
QDirectFbScreen::QDirectFbScreen(int display)
- :QPlatformScreen()
+ : QPlatformScreen()
{
m_layer = QDirectFbConvenience::dfbDisplayLayer(display);
m_layer->SetCooperativeLevel(m_layer,DLSCL_SHARED);
@@ -75,18 +75,19 @@ QDirectFbScreen::QDirectFbScreen(int display)
m_depth = QDirectFbConvenience::colorDepthForSurface(config.pixelformat);
m_physicalSize = QSize(qRound(config.width * inch / dpi), qRound(config.height *inch / dpi));
- cursor = new QDirectFBCursor(this);
+ m_cursor = new QDirectFBCursor(this);
}
QDirectFbScreen::~QDirectFbScreen()
{
+#warning "Delete the cursor?"
}
QDirectFbIntegration::QDirectFbIntegration()
- : mFontDb(new QGenericUnixFontDatabase())
- , mEventDispatcher(createUnixEventDispatcher())
+ : m_fontDb(new QGenericUnixFontDatabase())
+ , m_eventDispatcher(createUnixEventDispatcher())
{
- QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher);
+ QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher);
const QStringList args = QCoreApplication::arguments();
int argc = args.size();
@@ -107,18 +108,18 @@ QDirectFbIntegration::QDirectFbIntegration()
QDirectFbScreen *primaryScreen = new QDirectFbScreen(0);
screenAdded(primaryScreen);
- mInputRunner = new QThread;
- mInput = new QDirectFbInput(0);
- mInput->moveToThread(mInputRunner);
- QObject::connect(mInputRunner,SIGNAL(started()),mInput,SLOT(runInputEventLoop()));
- mInputRunner->start();
+ m_inputRunner = new QThread;
+ m_input = new QDirectFbInput(0);
+ m_input->moveToThread(m_inputRunner);
+ QObject::connect(m_inputRunner,SIGNAL(started()),m_input,SLOT(runInputEventLoop()));
+ m_inputRunner->start();
}
QDirectFbIntegration::~QDirectFbIntegration()
{
- mInput->stopInputEventLoop();
- delete mInputRunner;
- delete mInput;
+ m_input->stopInputEventLoop();
+ delete m_inputRunner;
+ delete m_input;
}
QPlatformPixmap *QDirectFbIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
@@ -131,13 +132,13 @@ QPlatformPixmap *QDirectFbIntegration::createPlatformPixmap(QPlatformPixmap::Pix
QPlatformWindow *QDirectFbIntegration::createPlatformWindow(QWindow *window) const
{
- QDirectFbInput *input = const_cast<QDirectFbInput *>(mInput);//gah
+ QDirectFbInput *input = const_cast<QDirectFbInput *>(m_input);//gah
return new QDirectFbWindow(window,input);
}
QAbstractEventDispatcher *QDirectFbIntegration::guiThreadEventDispatcher() const
{
- return mEventDispatcher;
+ return m_eventDispatcher;
}
QPlatformBackingStore *QDirectFbIntegration::createPlatformBackingStore(QWindow *window) const
@@ -147,7 +148,7 @@ QPlatformBackingStore *QDirectFbIntegration::createPlatformBackingStore(QWindow
QPlatformFontDatabase *QDirectFbIntegration::fontDatabase() const
{
- return mFontDb;
+ return m_fontDb;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/directfb/qdirectfbintegration.h b/src/plugins/platforms/directfb/qdirectfbintegration.h
index 67eed38c41..64f3b6005a 100644
--- a/src/plugins/platforms/directfb/qdirectfbintegration.h
+++ b/src/plugins/platforms/directfb/qdirectfbintegration.h
@@ -74,8 +74,7 @@ public:
IDirectFBDisplayLayer *m_layer;
private:
- QDirectFBCursor * cursor;
-
+ QDirectFBCursor *m_cursor;
};
class QDirectFbIntegration : public QPlatformIntegration
@@ -92,10 +91,10 @@ public:
QPlatformFontDatabase *fontDatabase() const;
private:
- QDirectFbInput *mInput;
- QThread *mInputRunner;
- QPlatformFontDatabase *mFontDb;
- QAbstractEventDispatcher *mEventDispatcher;
+ QDirectFbInput *m_input;
+ QThread *m_inputRunner;
+ QPlatformFontDatabase *m_fontDb;
+ QAbstractEventDispatcher *m_eventDispatcher;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/directfb/qdirectfbwindow.cpp b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
index 94cd63b997..40b2cec4ff 100644
--- a/src/plugins/platforms/directfb/qdirectfbwindow.cpp
+++ b/src/plugins/platforms/directfb/qdirectfbwindow.cpp
@@ -47,7 +47,7 @@
#include <directfb.h>
QDirectFbWindow::QDirectFbWindow(QWindow *tlw, QDirectFbInput *inputhandler)
- : QPlatformWindow(tlw), m_inputHandler(inputhandler), m_context(0)
+ : QPlatformWindow(tlw), m_inputHandler(inputhandler)
{
IDirectFBDisplayLayer *layer = QDirectFbConvenience::dfbDisplayLayer();
DFBDisplayLayerConfig layerConfig;