7
7
#include < qdatetime.h>
8
8
#include < qdebug.h>
9
9
#include < qlist.h>
10
+ #include < qloggingcategory.h>
10
11
#include < qsqlerror.h>
11
12
#include < qsqlfield.h>
12
13
#include < qsqlindex.h>
@@ -38,6 +39,8 @@ Q_DECLARE_METATYPE(sqlite3_stmt*)
38
39
39
40
QT_BEGIN_NAMESPACE
40
41
42
+ static Q_LOGGING_CATEGORY(lcSqlite, " qt.sql.sqlite" )
43
+
41
44
using namespace Qt::StringLiterals;
42
45
43
46
static int qGetColumnType (const QString &tpName)
@@ -247,7 +250,6 @@ void QSQLiteResultPrivate::initColumns(bool emptyResultset)
247
250
}
248
251
249
252
QSqlField fld (colName, QMetaType (fieldType), tableName);
250
- fld.setSqlType (stp);
251
253
rInf.append (fld);
252
254
}
253
255
}
@@ -804,7 +806,7 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
804
806
}
805
807
#endif
806
808
else
807
- qWarning ( " Unsupported option '%ls'" , qUtf16Printable (option.toString ()));
809
+ qCWarning (lcSqlite, " Unsupported option '%ls'" , qUtf16Printable (option.toString ()));
808
810
}
809
811
810
812
int openMode = (openReadOnlyOption ? SQLITE_OPEN_READONLY : (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE));
@@ -815,7 +817,7 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
815
817
#if defined(SQLITE_OPEN_NOFOLLOW)
816
818
openMode |= SQLITE_OPEN_NOFOLLOW;
817
819
#else
818
- qWarning ( " SQLITE_OPEN_NOFOLLOW not supported with the SQLite version %s" , sqlite3_libversion ());
820
+ qCWarning (lcSqlite, " SQLITE_OPEN_NOFOLLOW not supported with the SQLite version %s" , sqlite3_libversion ());
819
821
#endif
820
822
}
821
823
@@ -1056,12 +1058,13 @@ bool QSQLiteDriver::subscribeToNotification(const QString &name)
1056
1058
{
1057
1059
Q_D (QSQLiteDriver);
1058
1060
if (!isOpen ()) {
1059
- qWarning ( " Database not open." );
1061
+ qCWarning (lcSqlite, " QSQLiteDriver::subscribeToNotification: Database not open." );
1060
1062
return false ;
1061
1063
}
1062
1064
1063
1065
if (d->notificationid .contains (name)) {
1064
- qWarning (" Already subscribing to '%ls'." , qUtf16Printable (name));
1066
+ qCWarning (lcSqlite, " QSQLiteDriver::subscribeToNotification: Already subscribing to '%ls'." ,
1067
+ qUtf16Printable (name));
1065
1068
return false ;
1066
1069
}
1067
1070
@@ -1077,12 +1080,13 @@ bool QSQLiteDriver::unsubscribeFromNotification(const QString &name)
1077
1080
{
1078
1081
Q_D (QSQLiteDriver);
1079
1082
if (!isOpen ()) {
1080
- qWarning ( " Database not open." );
1083
+ qCWarning (lcSqlite, " QSQLiteDriver::unsubscribeFromNotification: Database not open." );
1081
1084
return false ;
1082
1085
}
1083
1086
1084
1087
if (!d->notificationid .contains (name)) {
1085
- qWarning (" Not subscribed to '%ls'." , qUtf16Printable (name));
1088
+ qCWarning (lcSqlite, " QSQLiteDriver::unsubscribeFromNotification: Not subscribed to '%ls'." ,
1089
+ qUtf16Printable (name));
1086
1090
return false ;
1087
1091
}
1088
1092
0 commit comments