mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-04 20:36:58 +03:00
Use shared pointers to fix incompatibility with new Qt
This commit is contained in:
parent
3b38e5f924
commit
929698ff15
4 changed files with 46 additions and 36 deletions
|
|
@ -45,15 +45,15 @@ QVariant LWJGLVersionList::data(const QModelIndex &index, int role) const
|
|||
if (index.row() > count())
|
||||
return QVariant();
|
||||
|
||||
const LWJGLVersion &version = at(index.row());
|
||||
const PtrLWJGLVersion version = at(index.row());
|
||||
|
||||
switch (role)
|
||||
{
|
||||
case Qt::DisplayRole:
|
||||
return version.name();
|
||||
return version->name();
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
return version.url().toString();
|
||||
return version->url().toString();
|
||||
|
||||
default:
|
||||
return QVariant();
|
||||
|
|
@ -125,7 +125,7 @@ void LWJGLVersionList::netRequestComplete()
|
|||
|
||||
QDomNodeList items = doc.elementsByTagName("item");
|
||||
|
||||
QList<LWJGLVersion> tempList;
|
||||
QList<PtrLWJGLVersion> tempList;
|
||||
|
||||
for (int i = 0; i < items.length(); i++)
|
||||
{
|
||||
|
|
@ -155,7 +155,7 @@ void LWJGLVersionList::netRequestComplete()
|
|||
continue;
|
||||
}
|
||||
|
||||
tempList.append(LWJGLVersion(name, link));
|
||||
tempList.append(LWJGLVersion::Create(name, link));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -175,14 +175,14 @@ void LWJGLVersionList::netRequestComplete()
|
|||
reply->deleteLater();
|
||||
}
|
||||
|
||||
const LWJGLVersion *LWJGLVersionList::getVersion(const QString &versionName)
|
||||
const PtrLWJGLVersion LWJGLVersionList::getVersion(const QString &versionName)
|
||||
{
|
||||
for (int i = 0; i < count(); i++)
|
||||
{
|
||||
if (at(i).name() == versionName)
|
||||
return &at(i);
|
||||
if (at(i)->name() == versionName)
|
||||
return at(i);
|
||||
}
|
||||
return NULL;
|
||||
return PtrLWJGLVersion();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue