From: APTX Date: Tue, 12 Feb 2013 18:45:32 +0000 (+0100) Subject: Workaround for QTBUG-29662. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=4fd934b8ce218e0cb65f2474238d98ffe4c2095b;p=localmylist.git Workaround for QTBUG-29662. --- diff --git a/localmylist/database.cpp b/localmylist/database.cpp index 60a7346..4c438dc 100644 --- a/localmylist/database.cpp +++ b/localmylist/database.cpp @@ -405,7 +405,7 @@ int Database::isKnownFile(const QByteArray &ed2k, qint64 size) { QSqlQuery &q = prepare("SELECT fid FROM file WHERE ed2k = :ed2k AND size = :size"); - q.bindValue(":ed2k", ed2k); + q.bindValue(":ed2k", ed2k.constData()); q.bindValue(":size", size); if (!exec(q)) @@ -760,7 +760,7 @@ bool Database::setFile(const File &file) q.bindValue(":anidbUpdate", file.anidbUpdate); q.bindValue(":entryUpdate", file.entryUpdate); q.bindValue(":myUpdate", file.myUpdate); - q.bindValue(":ed2k", file.ed2k); + q.bindValue(":ed2k", file.ed2k.constData()); q.bindValue(":size", file.size); q.bindValue(":length", file.length); q.bindValue(":extension", file.extension); @@ -882,7 +882,7 @@ bool Database::addFile(const File &file) q.bindValue(":anidbUpdate", file.anidbUpdate); q.bindValue(":entryUpdate", file.entryUpdate); q.bindValue(":myUpdate", file.myUpdate); - q.bindValue(":ed2k", file.ed2k); + q.bindValue(":ed2k", file.ed2k.constData()); q.bindValue(":size", file.size); q.bindValue(":length", file.length); q.bindValue(":extension", file.extension); @@ -929,7 +929,7 @@ bool Database::addUnknownFile(const UnknownFile &file) { QSqlQuery &q = prepare("INSERT INTO unknown_file VALUES(:ed2k, :size, :hostId, :path)"); - q.bindValue(":ed2k", file.ed2k); + q.bindValue(":ed2k", file.ed2k.constData()); q.bindValue(":size", file.size); q.bindValue(":hostId", file.hostId); q.bindValue(":path", file.path); @@ -947,7 +947,7 @@ UnknownFile Database::getUnknownFile(const QByteArray &ed2k, qint64 size) " WHERE ed2k = :ed2k " " AND size = :size "); - q.bindValue(":ed2k", ed2k); + q.bindValue(":ed2k", ed2k.constData()); q.bindValue(":size", size); if (!exec(q)) @@ -990,7 +990,7 @@ bool Database::removeUnknownFile(const QByteArray &ed2k, qint64 size) " WHERE ed2k = :ed2k " " AND size = :size "); - q.bindValue(":ed2k", ed2k); + q.bindValue(":ed2k", ed2k.constData()); q.bindValue(":size", size); return exec(q); @@ -1005,7 +1005,7 @@ bool Database::addRequest(const PendingRequest &request) q.bindValue(":aid", request.aid); q.bindValue(":eid", request.eid); q.bindValue(":fid", request.fid); - q.bindValue(":ed2k", request.ed2k.isNull() ? QByteArray("") : request.ed2k); + q.bindValue(":ed2k", (request.ed2k.isNull() ? QByteArray("") : request.ed2k).constData()); q.bindValue(":size", request.size); return exec(q); @@ -1058,7 +1058,7 @@ bool Database::clearRequest(const PendingRequest &request) q.bindValue(":aid", request.aid); q.bindValue(":eid", request.eid); q.bindValue(":fid", request.fid); - q.bindValue(":ed2k", request.ed2k.isNull() ? QByteArray("") : request.ed2k); + q.bindValue(":ed2k", (request.ed2k.isNull() ? QByteArray("") : request.ed2k).constData()); q.bindValue(":size", request.size); bool ret = exec(q);