mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-04 12:26:58 +03:00
Version filtering and general related code sanitization.
Version list dialog has alternating row background set. Nostalgia versions, based on OneSix.
This commit is contained in:
parent
e5dc113bfc
commit
7e78a422e8
24 changed files with 254 additions and 431 deletions
|
|
@ -21,20 +21,20 @@ InstVersionList::InstVersionList(QObject *parent) :
|
|||
{
|
||||
}
|
||||
|
||||
const InstVersion *InstVersionList::findVersion(const QString &descriptor)
|
||||
InstVersionPtr InstVersionList::findVersion( const QString& descriptor )
|
||||
{
|
||||
for (int i = 0; i < count(); i++)
|
||||
{
|
||||
if (at(i)->descriptor() == descriptor)
|
||||
if (at(i)->descriptor == descriptor)
|
||||
return at(i);
|
||||
}
|
||||
return NULL;
|
||||
return InstVersionPtr();
|
||||
}
|
||||
|
||||
const InstVersion *InstVersionList::getLatestStable() const
|
||||
InstVersionPtr InstVersionList::getLatestStable() const
|
||||
{
|
||||
if (count() <= 0)
|
||||
return NULL;
|
||||
return InstVersionPtr();
|
||||
else
|
||||
return at(0);
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ QVariant InstVersionList::data(const QModelIndex &index, int role) const
|
|||
return QVariant();
|
||||
|
||||
|
||||
const InstVersion *version = at(index.row());
|
||||
InstVersionPtr version = at(index.row());
|
||||
|
||||
switch (role)
|
||||
{
|
||||
|
|
@ -56,23 +56,23 @@ QVariant InstVersionList::data(const QModelIndex &index, int role) const
|
|||
switch (index.column())
|
||||
{
|
||||
case NameColumn:
|
||||
return version->name();
|
||||
return version->name;
|
||||
|
||||
case TypeColumn:
|
||||
return version->typeName();
|
||||
return version->typeString();
|
||||
|
||||
case TimeColumn:
|
||||
return version->timestamp();
|
||||
return version->timestamp;
|
||||
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
return version->descriptor();
|
||||
return version->descriptor;
|
||||
|
||||
case VersionPointerRole:
|
||||
return qVariantFromValue((void *) version);
|
||||
return qVariantFromValue(version);
|
||||
|
||||
default:
|
||||
return QVariant();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue