summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Stockwell <gareth.stockwell@sosco.com>2009-10-07 16:14:25 (GMT)
committerGareth Stockwell <gareth.stockwell@sosco.com>2009-10-09 06:50:29 (GMT)
commit252c3f9800444fc0e8f011ab0bf245d413acdb4d (patch)
tree2ed6b38f3c23cb635ca9baf6764a34adde479cf1
parent7b4c917811f48328502ae4cd2a676a6f2d4f7a6b (diff)
downloadQt-252c3f9800444fc0e8f011ab0bf245d413acdb4d.zip
Qt-252c3f9800444fc0e8f011ab0bf245d413acdb4d.tar.gz
Qt-252c3f9800444fc0e8f011ab0bf245d413acdb4d.tar.bz2
Modified ObjectDump annotator for Symbian window information
This prevents a crash when applied to controls which are non-window owning Reviewed-by: Frans Englich
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
index 8557e90..2fceb62 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
@@ -59,89 +59,89 @@ QList<QByteArray> QAnnotatorWidget::annotation(const QObject& object)
QList<QByteArray> QAnnotatorControl::annotation(const QObject& object)
{
QList<QByteArray> result;
-
+
const QWidget* widget = qobject_cast<const QWidget*>(&object);
if(widget) {
-
+
const CCoeControl* control = widget->effectiveWinId();
if(control) {
-
+
QByteArray array;
QTextStream stream(&array);
-
+
stream << "control: " << control << ' ';
stream << "parent " << control->Parent() << ' ';
-
+
if(control->IsVisible())
stream << "visible ";
else
stream << "invisible ";
-
+
stream << control->Position().iX << ',' << control->Position().iY << ' ';
stream << control->Size().iWidth << 'x' << control->Size().iHeight;
-
+
if(control->OwnsWindow())
stream << " ownsWindow ";
-
+
stream.flush();
result.append(array);
}
}
-
+
return result;
}
QList<QByteArray> QAnnotatorWindow::annotation(const QObject& object)
{
QList<QByteArray> result;
-
+
const QWidget* widget = qobject_cast<const QWidget*>(&object);
if(widget) {
-
+
const CCoeControl* control = widget->effectiveWinId();
- if(control) {
-
- RDrawableWindow& window = *(control->DrawableWindow());
-
+ RDrawableWindow *window = 0;
+
+ if(control && (window = control->DrawableWindow())) {
+
QByteArray array;
QTextStream stream(&array);
-
+
stream << "window: ";
-
+
// ClientHandle() is available first in 5.0.
#if !defined(__SERIES60_31__) && !defined(__S60_32__)
if (QSysInfo::s60Version() > QSysInfo::SV_S60_3_2)
// Client-side window handle
// Cast to a void pointer so that log output is in hexadecimal format.
- stream << "cli " << reinterpret_cast<const void*>(window.ClientHandle()) << ' ';
+ stream << "cli " << reinterpret_cast<const void*>(window->ClientHandle()) << ' ';
#endif
// Server-side address of CWsWindow object
// This is useful for correlation with the window tree dumped by the window
// server (see RWsSession::LogCommand).
// Cast to a void pointer so that log output is in hexadecimal format.
- stream << "srv " << reinterpret_cast<const void*>(window.WsHandle()) << ' ';
-
- stream << "group " << window.WindowGroupId() << ' ';
-
+ stream << "srv " << reinterpret_cast<const void*>(window->WsHandle()) << ' ';
+
+ stream << "group " << window->WindowGroupId() << ' ';
+
// Client-side handle to the parent window.
- // Cast to a void pointer so that log output is in hexadecimal format.
- stream << "parent " << reinterpret_cast<const void*>(window.Parent()) << ' ';
-
- stream << window.Position().iX << ',' << window.Position().iY << ' ';
- stream << '(' << window.AbsPosition().iX << ',' << window.AbsPosition().iY << ") ";
- stream << window.Size().iWidth << 'x' << window.Size().iHeight << ' ';
-
- const TDisplayMode displayMode = window.DisplayMode();
+ // Cast to a void pointer so that log output is in hexadecimal format.
+ stream << "parent " << reinterpret_cast<const void*>(window->Parent()) << ' ';
+
+ stream << window->Position().iX << ',' << window->Position().iY << ' ';
+ stream << '(' << window->AbsPosition().iX << ',' << window->AbsPosition().iY << ") ";
+ stream << window->Size().iWidth << 'x' << window->Size().iHeight << ' ';
+
+ const TDisplayMode displayMode = window->DisplayMode();
stream << "mode " << displayMode << ' ';
-
- stream << "ord " << window.OrdinalPosition();
-
+
+ stream << "ord " << window->OrdinalPosition();
+
stream.flush();
result.append(array);
- }
+ }
}
-
+
return result;
}