The default selected version is now the current stable version.

Resolves JIRA issue MMC-10:
	https://jira.forkk.net/browse/MMC-10
This commit is contained in:
Andrew 2013-05-06 21:08:31 -05:00
parent 7e3592bee8
commit fb0432bf0b
4 changed files with 15 additions and 2 deletions

View File

@ -98,7 +98,7 @@ public:
* This is the version that will be selected by default.
* By default, this is simply the first version in the list.
*/
virtual const InstVersion *getLatestStable();
virtual const InstVersion *getLatestStable() const;
/*!
* Sorts the version list.

View File

@ -47,6 +47,8 @@ public:
virtual void printToStdOut() const;
virtual void sort();
virtual InstVersion *getLatestStable() const;
/*!
* Gets the main version list instance.
*/

View File

@ -31,7 +31,7 @@ const InstVersion *InstVersionList::findVersion(const QString &descriptor)
return NULL;
}
const InstVersion *InstVersionList::getLatestStable()
const InstVersion *InstVersionList::getLatestStable() const
{
if (count() <= 0)
return NULL;

View File

@ -92,6 +92,17 @@ void MinecraftVersionList::sort()
endResetModel();
}
InstVersion *MinecraftVersionList::getLatestStable() const
{
for (int i = 0; i < m_vlist.length(); i++)
{
if (((MinecraftVersion *)m_vlist.at(i))->versionType() == MinecraftVersion::CurrentStable)
{
return m_vlist.at(i);
}
}
}
MinecraftVersionList &MinecraftVersionList::getMainList()
{
return mcVList;