summaryrefslogtreecommitdiff
path: root/src/gui/models
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-13 21:54:39 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-13 21:54:39 +0300
commit86b19d64c2692665aba33e44ee5db6cbf36b6342 (patch)
tree93d91c84258f9b76ab29ab51119bbc0044d729a4 /src/gui/models
parenta45303dc06c74735389607e5b281bb69543547ed (diff)
downloadmanaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.tar.gz
manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.tar.bz2
manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.tar.xz
manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.zip
Add option to select any existing SDL renderer drivers for SDL2 default mode.
Diffstat (limited to 'src/gui/models')
-rw-r--r--src/gui/models/namesmodel.cpp11
-rw-r--r--src/gui/models/namesmodel.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/models/namesmodel.cpp b/src/gui/models/namesmodel.cpp
index ee26dbdaa..5344a7a7d 100644
--- a/src/gui/models/namesmodel.cpp
+++ b/src/gui/models/namesmodel.cpp
@@ -21,6 +21,7 @@
#include "gui/models/namesmodel.h"
#include "utils/cast.h"
+#include "utils/foreach.h"
#include "utils/gettext.h"
#include "debug.h"
@@ -55,3 +56,13 @@ void NamesModel::fillFromArray(const char *const *const arr,
for (size_t f = 0; f < sz; f ++)
mNames.push_back(gettext(arr[f]));
}
+
+void NamesModel::fillFromVector(const StringVect &vect)
+{
+ FOR_EACH(StringVectCIter, it, vect)
+ {
+ const std::string str = *it;
+ if (!str.empty())
+ mNames.push_back(str);
+ }
+}
diff --git a/src/gui/models/namesmodel.h b/src/gui/models/namesmodel.h
index ba9a928a4..a239bd9aa 100644
--- a/src/gui/models/namesmodel.h
+++ b/src/gui/models/namesmodel.h
@@ -55,6 +55,8 @@ class NamesModel notfinal : public ListModel
void fillFromArray(const char *const *const arr,
const std::size_t size);
+ void fillFromVector(const StringVect &vect);
+
protected:
StringVect mNames;
};