aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Berres <armin.berres@basyskom.de>2010-12-01 15:02:12 +0100
committerArmin Berres <armin.berres@basyskom.de>2010-12-02 16:25:17 +0100
commit0d1d0e9e55d030fb788c24cb83f155cae7d36172 (patch)
treeac119be8c0dc0b29578886a325ab570dc1b4e33f
parent5c7139a89d7e8be5986fc23b073bca3f31cc8fb7 (diff)
Changes: introduce new method to check if we are running with meego graphcissystem
RevBy: Stanislav Ionascu Details: Additionally replaced Meego with MeeGo and Graphicssystem with GraphicsSystem in function signatures.
-rw-r--r--src/corelib/core/mcomponentdata.cpp2
-rw-r--r--src/corelib/core/mgraphicssystemhelper.cpp14
-rw-r--r--src/corelib/core/mgraphicssystemhelper.h5
-rw-r--r--src/corelib/theme/mimagedirectory.cpp2
-rw-r--r--src/corelib/widgets/mwindow.cpp9
5 files changed, 20 insertions, 12 deletions
diff --git a/src/corelib/core/mcomponentdata.cpp b/src/corelib/core/mcomponentdata.cpp
index 764348f2..10c5d056 100644
--- a/src/corelib/core/mcomponentdata.cpp
+++ b/src/corelib/core/mcomponentdata.cpp
@@ -536,7 +536,7 @@ void MComponentDataPrivate::parseArguments(int &argc, char **argv,
} else if (s == "-remote-theme") {
themeService = MTheme::RemoteTheme;
} else if (s == "-local-theme") {
- if (softwareRendering && MGraphicsSystemHelper::isRunningMeegoCompatibleGraphicssystem()) {
+ if (softwareRendering && MGraphicsSystemHelper::isRunningMeeGoCompatibleGraphicsSystem()) {
qCritical("-local-theme in combination with -software is not supported with the MeeGo graphicssystem. Please either drop one of the parameters or use a different graphicssystem.");
exit(EXIT_FAILURE);
}
diff --git a/src/corelib/core/mgraphicssystemhelper.cpp b/src/corelib/core/mgraphicssystemhelper.cpp
index fcdfe8ba..a09a4374 100644
--- a/src/corelib/core/mgraphicssystemhelper.cpp
+++ b/src/corelib/core/mgraphicssystemhelper.cpp
@@ -207,7 +207,7 @@ QPixmap MGraphicsSystemHelper::pixmapFromHandle(const MPixmapHandle& pixmapHandl
Q_UNUSED(addr);
Q_UNUSED(numBytes);
#else
- if (MGraphicsSystemHelper::isRunningMeegoCompatibleGraphicssystem() && pixmapHandle.eglHandle) {
+ if (MGraphicsSystemHelper::isRunningMeeGoCompatibleGraphicsSystem() && pixmapHandle.eglHandle) {
int fd = shm_open(qPrintable(pixmapHandle.shmHandle), O_RDONLY, 0444);
if (fd == -1) {
qFatal("Failed to open shared memory: %s, %s", strerror(errno), qPrintable(pixmapHandle.shmHandle));
@@ -236,7 +236,7 @@ QPixmap MGraphicsSystemHelper::pixmapFromHandle(const MPixmapHandle& pixmapHandl
* Returns true when the native graphicssystem is used.
* If there is no support for the MeeGo graphicssystem true is always returned.
*/
-bool MGraphicsSystemHelper::isRunningNativeGraphicssystem() {
+bool MGraphicsSystemHelper::isRunningNativeGraphicsSystem() {
#ifdef HAVE_MEEGOGRAPHICSSYSTEM
return QMeeGoGraphicsSystemHelper::runningGraphicsSystemName() == QLatin1String("native");
#else
@@ -244,7 +244,7 @@ bool MGraphicsSystemHelper::isRunningNativeGraphicssystem() {
#endif
}
-bool MGraphicsSystemHelper::isRunningMeegoCompatibleGraphicssystem() {
+bool MGraphicsSystemHelper::isRunningMeeGoCompatibleGraphicsSystem() {
#ifdef HAVE_MEEGOGRAPHICSSYSTEM
if (QMeeGoGraphicsSystemHelper::isRunningRuntime()) {
if (QMeeGoGraphicsSystemHelper::runningGraphicsSystemName() == QLatin1String("meego") ||
@@ -258,3 +258,11 @@ bool MGraphicsSystemHelper::isRunningMeegoCompatibleGraphicssystem() {
#endif
}
+bool MGraphicsSystemHelper::isRunningMeeGoGraphicsSystem() {
+#ifdef HAVE_MEEGOGRAPHICSSYSTEM
+ if (QMeeGoGraphicsSystemHelper::isRunningMeeGo()) {
+ return true;
+ }
+#endif
+ return false;
+}
diff --git a/src/corelib/core/mgraphicssystemhelper.h b/src/corelib/core/mgraphicssystemhelper.h
index 29eb04da..74b713f6 100644
--- a/src/corelib/core/mgraphicssystemhelper.h
+++ b/src/corelib/core/mgraphicssystemhelper.h
@@ -34,8 +34,9 @@ public:
static void pixmapFromImage(PixmapCacheEntry *cacheEntry, const QImage& image, const QString &uniqueKey, const QSize &requestedSize);
static QPixmap pixmapFromHandle(const MPixmapHandle& pixmapHandle, void **addr, int *numBytes);
- static bool isRunningNativeGraphicssystem();
- static bool isRunningMeegoCompatibleGraphicssystem();
+ static bool isRunningNativeGraphicsSystem();
+ static bool isRunningMeeGoCompatibleGraphicsSystem();
+ static bool isRunningMeeGoGraphicsSystem();
};
diff --git a/src/corelib/theme/mimagedirectory.cpp b/src/corelib/theme/mimagedirectory.cpp
index 173856ea..6b4ca19c 100644
--- a/src/corelib/theme/mimagedirectory.cpp
+++ b/src/corelib/theme/mimagedirectory.cpp
@@ -55,7 +55,7 @@ ImageResource::ImageResource(const QString& absoluteFilePath) :
// When starting an application, the X11 window must be filled with a default background
// image in a fast way. The filling can only be done fast if the background image is available
// as X11 pixmap.
- convertToX11 = MGraphicsSystemHelper::isRunningMeegoCompatibleGraphicssystem()
+ convertToX11 = MGraphicsSystemHelper::isRunningMeeGoCompatibleGraphicsSystem()
&& absoluteFilePath.contains("forcex11");
#endif
}
diff --git a/src/corelib/widgets/mwindow.cpp b/src/corelib/widgets/mwindow.cpp
index 18d281af..027cba47 100644
--- a/src/corelib/widgets/mwindow.cpp
+++ b/src/corelib/widgets/mwindow.cpp
@@ -185,7 +185,6 @@ void MWindowPrivate::init()
#endif
q->setTranslucentBackground(false);
-
if (MApplication::fullScreen())
q->showFullScreen();
}
@@ -658,11 +657,11 @@ void MWindowPrivate::handleWindowStateChangeEvent(QWindowStateChangeEvent *event
MTheme::cleanupGarbage();
} else if (event->oldState().testFlag(Qt::WindowMinimized)
&& !q->windowState().testFlag(Qt::WindowMinimized)) {
- if (MGraphicsSystemHelper::isRunningNativeGraphicssystem()) {
+ if (MGraphicsSystemHelper::isRunningNativeGraphicsSystem()) {
q->setUpdatesEnabled(false);
}
initGLViewport();
- if (MGraphicsSystemHelper::isRunningNativeGraphicssystem()) {
+ if (MGraphicsSystemHelper::isRunningNativeGraphicsSystem()) {
QTimer::singleShot(700, q, SLOT(_q_enablePaintUpdates()));
}
}
@@ -806,7 +805,7 @@ void MWindow::setTranslucentBackground(bool enable)
// when the gl widget is not initialized yet we will also not initialize it
if (MApplication::softwareRendering() || MApplication::isPrestarted() ||
- (MGraphicsSystemHelper::isRunningNativeGraphicssystem() && !dynamic_cast<QGLWidget*>(viewport()))) {
+ (MGraphicsSystemHelper::isRunningNativeGraphicsSystem() && !dynamic_cast<QGLWidget*>(viewport()))) {
d->initSoftwareViewport();
} else {
d->initGLViewport();
@@ -1423,7 +1422,7 @@ void MWindow::setVisible(bool visible)
return;
} else {
if (!windowState().testFlag(Qt::WindowMinimized) && !MApplication::softwareRendering()) {
- if (MGraphicsSystemHelper::isRunningNativeGraphicssystem()) {
+ if (MGraphicsSystemHelper::isRunningNativeGraphicsSystem()) {
if (!dynamic_cast<QGLWidget*>(viewport())) {
d->initGLViewport();
}