refactor: make Resource Pack model inherit from ResourceFolderModel

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-08-10 14:46:28 -03:00
parent 1e2f0ab308
commit 256f8094f5
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469
2 changed files with 3 additions and 25 deletions

View File

@ -35,24 +35,5 @@
#include "ResourcePackFolderModel.h"
ResourcePackFolderModel::ResourcePackFolderModel(const QString &dir) : ModFolderModel(dir) {
}
QVariant ResourcePackFolderModel::headerData(int section, Qt::Orientation orientation, int role) const {
if (role == Qt::ToolTipRole) {
switch (section) {
case ActiveColumn:
return tr("Is the resource pack enabled?");
case NameColumn:
return tr("The name of the resource pack.");
case VersionColumn:
return tr("The version of the resource pack.");
case DateColumn:
return tr("The date and time this resource pack was last changed (or added).");
default:
return QVariant();
}
}
return ModFolderModel::headerData(section, orientation, role);
ResourcePackFolderModel::ResourcePackFolderModel(const QString &dir) : ResourceFolderModel(dir) {
}

View File

@ -1,13 +1,10 @@
#pragma once
#include "ModFolderModel.h"
#include "ResourceFolderModel.h"
class ResourcePackFolderModel : public ModFolderModel
class ResourcePackFolderModel : public ResourceFolderModel
{
Q_OBJECT
public:
explicit ResourcePackFolderModel(const QString &dir);
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
};