libosmscout  0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
osmscout::InstalledMapsModel Class Reference

Model providing access to currently installed maps on device. More...

#include <InstalledMapsModel.h>

+ Inheritance diagram for osmscout::InstalledMapsModel:

Public Types

enum  Roles {
  NameRole = Qt::UserRole, PathRole = Qt::UserRole + 1, DirectoryRole = Qt::UserRole + 2, TimeRole = Qt::UserRole + 3,
  ByteSizeRole = Qt::UserRole + 4, SizeRole = Qt::UserRole + 5, VersionRole = Qt::UserRole + 6
}
 

Public Slots

void onDatabaseListChanged ()
 

Signals

void databaseListChanged (QList< QDir > databaseDirectories)
 

Public Member Functions

Q_INVOKABLE QVariant data (const QModelIndex &index, int role) const override
 
Q_INVOKABLE bool deleteMap (int row)
 Delete installed map represented this model on given row. More...
 
Q_INVOKABLE Qt::ItemFlags flags (const QModelIndex &index) const override
 
 InstalledMapsModel ()
 
Q_INVOKABLE bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
 
QHash< int, QByteArray > roleNames () const override
 
Q_INVOKABLE int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
Q_INVOKABLE QVariant timeOfMap (const QStringList &path)
 Generation time of map with given path. More...
 
virtual ~InstalledMapsModel ()
 

Detailed Description

Model providing access to currently installed maps on device.

Member Enumeration Documentation

◆ Roles

Enumerator
NameRole 
PathRole 
DirectoryRole 
TimeRole 
ByteSizeRole 
SizeRole 
VersionRole 

Constructor & Destructor Documentation

◆ InstalledMapsModel()

◆ ~InstalledMapsModel()

osmscout::InstalledMapsModel::~InstalledMapsModel ( )
virtual

Member Function Documentation

◆ data()

QVariant osmscout::InstalledMapsModel::data ( const QModelIndex &  index,
int  role 
) const
override

◆ databaseListChanged

void osmscout::InstalledMapsModel::databaseListChanged ( QList< QDir >  databaseDirectories)
signal

Referenced by InstalledMapsModel().

◆ deleteMap()

bool osmscout::InstalledMapsModel::deleteMap ( int  row)

Delete installed map represented this model on given row.

Parameters
row
Returns
true on success

References removeRows().

◆ flags()

Qt::ItemFlags osmscout::InstalledMapsModel::flags ( const QModelIndex &  index) const
override

◆ onDatabaseListChanged

void osmscout::InstalledMapsModel::onDatabaseListChanged ( )
slot

Referenced by InstalledMapsModel().

◆ removeRows()

Q_INVOKABLE bool osmscout::InstalledMapsModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

Referenced by deleteMap().

◆ roleNames()

QHash< int, QByteArray > osmscout::InstalledMapsModel::roleNames ( ) const
override

◆ rowCount()

int osmscout::InstalledMapsModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ timeOfMap()

QVariant osmscout::InstalledMapsModel::timeOfMap ( const QStringList &  path)

Generation time of map with given path.

Null if don't exists It may be used for detection if there is some update available.

Parameters
path
Returns

References osmscout::StringVectorToQStringList(), and osmscout::TimestampToQDateTime().


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