Commit 855bdbd3 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

platforms/drm: fix crashing debug operator


(cherry picked from commit 566223b1)
parent 5b48ca7a
......@@ -167,7 +167,13 @@ void DrmObject::Property::initEnumMap(drmModePropertyRes *prop)
}
QDebug& operator<<(QDebug& s, const KWin::DrmObject *obj)
QDebug operator<<(QDebug s, const KWin::DrmObject *obj)
{
return s.nospace() << "DrmObject(" << obj->id() << ", gpu: "<< obj->gpu() << ')';
QDebugStateSaver saver(s);
if (obj) {
s.nospace() << "DrmObject(id=" << obj->id() << ", gpu="<< obj->gpu() << ')';
} else {
s << "DrmObject(0x0)";
}
return s;
}
......@@ -171,4 +171,4 @@ private:
}
QDebug& operator<<(QDebug& stream, const KWin::DrmObject*);
QDebug operator<<(QDebug stream, const KWin::DrmObject*);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment