Qt: Fix possible assertion failure when removing search directories
This commit is contained in:
parent
bd25aa2f9d
commit
ed0abf3912
|
@ -38,8 +38,7 @@ public:
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameListModel(GameList* game_list, QObject* parent = nullptr)
|
GameListModel(GameList* game_list, QObject* parent = nullptr) : QAbstractTableModel(parent), m_game_list(game_list)
|
||||||
: QAbstractTableModel(parent), m_game_list(game_list), m_size(static_cast<int>(m_game_list->GetEntryCount()))
|
|
||||||
{
|
{
|
||||||
loadCommonImages();
|
loadCommonImages();
|
||||||
}
|
}
|
||||||
|
@ -178,15 +177,8 @@ public:
|
||||||
|
|
||||||
void refresh()
|
void refresh()
|
||||||
{
|
{
|
||||||
if (m_size > 0)
|
beginResetModel();
|
||||||
{
|
endResetModel();
|
||||||
beginRemoveRows(QModelIndex(), 0, m_size - 1);
|
|
||||||
endRemoveRows();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_size = static_cast<int>(m_game_list->GetEntryCount());
|
|
||||||
beginInsertRows(QModelIndex(), 0, m_size - 1);
|
|
||||||
endInsertRows();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool titlesLessThan(int left_row, int right_row, bool ascending) const
|
bool titlesLessThan(int left_row, int right_row, bool ascending) const
|
||||||
|
@ -215,7 +207,6 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
GameList* m_game_list;
|
GameList* m_game_list;
|
||||||
int m_size;
|
|
||||||
|
|
||||||
QPixmap m_type_disc_pixmap;
|
QPixmap m_type_disc_pixmap;
|
||||||
QPixmap m_type_exe_pixmap;
|
QPixmap m_type_exe_pixmap;
|
||||||
|
|
Loading…
Reference in New Issue