D14513: Add QML Extensions API

David Rosca noreply at phabricator.kde.org
Wed Aug 8 10:51:23 BST 2018


drosca added inline comments.

INLINE COMMENTS

> anmolgautam wrote in history.h:72
> 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)

> Also if indexFromTimeRange is used then it wil have to execute query twice

That's fine, this won't be called often.

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/d3d176e9/attachment.html>


More information about the Falkon mailing list