D14513: Created QML Extensions API & Moved plugins info to SQL
Anmol Gautam
noreply at phabricator.kde.org
Wed Aug 8 08:35:39 BST 2018
anmolgautam added inline comments.
INLINE COMMENTS
> drosca wrote in history.h:72
> There is already `indexesFromTimeRange` that you can use instead of adding new method. Also, timestamp is integer and not double.
Do you want it like this -
void QmlHistory::deleteRange(const QVariantMap &map)
{
if (!map.contains(QSL("startTime")) || !map.contains(QSL("endTime"))) {
qWarning() << "Error:" << "wrong arguments passed to" << __FUNCTION__;
return;
}
const qlonglong startTime = map.value(QSL("startTime")).toLongLong();
const qlonglong endTime = map.value(QSL("endTime")).toLongLong();
QSqlQuery query(SqlDatabase::instance()->database());
query.prepare(QSL("DELETE FROM history WHERE date BETWEEN ? AND ?"));
query.bindValue(0, startTime);
query.bindValue(1, endTime);
query.exec();
}
Here deleteRange is removed from history.h. Also if `indexFromTimeRange` is used then it wil have to execute query twice (once to get the list of ids to remove and other to remove the ids)
REPOSITORY
R875 Falkon
REVISION DETAIL
https://phabricator.kde.org/D14513
To: anmolgautam, drosca
Cc: falkon, herrold, anmolgautam, SGOrava, iodelay, spoorun, ptabis, navarromorales, cochise, clivej, ach
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/falkon/attachments/20180808/713fc827/attachment.html>
More information about the Falkon
mailing list