KActivitiesStats 5.109.0
Signals | Public Member Functions | List of all members
KActivities::Stats::ResultWatcher

A very thin class that sends signals when new resources matching a predefined query are available. More...

#include <KActivities/Stats/ResultWatcher>

Signals

void resourceMimetypeChanged (const QString &resource, const QString &mimetype)
 Emitted when the mimetype of a resource has been changed.
 
void resourceTitleChanged (const QString &resource, const QString &title)
 Emitted when the title of a resource has been changed.
 
void resultLinked (const QString &resource)
 Emitted when a result has been linked to the activity.
 
void resultRemoved (const QString &resource)
 Emitted when a result has been added or updated.
 
void resultScoreUpdated (const QString &resource, double score, uint lastUpdate, uint firstUpdate)
 Emitted when a result has been added or updated.
 
void resultsInvalidated ()
 Emitted when the client should forget about all the results it knew about and reload them.
 
void resultUnlinked (const QString &resource)
 Emitted when a result has been linked to the activity.
 

Public Member Functions

 ResultWatcher (Query query, QObject *parent=nullptr)
 
void linkToActivity (const QUrl &resource, const Terms::Activity &activity=Terms::Activity(QStringList()), const Terms::Agent &agent=Terms::Agent(QStringList()))
 
void unlinkFromActivity (const QUrl &resource, const Terms::Activity &activity=Terms::Activity(QStringList()), const Terms::Agent &agent=Terms::Agent(QStringList()))
 

Detailed Description

A very thin class that sends signals when new resources matching a predefined query are available.

Member Function Documentation

◆ resourceMimetypeChanged

void KActivities::Stats::ResultWatcher::resourceMimetypeChanged ( const QString &  resource,
const QString &  mimetype 
)
signal

Emitted when the mimetype of a resource has been changed.

Parameters
resourceURL of the resource that has a new mimetype
mimetypenew mimetype of the resource
Note
This signal will be emitted even for the resources that do not match the specified query. This is because the class is lightweight, and it does not keep track of which resources match the query to be able to filter this signal.

◆ resourceTitleChanged

void KActivities::Stats::ResultWatcher::resourceTitleChanged ( const QString &  resource,
const QString &  title 
)
signal

Emitted when the title of a resource has been changed.

Parameters
resourceURL of the resource that has a new title
titlenew title of the resource
Note
This signal will be emitted even for the resources that do not match the specified query. This is because the class is lightweight, and it does not keep track of which resources match the query to be able to filter this signal.

◆ resultLinked

void KActivities::Stats::ResultWatcher::resultLinked ( const QString &  resource)
signal

Emitted when a result has been linked to the activity.

◆ resultRemoved

void KActivities::Stats::ResultWatcher::resultRemoved ( const QString &  resource)
signal

Emitted when a result has been added or updated.

This either means a new resource has appeared in the result set, or that a previously existing one has some of the attributes changed.

Parameters
resultnew data for the resource defined by result.resource

◆ resultScoreUpdated

void KActivities::Stats::ResultWatcher::resultScoreUpdated ( const QString &  resource,
double  score,
uint  lastUpdate,
uint  firstUpdate 
)
signal

Emitted when a result has been added or updated.

This either means a new resource has appeared in the result set, or that a previously existing one has some of the attributes changed.

Parameters
resultnew data for the resource defined by result.resource

◆ resultsInvalidated

void KActivities::Stats::ResultWatcher::resultsInvalidated ( )
signal

Emitted when the client should forget about all the results it knew about and reload them.

This can happen when the user clears the history, or when there are more significant changes to the data.

◆ resultUnlinked

void KActivities::Stats::ResultWatcher::resultUnlinked ( const QString &  resource)
signal

Emitted when a result has been linked to the activity.