GNOME Bugzilla – Bug 680235
QGlib::Value doesn't support QGlib::Error
Last modified: 2012-12-18 16:35:04 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.
Created attachment 219206 [details] [review] QGlib: Update gen.cpp for GError wrapping
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.
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.
Created attachment 231339 [details] [review] 0001-Improve-the-build.patch Revised, to address your comments. Thanks for the review.
Created attachment 231340 [details] [review] 0001-QGlib-Integrate-QGlib-Error-with-QGlib-Value2.patch Sorry. This is the correct patch.