mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-03 08:15:37 +00:00
Cleanup ComputerModel and remove root Frame from PcView
This commit is contained in:
parent
b0151da455
commit
f83c13ad85
@ -5,9 +5,6 @@ import QtQuick.Layouts 1.11
|
|||||||
|
|
||||||
import ComputerModel 1.0
|
import ComputerModel 1.0
|
||||||
|
|
||||||
Frame {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
GridView {
|
GridView {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: 5
|
anchors.leftMargin: 5
|
||||||
@ -102,7 +99,6 @@ Frame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MessageDialog {
|
MessageDialog {
|
||||||
id: pairDialog
|
id: pairDialog
|
||||||
|
@ -27,10 +27,8 @@ QVariant ComputerModel::data(const QModelIndex& index, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (index.row() > m_Computers.count()) {
|
|
||||||
qWarning() << "Index out of bounds: " << index.row();
|
Q_ASSERT(index.row() < m_Computers.count());
|
||||||
return QVariant();
|
|
||||||
}
|
|
||||||
|
|
||||||
NvComputer* computer = m_Computers[index.row()];
|
NvComputer* computer = m_Computers[index.row()];
|
||||||
QReadLocker lock(&computer->lock);
|
QReadLocker lock(&computer->lock);
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
class ComputerModel : public QAbstractListModel
|
class ComputerModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
enum Roles
|
enum Roles
|
||||||
{
|
{
|
||||||
NameRole = Qt::UserRole,
|
NameRole = Qt::UserRole,
|
||||||
@ -14,7 +16,7 @@ class ComputerModel : public QAbstractListModel
|
|||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ComputerModel(QObject* object = nullptr);
|
explicit ComputerModel(QObject* object = nullptr);
|
||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const override;
|
QVariant data(const QModelIndex &index, int role) const override;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user