diff options
author | Arno <am@disconnect.de> | 2014-06-29 09:41:30 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2014-06-29 09:41:30 +0200 |
commit | f295cfb8672d97bb5c804499bdb311a9a0d8039b (patch) | |
tree | 77b54514e17d6bb453bd9431707f9f37954c9fc2 /pictureswidget.cpp | |
parent | b5bd9cf0b981ee0c87ead9e20c36247932de7818 (diff) | |
download | SheMov-f295cfb8672d97bb5c804499bdb311a9a0d8039b.tar.gz SheMov-f295cfb8672d97bb5c804499bdb311a9a0d8039b.tar.bz2 SheMov-f295cfb8672d97bb5c804499bdb311a9a0d8039b.zip |
Major rework of MappingTreeResultView + Model
Well, I hope this fixes the crashes for good. String comparison for
looking up the parents really wasn't a prudent thing to do...
Use the ParentIds instead.
Diffstat (limited to 'pictureswidget.cpp')
-rw-r--r-- | pictureswidget.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/pictureswidget.cpp b/pictureswidget.cpp index d043e1c..c23af06 100644 --- a/pictureswidget.cpp +++ b/pictureswidget.cpp @@ -68,15 +68,23 @@ void PicturesWidget::writeSettings(){ QSettings s; MappingData selected = mMappingTree->selectedItem(); if(selected.isValid()){ - s.setValue("ui/selectedmapping", selected.path.first()); + QStringList v; + for(int i = 0; i< selected.parents.count(); ++i){ + v << QString::number(selected.parents.at(i)); + } + s.setValue("ui/selectedmapping", v.join(",")); } mPictureView->writeHeaderConfig(); } void PicturesWidget::readSettings(){ QSettings s; - QStringList selPath = s.value("ui/selectedmapping").toStringList(); - mMappingTree->selectPath(selPath.join("/")); + QStringList ps = s.value("ui/selectedmapping").toString().split(","); + QList<int> path; + for(int i = 0; i < ps.count(); ++i){ + path << ps.at(i).toInt(); + } + mMappingTree->selectPath(path); mPictureView->readHeaderConfig(); } @@ -109,7 +117,7 @@ void PicturesWidget::constructWindowTitle(){ QString windowTitle = mWindowTitleBase; MappingData selected = mMappingTree->selectedItem(); if(!selected.path.isEmpty()){ - windowTitle = QString("%1 - [%2]").arg(mWindowTitleBase).arg(selected.path.first().join("/")); + windowTitle = QString("%1 - [%2]").arg(mWindowTitleBase).arg(selected.path.join("/")); mPictureView->setHoverWinVisible(false); } emit needWindowTitleChange(windowTitle); |