summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-02-21 19:37:35 +0100
committerPetr Mrázek <peterix@gmail.com>2013-02-21 19:37:35 +0100
commit294c8e21c85b807b7880a8b722850417f12f5f26 (patch)
tree5ad9ce6895ab33d7c02c11b9b9a0b530ba3ae979
parent58379657e99a146123814fd182d6c58424e9713e (diff)
parent2020d9c24bf0c2d024a3f42f38d7e106ab8a49eb (diff)
downloadMultiMC-294c8e21c85b807b7880a8b722850417f12f5f26.tar
MultiMC-294c8e21c85b807b7880a8b722850417f12f5f26.tar.gz
MultiMC-294c8e21c85b807b7880a8b722850417f12f5f26.tar.lz
MultiMC-294c8e21c85b807b7880a8b722850417f12f5f26.tar.xz
MultiMC-294c8e21c85b807b7880a8b722850417f12f5f26.zip
Merge branch 'inst_rewrite' of https://github.com/Forkk/MultiMC5
-rw-r--r--CMakeLists.txt28
-rw-r--r--libinstance/include/instancelist.h2
-rw-r--r--libinstance/src/instanceloader.cpp2
-rw-r--r--libutil/include/siglist.h7
-rw-r--r--libutil/include/siglist_impl.h20
5 files changed, 28 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index edb58ef2..0cb80bbc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,19 @@ SET(CMAKE_INCLUDE_CURRENT_DIR ON)
# Output all executables and shared libs in the main build folder, not in subfolders.
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
+######## Set compiler flags ########
+IF(APPLE)
+ # assume clang 4.1.0+, add C++0x/C++11 stuff
+ message(STATUS "Using APPLE CMAKE_CXX_FLAGS")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++")
+ELSEIF(UNIX)
+ # assume GCC, add C++0x/C++11 stuff
+ MESSAGE(STATUS "Using UNIX CMAKE_CXX_FLAGS")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ELSEIF(MINGW)
+ MESSAGE(STATUS "Using MINGW CMAKE_CXX_FLAGS")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
+ENDIF()
################################ INCLUDE LIBRARIES ################################
@@ -73,21 +86,6 @@ ENDIF(${BIGENDIAN})
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
-######## Set compiler flags ########
-IF(APPLE)
- # assume clang 4.1.0+, add C++0x/C++11 stuff
- message(STATUS "Using APPLE CMAKE_CXX_FLAGS")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++")
-ELSEIF(UNIX)
- # assume GCC, add C++0x/C++11 stuff
- MESSAGE(STATUS "Using UNIX CMAKE_CXX_FLAGS")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-ELSEIF(MINGW)
- MESSAGE(STATUS "Using MINGW CMAKE_CXX_FLAGS")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
-ENDIF()
-
-
######## Set version numbers ########
SET(MultiMC_VERSION_MAJOR 5)
SET(MultiMC_VERSION_MINOR 0)
diff --git a/libinstance/include/instancelist.h b/libinstance/include/instancelist.h
index f6be815c..d5b8c196 100644
--- a/libinstance/include/instancelist.h
+++ b/libinstance/include/instancelist.h
@@ -26,7 +26,7 @@
class Instance;
-class LIBMMCINST_EXPORT InstanceList : public QObject, public SigList<QSharedPointer<Instance>>
+class LIBMMCINST_EXPORT InstanceList : public QObject, public SigList< QSharedPointer<Instance> >
{
Q_OBJECT
public:
diff --git a/libinstance/src/instanceloader.cpp b/libinstance/src/instanceloader.cpp
index 620562b6..9d98230f 100644
--- a/libinstance/src/instanceloader.cpp
+++ b/libinstance/src/instanceloader.cpp
@@ -100,7 +100,7 @@ InstTypeList InstanceLoader::typeList()
{
InstTypeList typeList;
- for (auto iter = m_typeMap.begin(); iter != m_typeMap.end(); iter++)
+ for (QMap<QString, InstanceTypeInterface *>::iterator iter = m_typeMap.begin(); iter != m_typeMap.end(); iter++)
{
typeList.append(*iter);
}
diff --git a/libutil/include/siglist.h b/libutil/include/siglist.h
index b6432b6e..dcae7c04 100644
--- a/libutil/include/siglist.h
+++ b/libutil/include/siglist.h
@@ -26,7 +26,6 @@
template <typename T>
class SigList : public QList<T>
{
-
public:
explicit SigList() : QList<T>() {}
@@ -35,11 +34,11 @@ public:
virtual void clear();
- virtual void erase(iterator pos);
- virtual void erase(iterator first, iterator last);
+ virtual void erase(typename QList<T>::iterator pos);
+ virtual void erase(typename QList<T>::iterator first, typename QList<T>::iterator last);
virtual void insert(int i, const T &t);
- virtual void insert(iterator before, const T &t);
+ virtual void insert(typename QList<T>::iterator before, const T &t);
virtual void move(int from, int to);
diff --git a/libutil/include/siglist_impl.h b/libutil/include/siglist_impl.h
index 16ddd9b0..9736b2cf 100644
--- a/libutil/include/siglist_impl.h
+++ b/libutil/include/siglist_impl.h
@@ -19,7 +19,7 @@ template <typename T>
void SigList<T>::append(const T &value)
{
QList<T>::append(value);
- onItemAdded(value, length() - 1);
+ onItemAdded(value, QList<T>::length() - 1);
}
template <typename T>
@@ -32,7 +32,7 @@ void SigList<T>::prepend(const T &value)
template <typename T>
void SigList<T>::append(const QList<T> &other)
{
- int index = length();
+ int index = QList<T>::length();
QList<T>::append(other);
onItemsAdded(other, index);
}
@@ -45,7 +45,7 @@ void SigList<T>::clear()
}
template <typename T>
-void SigList<T>::erase(QList<T>::iterator pos)
+void SigList<T>::erase(typename QList<T>::iterator pos)
{
T value = *pos;
int index = indexOf(*pos);
@@ -54,12 +54,12 @@ void SigList<T>::erase(QList<T>::iterator pos)
}
template <typename T>
-void SigList<T>::erase(QList<T>::iterator first, QList<T>::iterator last)
+void SigList<T>::erase(typename QList<T>::iterator first, typename QList<T>::iterator last)
{
QList<T> removedValues;
int firstIndex = indexOf(*first);
- for (QList<T>::iterator iter = first; iter < last; iter++)
+ for (SigList<T>::iterator iter = first; iter < last; iter++)
{
removedValues << *iter;
QList<T>::erase(iter);
@@ -76,7 +76,7 @@ void SigList<T>::insert(int i, const T &t)
}
template <typename T>
-void SigList<T>::insert(QList<T>::iterator before, const T &t)
+void SigList<T>::insert(typename QList<T>::iterator before, const T &t)
{
QList<T>::insert(before, t);
onItemAdded(t, indexOf(t));
@@ -85,7 +85,7 @@ void SigList<T>::insert(QList<T>::iterator before, const T &t)
template <typename T>
void SigList<T>::move(int from, int to)
{
- const T &item = at(from);
+ const T &item = QList<T>::at(from);
QList<T>::move(from, to);
onItemMoved(item, from, to);
}
@@ -120,8 +120,8 @@ void SigList<T>::swap(QList<T> &other)
template <typename T>
void SigList<T>::swap(int i, int j)
{
- const T &item1 = at(i);
- const T &item2 = at(j);
+ const T &item1 = QList<T>::at(i);
+ const T &item2 = QList<T>::at(j);
QList<T>::swap(i, j);
onItemMoved(item1, i, j);
onItemMoved(item2, j, i);
@@ -144,7 +144,7 @@ T SigList<T>::takeFirst()
template <typename T>
T SigList<T>::takeLast()
{
- return takeAt(length() - 1);
+ return takeAt(QList<T>::length() - 1);
}
template <typename T>