# HG changeset patch # User sheepluva # Date 1335561048 -7200 # Node ID 211aca8c1f4f209c4be9f4a8b56b6f8599734094 # Parent 970389573788c3c1234b04181fd70daf50a47d1b decouple current theme from map theme (fixes theme confusion bugs of last commit) diff -r 970389573788 -r 211aca8c1f4f QTfrontend/ui/widget/mapContainer.cpp --- a/QTfrontend/ui/widget/mapContainer.cpp Fri Apr 27 22:22:04 2012 +0200 +++ b/QTfrontend/ui/widget/mapContainer.cpp Fri Apr 27 23:10:48 2012 +0200 @@ -250,10 +250,15 @@ cbTemplateFilter->hide(); maze_size_label->hide(); cbMazeSize->hide(); + m_theme = m_mapInfo.theme; } + // the map has no pre-defined theme, so let's use the selected one if (m_mapInfo.theme.isEmpty()) - emit themeChanged(lvThemes->currentIndex().data().toString()); + { + m_theme = lvThemes->currentIndex().data().toString(); + emit themeChanged(m_theme); + } emit mapChanged(m_mapInfo.name); emit mapgenChanged(mapgen); } @@ -300,10 +305,10 @@ void HWMapContainer::themeSelected(const QModelIndex & current, const QModelIndex &) { - m_mapInfo.theme = current.data().toString(); + m_theme = current.data().toString(); gbThemes->setIcon(qVariantValue(current.data(Qt::UserRole))); - emit themeChanged(m_mapInfo.theme); + emit themeChanged(m_theme); } QString HWMapContainer::getCurrentSeed() const @@ -319,7 +324,7 @@ QString HWMapContainer::getCurrentTheme() const { - return(m_mapInfo.theme); + return(m_theme); } bool HWMapContainer::getCurrentIsMission() const diff -r 970389573788 -r 211aca8c1f4f QTfrontend/ui/widget/mapContainer.h --- a/QTfrontend/ui/widget/mapContainer.h Fri Apr 27 22:22:04 2012 +0200 +++ b/QTfrontend/ui/widget/mapContainer.h Fri Apr 27 23:10:48 2012 +0200 @@ -131,6 +131,7 @@ void updatePreview(); MapModel::MapInfo m_mapInfo; + QString m_theme; }; #endif // _HWMAP_CONTAINER_INCLUDED