refactor: make Resource Pack model inherit from ResourceFolderModel
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
1e2f0ab308
commit
256f8094f5
@ -35,24 +35,5 @@
|
|||||||
|
|
||||||
#include "ResourcePackFolderModel.h"
|
#include "ResourcePackFolderModel.h"
|
||||||
|
|
||||||
ResourcePackFolderModel::ResourcePackFolderModel(const QString &dir) : ModFolderModel(dir) {
|
ResourcePackFolderModel::ResourcePackFolderModel(const QString &dir) : ResourceFolderModel(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);
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ModFolderModel.h"
|
#include "ResourceFolderModel.h"
|
||||||
|
|
||||||
class ResourcePackFolderModel : public ModFolderModel
|
class ResourcePackFolderModel : public ResourceFolderModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ResourcePackFolderModel(const QString &dir);
|
explicit ResourcePackFolderModel(const QString &dir);
|
||||||
|
|
||||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user