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

Manages and provides access to the data displayed in the file conflicts window. More...

#include <conflictsmodel.h>

Inheritance diagram for ConflictsModel:
Collaboration diagram for ConflictsModel:

Public Member Functions

 ConflictsModel (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 setConflicts (const std::vector< ConflictInfo > &newConflicts, int base_id)
 Updates the data in this model with the new conflicts.
 

Static Public Attributes

static constexpr int file_col = 0
 Index of the file path column.
 
static constexpr int winner_col = 1
 Index of the winning mod column.
 
static constexpr int order_col = 2
 Index of the overwrite order column.
 

Private Attributes

std::vector< ConflictInfoconflicts_
 For every conflict: File, winner name and winner id.
 
int base_id_
 Id of the mod for which the conflicts are displayed.
 

Detailed Description

Manages and provides access to the data displayed in the file conflicts window.

Constructor & Destructor Documentation

◆ ConflictsModel()

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

Constructor.

Parameters
parentParent for this model.

Member Function Documentation

◆ columnCount()

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

Returns the number of columns to display.

Parameters
parentParent index.
Returns
The number of columns.

◆ data()

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

Used to access the data stored in this model.

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

◆ headerData()

QVariant ConflictsModel::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 ConflictsModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
override

Returns the number of rows to display.

Parameters
parentParent index.
Returns
The number of rows.

◆ setConflicts()

void ConflictsModel::setConflicts ( const std::vector< ConflictInfo > & newConflicts,
int base_id )

Updates the data in this model with the new conflicts.

Parameters
newConflictsContains file, winner name and winner id for every conflict.
base_idId of the mod for which the conflicts are displayed.

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