Limo
A simple mod manager
Loading...
Searching...
No Matches
DeployerListModel Class Reference

Manages and provides access to the data displayed in the deployer list. More...

#include <deployerlistmodel.h>

Inheritance diagram for DeployerListModel:
Collaboration diagram for DeployerListModel:

Public Member Functions

 DeployerListModel (QObject *parent=nullptr)
 Constructor.
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 Returns the horizontal header section names and vertical header section indices.
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Returns the number of rows to display.
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Returns the number of columns to display.
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 Used to access the data stored in this model.
 
void setDeployerInfo (const DeployerInfo &info)
 Updates all data stored in this model with the given data.
 
bool hasSeparateDirs () const
 Only for ReverseDeployers: Whether or not profiles use separate directories.
 
bool hasIgnoredFiles () const
 Only for ReverseDeployers: Whether or not the deployer's ignore list contains files.
 

Static Public Attributes

static constexpr int status_col = 0
 Index of the mod status column.
 
static constexpr int name_col = 1
 Index of the mod name column.
 
static constexpr int id_col = 2
 Index of the mod id column.
 
static constexpr int tags_col = 3
 Index of the tags column.
 
static constexpr int mod_status_role = 300
 Role representing the activation status of a mod.
 
static constexpr int mod_tags_role = 301
 Role representing all tags added to a mod.
 
static constexpr int ids_are_source_references_role = 302
 Rile representing whether ids are references to source mods.
 
static constexpr int source_mod_name_role = 303
 Role representing the name of the source mod.
 
static constexpr int valid_mod_actions_role = 304
 Role representing a list of valid mod actions.
 

Private Attributes

DeployerInfo deployer_info_
 Contains all mods managed by this model.
 
std::map< int, QBrush > text_colors_
 Maps mod ids to the color used to display their names.
 
std::vector< std::vector< std::string > > tags_
 For every mod: A vector containing every tag added to that mod.
 

Detailed Description

Manages and provides access to the data displayed in the deployer list.

Constructor & Destructor Documentation

◆ DeployerListModel()

DeployerListModel::DeployerListModel ( QObject * parent = nullptr)
explicit

Constructor.

Parameters
parentParent for this model.

Member Function Documentation

◆ columnCount()

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

Returns the number of columns to display.

Parameters
parentParent index.
Returns
The number of columns.

◆ data()

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

Used to access the data stored in this model.

Returns data depending of the given role and index. Qt standard roles are used to provide data displayed in views. Custom roles defined in this file and in the ModListModel header provide access to the raw data.

Parameters
indexHolds row and column for which to return data.
roleDescribes type of data to return.
Returns
The requested data.

◆ hasIgnoredFiles()

bool DeployerListModel::hasIgnoredFiles ( ) const

Only for ReverseDeployers: Whether or not the deployer's ignore list contains files.

Returns
True if at least one file is ignored.

◆ hasSeparateDirs()

bool DeployerListModel::hasSeparateDirs ( ) const

Only for ReverseDeployers: Whether or not profiles use separate directories.

Returns
True if separate directories are used.

◆ headerData()

QVariant DeployerListModel::headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const
override

Returns the horizontal header section names and vertical header section indices.

Parameters
sectionTarget section.
orientationHeader orientation.
roleData role.
Returns
Name of the section.

◆ rowCount()

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

Returns the number of rows to display.

Parameters
parentParent index.
Returns
The number of rows.

◆ setDeployerInfo()

void DeployerListModel::setDeployerInfo ( const DeployerInfo & info)

Updates all data stored in this model with the given data.

Parameters
modsData for all mods managed by this model.

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