LCOV - code coverage report
Current view: top level - src/operations - UpdateTitleOperation.cpp (source / functions) Coverage Total Hit
Test: coverage.info.cleaned Lines: 85.7 % 14 12
Test Date: 2026-04-19 00:35:54 Functions: 100.0 % 2 2

            Line data    Source code
       1              : #include "UpdateTitleOperation.h"
       2              : #include "../models/AllNewsFeedItem.h"
       3              : #include <QDebug>
       4              : 
       5            2 : UpdateTitleOperation::UpdateTitleOperation(OperationManager *parent, FeedItem* feed) :
       6              :     DBOperation(parent),
       7            2 :     feed(feed)
       8              : {
       9            2 : }
      10              : 
      11            2 : void UpdateTitleOperation::execute()
      12              : {
      13            2 :     if (feed->metaObject() == &AllNewsFeedItem::staticMetaObject) {
      14              :         // Nope.
      15              :         
      16            1 :         return;
      17              :     }
      18              :     
      19            1 :     QSqlQuery query(db());
      20            1 :     query.prepare("UPDATE FeedItemTable SET title = :title WHERE id = :feed_id");
      21            1 :     query.bindValue(":title", feed->getTitle());
      22            1 :     query.bindValue(":feed_id", feed->getDbID());
      23              :     
      24            1 :     if (!query.exec()) {
      25            0 :         reportSQLError(query, "Unable to set title.");
      26              :         
      27            0 :         return;
      28              :     }
      29            1 : }
        

Generated by: LCOV version 2.0-1