summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLasse Holmstedt <lasse.holmstedt@nokia.com>2012-02-02 15:54:05 +0100
committerGunnar Sletta <gunnar.sletta@nokia.com>2012-02-03 09:36:20 +0100
commit7c02d300ce5274f17b13d8da857217af3343fda7 (patch)
tree986cb2ba48163b36eb63549b149a6bed33afce47 /src
parentc8ca4b74a8ad7469c3597ec9412cf175b1ef6fcc (diff)
Don't try to carry over qPrintable() pointers
The pointer is out of scope by the time it's sent through wayland. Change-Id: I00e9f050dfa47bf078921600d2bf63502f0b4897 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Ian Monroe <ian.monroe@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/compositor/wayland_wrapper/wlextendedsurface.cpp4
-rw-r--r--src/compositor/wayland_wrapper/wlextendedsurface.h2
-rw-r--r--src/compositor/wayland_wrapper/wlsurface.cpp3
3 files changed, 4 insertions, 5 deletions
diff --git a/src/compositor/wayland_wrapper/wlextendedsurface.cpp b/src/compositor/wayland_wrapper/wlextendedsurface.cpp
index 5ee1f93d9..38e4dff4f 100644
--- a/src/compositor/wayland_wrapper/wlextendedsurface.cpp
+++ b/src/compositor/wayland_wrapper/wlextendedsurface.cpp
@@ -94,7 +94,7 @@ ExtendedSurface::~ExtendedSurface()
}
-void ExtendedSurface::sendGenericProperty(const char *name, const QVariant &variant)
+void ExtendedSurface::sendGenericProperty(const QString &name, const QVariant &variant)
{
QByteArray byteValue;
QDataStream ds(&byteValue, QIODevice::WriteOnly);
@@ -103,7 +103,7 @@ void ExtendedSurface::sendGenericProperty(const char *name, const QVariant &vari
data.size = byteValue.size();
data.data = (void*) byteValue.constData();
data.alloc = 0;
- wl_resource_post_event(m_extended_surface_resource,WL_EXTENDED_SURFACE_SET_GENERIC_PROPERTY, name,&data);
+ wl_resource_post_event(m_extended_surface_resource,WL_EXTENDED_SURFACE_SET_GENERIC_PROPERTY, qPrintable(name), &data);
}
diff --git a/src/compositor/wayland_wrapper/wlextendedsurface.h b/src/compositor/wayland_wrapper/wlextendedsurface.h
index 2bc1f6360..5cbabe60d 100644
--- a/src/compositor/wayland_wrapper/wlextendedsurface.h
+++ b/src/compositor/wayland_wrapper/wlextendedsurface.h
@@ -78,7 +78,7 @@ public:
ExtendedSurface(struct wl_client *client, uint32_t id, Surface *surface);
~ExtendedSurface();
- void sendGenericProperty(const char *name, const QVariant &variant);
+ void sendGenericProperty(const QString &name, const QVariant &variant);
void sendOnScreenVisibllity(bool visible);
void setSubSurface(ExtendedSurface *subSurface,int x, int y);
diff --git a/src/compositor/wayland_wrapper/wlsurface.cpp b/src/compositor/wayland_wrapper/wlsurface.cpp
index 107a726c9..be2eb14ba 100644
--- a/src/compositor/wayland_wrapper/wlsurface.cpp
+++ b/src/compositor/wayland_wrapper/wlsurface.cpp
@@ -607,8 +607,7 @@ void Surface::setWindowProperty(const QString &name, const QVariant &value, bool
d->windowProperties.insert(name, value);
handle()->windowPropertyChanged(name,value);
if (writeUpdateToClient && d->extendedSurface) {
- const char *property = qPrintable(name);
- d->extendedSurface->sendGenericProperty(property,value);
+ d->extendedSurface->sendGenericProperty(name, value);
}
}