fix instance IDs and resource pack imports

Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
This commit is contained in:
Ryan Cao 2022-11-19 23:59:30 +08:00
parent a33b804923
commit 1f6b8f9d2b
No known key found for this signature in database
3 changed files with 5 additions and 4 deletions

View File

@ -152,7 +152,7 @@ bool LocalResourcePackParseTask::abort()
void LocalResourcePackParseTask::executeTask()
{
Q_ASSERT(m_resource_pack.valid());
// Q_ASSERT(m_resource_pack.valid());
if (!ResourcePackUtils::process(m_resource_pack))
return;

View File

@ -143,7 +143,7 @@ bool LocalTexturePackParseTask::abort()
void LocalTexturePackParseTask::executeTask()
{
Q_ASSERT(m_texture_pack.valid());
// Q_ASSERT(m_texture_pack.valid());
if (!TexturePackUtils::process(m_texture_pack))
return;

View File

@ -7,6 +7,7 @@
#include "Application.h"
#include "InstanceList.h"
#include <InstanceList.h>
#include "ui/instanceview/InstanceDelegate.h"
ImportResourcePackDialog::ImportResourcePackDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ImportResourcePackDialog)
@ -40,7 +41,7 @@ ImportResourcePackDialog::ImportResourcePackDialog(QWidget* parent) : QDialog(pa
void ImportResourcePackDialog::activated(QModelIndex index)
{
selectedInstanceKey = index.data(Qt::UserRole).toString();
selectedInstanceKey = index.data(InstanceList::InstanceIDRole).toString();
accept();
}
@ -49,7 +50,7 @@ void ImportResourcePackDialog::selectionChanged(QItemSelection selected, QItemSe
if (selected.empty())
return;
QString key = selected.first().indexes().first().data(Qt::UserRole).toString();
QString key = selected.first().indexes().first().data(InstanceList::InstanceIDRole).toString();
if (!key.isEmpty()) {
selectedInstanceKey = key;
}