@@ -20,6 +20,7 @@
20#include <unity/shell/application/MirSurfaceInterface.h>
20#include <unity/shell/application/MirSurfaceInterface.h>
22#include <QQmlEngine>
22#include <QQmlEngine>
23+#include <QTextStream>
24namespace unityapi = unity::shell::application;
25namespace unityapi = unity::shell::application;
@@ -117,6 +118,7 @@ void Window::close()
118void Window::activate()
119void Window::activate()
120 if (m_surface) {
122 if (m_surface) {
121 m_surface->activate();
123 m_surface->activate();
@@ -206,17 +208,18 @@ void Window::setFocused(bool value)
207QString Window::toString() const
209QString Window::toString() const
213+ QTextStream stream(&result);
214+ stream << "Window["<<(void*)this<<", id="<<id()<<", ";
209− if (surface()) {
215+ if (surface()) {
210− return QString("Window[0x%1, id=%2, MirSurface[0x%3,\"%4\"]]").arg(
211− QString::number((quintptr)this, 16),
212− QString::number(id()),
213− QString::number((quintptr)surface(), 16),
214− surface()->name());
216+ stream << "MirSurface["<<(void*)surface()<<",\""<<surface()->name()<<"\"]";
215− } else {
217+ } else {
216− return QString("Window[0x%1, id=%2, null]").arg(
218+ stream << "null";
217− QString::number((quintptr)this, 0, 16),
219+ }
218− QString::number(id()));
220+ stream << "]";
222QDebug operator<<(QDebug dbg, const Window *window)
225QDebug operator<<(QDebug dbg, const Window *window)