Rabbit Remote Control 0.1.0-bate14
Loading...
Searching...
No Matches
CFavoriteModel Class Reference
Inheritance diagram for CFavoriteModel:
Collaboration diagram for CFavoriteModel:

Classes

struct  tree

Public Types

enum  RoleType { RoleFile = Qt::UserRole , RoleNodeType , RoleItem }

Public Member Functions

 CFavoriteModel (CFavoriteDatabase *pDatabase, QObject *parent=nullptr)
bool AddNode (const QString &szName, int parentId)
bool AddFavorite (const QString &szFile, const QString &szName, const QIcon &icon, const QString szDescription, int parentId=0)
bool UpdateFavorite (const QString &szFile, const QString &szName=QString(), const QString &szDescription=QString(), const QIcon &icon=QIcon())
CFavoriteDatabase::Item GetFavorite (const QString &szFile)
void Refresh ()
bool Move (QModelIndex index, QModelIndex parentIndex)
bool Copy (QModelIndex index, QModelIndex parentIndex)
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
QModelIndex parent (const QModelIndex &index) const override
int rowCount (const QModelIndex &parent=QModelIndex()) const override
int columnCount (const QModelIndex &parent=QModelIndex()) const override
bool canFetchMore (const QModelIndex &parent) const override
void fetchMore (const QModelIndex &parent) override
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Qt::ItemFlags flags (const QModelIndex &index) const override
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override

Private Member Functions

treeGetTree (int id) const
treeGetTree (QModelIndex index) const
QModelIndex CreateIndex (tree *t) const
void ClearTree (tree *node)
bool AddTree (const CFavoriteDatabase::Item &item, int parentId)
bool UpdateTree (const QString &szFile)
bool MoveTree (const CFavoriteDatabase::Item &item, int newParentId)

Private Attributes

CFavoriteDatabasem_pDatabase
treem_pRoot
QMap< int, tree * > m_Folders

Detailed Description

Definition at line 9 of file FavoriteModel.h.

Member Enumeration Documentation

◆ RoleType

enum CFavoriteModel::RoleType

Definition at line 31 of file FavoriteModel.h.

Constructor & Destructor Documentation

◆ ~CFavoriteModel()

CFavoriteModel::~CFavoriteModel ( )

Definition at line 22 of file FavoriteModel.cpp.

Member Function Documentation

◆ AddFavorite()

bool CFavoriteModel::AddFavorite ( const QString & szFile,
const QString & szName,
const QIcon & icon,
const QString szDescription,
int parentId = 0 )

Definition at line 229 of file FavoriteModel.cpp.

◆ AddNode()

bool CFavoriteModel::AddNode ( const QString & szName,
int parentId )

Definition at line 342 of file FavoriteModel.cpp.

◆ AddTree()

bool CFavoriteModel::AddTree ( const CFavoriteDatabase::Item & item,
int parentId )
private

Definition at line 413 of file FavoriteModel.cpp.

◆ canFetchMore()

bool CFavoriteModel::canFetchMore ( const QModelIndex & parent) const
override

Definition at line 90 of file FavoriteModel.cpp.

◆ ClearTree()

void CFavoriteModel::ClearTree ( tree * node)
private

Definition at line 367 of file FavoriteModel.cpp.

◆ columnCount()

int CFavoriteModel::columnCount ( const QModelIndex & parent = QModelIndex()) const
override

Definition at line 85 of file FavoriteModel.cpp.

◆ Copy()

bool CFavoriteModel::Copy ( QModelIndex index,
QModelIndex parentIndex )

Definition at line 301 of file FavoriteModel.cpp.

◆ CreateIndex()

QModelIndex CFavoriteModel::CreateIndex ( tree * t) const
private

Definition at line 397 of file FavoriteModel.cpp.

◆ data()

QVariant CFavoriteModel::data ( const QModelIndex & index,
int role = Qt::DisplayRole ) const
override

Definition at line 148 of file FavoriteModel.cpp.

◆ fetchMore()

void CFavoriteModel::fetchMore ( const QModelIndex & parent)
override

Definition at line 111 of file FavoriteModel.cpp.

◆ flags()

Qt::ItemFlags CFavoriteModel::flags ( const QModelIndex & index) const
override

Definition at line 197 of file FavoriteModel.cpp.

◆ GetFavorite()

CFavoriteDatabase::Item CFavoriteModel::GetFavorite ( const QString & szFile)

Definition at line 323 of file FavoriteModel.cpp.

◆ GetTree() [1/2]

CFavoriteModel::tree * CFavoriteModel::GetTree ( int id) const
private

Definition at line 379 of file FavoriteModel.cpp.

◆ GetTree() [2/2]

CFavoriteModel::tree * CFavoriteModel::GetTree ( QModelIndex index) const
private

Definition at line 387 of file FavoriteModel.cpp.

◆ index()

QModelIndex CFavoriteModel::index ( int row,
int column,
const QModelIndex & parent = QModelIndex() ) const
override

Definition at line 30 of file FavoriteModel.cpp.

◆ Move()

bool CFavoriteModel::Move ( QModelIndex index,
QModelIndex parentIndex )

Definition at line 272 of file FavoriteModel.cpp.

◆ MoveTree()

bool CFavoriteModel::MoveTree ( const CFavoriteDatabase::Item & item,
int newParentId )
private

Definition at line 468 of file FavoriteModel.cpp.

◆ parent()

QModelIndex CFavoriteModel::parent ( const QModelIndex & index) const
override

Definition at line 51 of file FavoriteModel.cpp.

◆ Refresh()

void CFavoriteModel::Refresh ( )

Definition at line 334 of file FavoriteModel.cpp.

◆ removeRows()

bool CFavoriteModel::removeRows ( int row,
int count,
const QModelIndex & parent = QModelIndex() )
override

Definition at line 205 of file FavoriteModel.cpp.

◆ rowCount()

int CFavoriteModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
override

Definition at line 66 of file FavoriteModel.cpp.

◆ setData()

bool CFavoriteModel::setData ( const QModelIndex & index,
const QVariant & value,
int role = Qt::EditRole )
override

Definition at line 177 of file FavoriteModel.cpp.

◆ UpdateFavorite()

bool CFavoriteModel::UpdateFavorite ( const QString & szFile,
const QString & szName = QString(),
const QString & szDescription = QString(),
const QIcon & icon = QIcon() )

Definition at line 262 of file FavoriteModel.cpp.

◆ UpdateTree()

bool CFavoriteModel::UpdateTree ( const QString & szFile)
private

Definition at line 448 of file FavoriteModel.cpp.

Member Data Documentation

◆ m_Folders

QMap<int, tree*> CFavoriteModel::m_Folders
private

Definition at line 89 of file FavoriteModel.h.

◆ m_pDatabase

CFavoriteDatabase* CFavoriteModel::m_pDatabase
private

Definition at line 59 of file FavoriteModel.h.

◆ m_pRoot

tree* CFavoriteModel::m_pRoot
private

Definition at line 87 of file FavoriteModel.h.


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