Removed old plugin system and implemented some version list stuff.
This commit is contained in:
parent
1626fa013c
commit
055198303c
20 changed files with 1064 additions and 279 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "overridesetting.h"
|
||||
|
||||
#include "pathutils.h"
|
||||
#include <minecraftversionlist.h>
|
||||
|
||||
Instance::Instance(const QString &rootDir, QObject *parent) :
|
||||
QObject(parent)
|
||||
|
@ -151,6 +152,39 @@ QString Instance::modListFile() const
|
|||
return PathCombine(rootDir(), "modlist");
|
||||
}
|
||||
|
||||
InstVersionList *Instance::versionList() const
|
||||
{
|
||||
return &MinecraftVersionList::getMainList();
|
||||
}
|
||||
|
||||
bool Instance::shouldUpdateCurrentVersion()
|
||||
{
|
||||
QFileInfo jar(mcJar());
|
||||
return jar.lastModified().toUTC().toMSecsSinceEpoch() != lastCurrentVersionUpdate();
|
||||
}
|
||||
|
||||
void Instance::updateCurrentVersion(bool keepCurrent)
|
||||
{
|
||||
QFileInfo jar(mcJar());
|
||||
|
||||
if(!jar.exists())
|
||||
{
|
||||
setLastCurrentVersionUpdate(0);
|
||||
setCurrentVersion("Unknown");
|
||||
return;
|
||||
}
|
||||
|
||||
qint64 time = jar.lastModified().toUTC().toMSecsSinceEpoch();
|
||||
|
||||
setLastCurrentVersionUpdate(time);
|
||||
if (!keepCurrent)
|
||||
{
|
||||
// TODO: Implement GetMinecraftJarVersion function.
|
||||
QString newVersion = "Unknown";//javautils::GetMinecraftJarVersion(jar.absoluteFilePath());
|
||||
setCurrentVersion(newVersion);
|
||||
}
|
||||
}
|
||||
|
||||
SettingsObject &Instance::settings() const
|
||||
{
|
||||
return *m_settings;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue