[mythtv] Re: [mythtv-commits] mythtv commits
Jeremiah Morris
jm at whpress.com
Sat Jan 15 21:46:12 EST 2005
On 15 Jan 2005, at 9:27 PM, Isaac Richards wrote:
> These changes are incorrect, please revert them. The error messages
> would be
> printed out with the placeholders, instead of with the actual values.
Are we dropping Qt 3.1 compatibility then? That's what it means to
revert the changes without another fix in place.
Regardless of the compatibility issue, those calls make little sense
when you look at the DBError signature. It's wanting a QSqlQuery, not
a QString as executedQuery returns. The problem is that DBError uses
lastQuery instead of executedQuery, and this is the root of the
problem.
Here's a patch that fixes that, so the proper debugging string is
printed in all cases (not just in programinfo.cpp). You can decide if
you want the version #ifdef or not.
- Jeremiah
Index: mythcontext.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/mythcontext.cpp,v
retrieving revision 1.143
diff -u -r1.143 mythcontext.cpp
--- mythcontext.cpp 30 Dec 2004 16:17:22 -0000 1.143
+++ mythcontext.cpp 16 Jan 2005 02:44:31 -0000
@@ -1219,9 +1219,15 @@
cerr << "DB Error (" << where << "):" << endl;
}
+#if QT_VERSION >= 0x030200
+ cerr << "Query was:" << endl
+ << query.executedQuery() << endl
+ << DBErrorMessage(query.lastError()) << endl;
+#else
cerr << "Query was:" << endl
<< query.lastQuery() << endl
<< DBErrorMessage(query.lastError()) << endl;
+#endif
}
QString MythContext::DBErrorMessage(const QSqlError& err)
%
More information about the mythtv-dev
mailing list