refactor: adapt rest of the codebase to the new resource model
In order to access the ModFolderModel from the ModFolderPage, i created a new m_model for the correct type, shadowing the m_model of type ResourceFolderModel. This creates two shared_ptr references to the same object, but since they will have the same lifetime, it doesn't generate a memory leak. Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
@ -35,24 +35,4 @@
|
||||
|
||||
#include "TexturePackFolderModel.h"
|
||||
|
||||
TexturePackFolderModel::TexturePackFolderModel(const QString &dir) : ModFolderModel(dir) {
|
||||
}
|
||||
|
||||
QVariant TexturePackFolderModel::headerData(int section, Qt::Orientation orientation, int role) const {
|
||||
if (role == Qt::ToolTipRole) {
|
||||
switch (section) {
|
||||
case ActiveColumn:
|
||||
return tr("Is the texture pack enabled?");
|
||||
case NameColumn:
|
||||
return tr("The name of the texture pack.");
|
||||
case VersionColumn:
|
||||
return tr("The version of the texture pack.");
|
||||
case DateColumn:
|
||||
return tr("The date and time this texture pack was last changed (or added).");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
return ModFolderModel::headerData(section, orientation, role);
|
||||
}
|
||||
TexturePackFolderModel::TexturePackFolderModel(const QString &dir) : ResourceFolderModel(QDir(dir)) {}
|
||||
|
Reference in New Issue
Block a user