summaryrefslogtreecommitdiffstats
path: root/application/widgets/PageContainer.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-04-12 01:44:51 +0200
committerPetr Mrázek <peterix@gmail.com>2018-04-23 02:05:22 +0200
commit72ff342d6325cab42cc3d8401b4fac5b2f7eff3b (patch)
treec779eaaf41a16be4c9990bec21e661ec6b53bafe /application/widgets/PageContainer.cpp
parent6284f070c19053ae2bcf26dd9bccac2e0d35477f (diff)
downloadMultiMC-72ff342d6325cab42cc3d8401b4fac5b2f7eff3b.tar
MultiMC-72ff342d6325cab42cc3d8401b4fac5b2f7eff3b.tar.gz
MultiMC-72ff342d6325cab42cc3d8401b4fac5b2f7eff3b.tar.lz
MultiMC-72ff342d6325cab42cc3d8401b4fac5b2f7eff3b.tar.xz
MultiMC-72ff342d6325cab42cc3d8401b4fac5b2f7eff3b.zip
GH-2053 basics of the servers.dat management
Diffstat (limited to 'application/widgets/PageContainer.cpp')
-rw-r--r--application/widgets/PageContainer.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/application/widgets/PageContainer.cpp b/application/widgets/PageContainer.cpp
index 98de57e8..c8c2b57a 100644
--- a/application/widgets/PageContainer.cpp
+++ b/application/widgets/PageContainer.cpp
@@ -218,10 +218,9 @@ void PageContainer::currentChanged(const QModelIndex &current)
bool PageContainer::prepareToClose()
{
- for (auto page : m_model->pages())
+ if(!saveAll())
{
- if (!page->apply())
- return false;
+ return false;
}
if (m_currentPage)
{
@@ -229,3 +228,13 @@ bool PageContainer::prepareToClose()
}
return true;
}
+
+bool PageContainer::saveAll()
+{
+ for (auto page : m_model->pages())
+ {
+ if (!page->apply())
+ return false;
+ }
+ return true;
+}