After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 680235 - QGlib::Value doesn't support QGlib::Error
QGlib::Value doesn't support QGlib::Error
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: qt-gstreamer
git master
Other Linux
: Normal normal
: 0.10.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 680236
 
 
Reported: 2012-07-19 09:24 UTC by Mathias Hasselmann (IRC: tbf)
Modified: 2012-12-18 16:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
QGlib: Integrate QGlib::Error with QGlib::Value (5.24 KB, patch)
2012-07-19 09:24 UTC, Mathias Hasselmann (IRC: tbf)
needs-work Details | Review
QGlib: Update gen.cpp for GError wrapping (8.22 KB, patch)
2012-07-19 09:25 UTC, Mathias Hasselmann (IRC: tbf)
reviewed Details | Review
0001-Improve-the-build.patch (58.11 KB, patch)
2012-12-12 10:58 UTC, Murray Cumming
none Details | Review
0001-QGlib-Integrate-QGlib-Error-with-QGlib-Value2.patch (5.32 KB, patch)
2012-12-12 10:59 UTC, Murray Cumming
committed Details | Review

Description Mathias Hasselmann (IRC: tbf) 2012-07-19 09:24:55 UTC
Created attachment 219205 [details] [review]
QGlib: Integrate QGlib::Error with QGlib::Value

When testing the async API of my GstDiscoverer wrapping I've noticed that QGlib::Value doesn't support QGlib::Error.
Comment 1 Mathias Hasselmann (IRC: tbf) 2012-07-19 09:25:24 UTC
Created attachment 219206 [details] [review]
QGlib: Update gen.cpp for GError wrapping
Comment 2 George Kiagiadakis 2012-08-02 08:11:22 UTC
Review of attachment 219205 [details] [review]:

Looks good, thanks. Just some minor issues to fix.

Also, now that class Error can have a null GError inside, I would also expect it to have a "bool isValid() const" method now that returns true when m_error != NULL.

::: src/QGlib/error.cpp
@@ +47,3 @@
 {
+    if (m_error != other.m_error) {
+        g_error_free(m_error);

What if m_error is NULL here? Does g_error_free() handle it?

@@ +62,3 @@
 const char* Error::what() const throw()
 {
+    return m_error ? m_error->message : NULL;

Maybe return a null string here "" instead of a NULL pointer. Will probably save a few crashes...

::: src/QGlib/value.h
@@ +486,3 @@
+    static inline void set(Value & value, const Error & data)
+    {
+    {

static_cast<const GError *>(data) please.
Comment 3 George Kiagiadakis 2012-08-02 08:13:07 UTC
Review of attachment 219206 [details] [review]:

Ok, this is autogenerated so I am not reviewing it. You can (and should) commit it when the other patch gets commited.
Comment 4 Murray Cumming 2012-12-12 10:58:13 UTC
Created attachment 231339 [details] [review]
0001-Improve-the-build.patch

Revised, to address your comments. Thanks for the review.
Comment 5 Murray Cumming 2012-12-12 10:59:55 UTC
Created attachment 231340 [details] [review]
0001-QGlib-Integrate-QGlib-Error-with-QGlib-Value2.patch

Sorry. This is the correct patch.