summaryrefslogtreecommitdiffstats
path: root/plugins/stdinstance
diff options
context:
space:
mode:
authorAndrew <forkk@forkk.net>2013-03-28 11:33:31 -0500
committerAndrew <forkk@forkk.net>2013-03-28 11:33:31 -0500
commit168ed3e8e58a8e5065ffa720f8d45f4cee0f2069 (patch)
treeb673669632797eab3fdf5bbf4e9fa471bcf20290 /plugins/stdinstance
parentad70e3fd4cda26508f00e9b549c04a5fe8831dac (diff)
downloadMultiMC-168ed3e8e58a8e5065ffa720f8d45f4cee0f2069.tar
MultiMC-168ed3e8e58a8e5065ffa720f8d45f4cee0f2069.tar.gz
MultiMC-168ed3e8e58a8e5065ffa720f8d45f4cee0f2069.tar.lz
MultiMC-168ed3e8e58a8e5065ffa720f8d45f4cee0f2069.tar.xz
MultiMC-168ed3e8e58a8e5065ffa720f8d45f4cee0f2069.zip
Implemented version lists.
Further work on this is still needed. Currently there is no sorting or filtering of any kind. In addition, changes need to be made to fix issues with bad ETags since the current system here is based on MultiMC 4's version list system before it was fixed.
Diffstat (limited to 'plugins/stdinstance')
-rw-r--r--plugins/stdinstance/stdinstversion.cpp4
-rw-r--r--plugins/stdinstance/stdinstversion.h4
-rw-r--r--plugins/stdinstance/stdinstversionlist.cpp8
3 files changed, 9 insertions, 7 deletions
diff --git a/plugins/stdinstance/stdinstversion.cpp b/plugins/stdinstance/stdinstversion.cpp
index 0e582ffc..0e93cd42 100644
--- a/plugins/stdinstance/stdinstversion.cpp
+++ b/plugins/stdinstance/stdinstversion.cpp
@@ -63,10 +63,10 @@ QString StdInstVersion::name() const
return m_name;
}
-QString StdInstVersion::type() const
+QString StdInstVersion::typeName() const
{
if (m_linkedVersion)
- return m_linkedVersion->type();
+ return m_linkedVersion->typeName();
switch (versionType())
{
diff --git a/plugins/stdinstance/stdinstversion.h b/plugins/stdinstance/stdinstversion.h
index 3f03ae83..38a2010c 100644
--- a/plugins/stdinstance/stdinstversion.h
+++ b/plugins/stdinstance/stdinstversion.h
@@ -55,14 +55,14 @@ public:
virtual QString descriptor() const;
virtual QString name() const;
- virtual QString type() const;
+ virtual QString typeName() const;
virtual qint64 timestamp() const;
virtual QString downloadURL() const;
virtual bool hasLWJGL() const;
virtual QString etag() const;
virtual VersionType versionType() const;
- virtual void setVersionType(VersionType type);
+ virtual void setVersionType(VersionType typeName);
virtual bool isMeta() const;
diff --git a/plugins/stdinstance/stdinstversionlist.cpp b/plugins/stdinstance/stdinstversionlist.cpp
index 4ad4c52f..b271fa65 100644
--- a/plugins/stdinstance/stdinstversionlist.cpp
+++ b/plugins/stdinstance/stdinstversionlist.cpp
@@ -45,7 +45,7 @@
#define MCN_URLBASE "http://sonicrules.org/mcnweb.py"
// When this is defined, prints the entire version list to qDebug() after loading.
-#define PRINT_VERSIONS
+//#define PRINT_VERSIONS
StdInstVersionList vList;
@@ -90,7 +90,7 @@ void StdInstVersionList::printToStdOut()
qDebug() << "Version " << version->name();
qDebug() << "\tDownload: " << version->downloadURL();
qDebug() << "\tTimestamp: " << version->timestamp();
- qDebug() << "\tType: " << version->type();
+ qDebug() << "\tType: " << version->typeName();
qDebug() << "----------------------------------------------";
}
}
@@ -157,8 +157,10 @@ void StdInstVListLoadTask::finalize()
// Now we swap the list we loaded into the actual version list.
// This applies our changes to the version list immediately and still gives us
// access to the old list so that we can delete the objects in it and free their memory.
- // By doing this, we cause the version list to update immediately.
+ // By doing this, we cause the version list to update as quickly as possible.
+ m_list->beginResetModel();
m_list->m_vlist.swap(tempList);
+ m_list->endResetModel();
// We called swap, so all the data that was in the version list previously is now in
// tempList (and vice-versa). Now we just free the memory.