libdrmconf  0.10.4
A library to program DMR radios.
Classes | Public Slots | Signals | Public Member Functions | Protected Attributes | List of all members
TalkGroupDatabase Class Reference

Downloads, periodically updates and provides a list of talk group IDs and their names. More...

#include <talkgroupdatabase.hh>

Inheritance diagram for TalkGroupDatabase:
Inheritance graph
[legend]
Collaboration diagram for TalkGroupDatabase:
Collaboration graph
[legend]

Public Slots

void download ()
 Starts the download of the talk group database.
 

Signals

void loaded ()
 Gets emitted once the talk group database has been loaded.
 
void error (const QString &msg)
 Gets emitted if the loading of the talk group database fails.
 

Public Member Functions

 TalkGroupDatabase (unsigned updatePeriodDays=30, QObject *parent=nullptr)
 Constructs a talk group database. More...
 
qint64 count () const
 Returns the number of talk groups.
 
unsigned dbAge () const
 Returns the age of the database in days.
 
TalkGroup talkgroup (int index) const
 Returns the talk group entry at the given index.
 
bool load ()
 Loads all entries from the downloaded talk group db.
 
bool load (const QString &filename)
 Loads all entries from the talk group db at the specified location.
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 Implements the QAbstractTableModel interface, returns the number of rows (number of entries).
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 Implements the QAbstractTableModel interface, returns the number of columns.
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 Implements the QAbstractTableModel interface, return the entry data.
 

Protected Attributes

QVector< TalkGroup > _talkgroups
 Holds all talk groups as id->name table.
 
QNetworkAccessManager _network
 The network access used for downloading.
 

Detailed Description

Downloads, periodically updates and provides a list of talk group IDs and their names.

Constructor & Destructor Documentation

◆ TalkGroupDatabase()

TalkGroupDatabase::TalkGroupDatabase ( unsigned  updatePeriodDays = 30,
QObject *  parent = nullptr 
)

Constructs a talk group database.

Parameters
updatePeriodDaysSpecifies the update period of the DB in days.
parentSpecifies the QObject parent.

The documentation for this class was generated from the following files: