Fix bug in processSettings in RsCollectionDialog.cpp

This commit is contained in:
Phenom 2018-02-18 17:30:01 +01:00
parent d87061ddb3
commit 931fdd026e

View File

@ -21,17 +21,23 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
****************************************************************/ ****************************************************************/
#include "RsCollectionDialog.h"
#include "RsCollection.h"
#include "util/misc.h"
#include <QCheckBox> #include <QCheckBox>
#include <QDateTime>
#include <QDir>
#include <QFileSystemModel>
#include <QHeaderView>
#include <QInputDialog>
#include <QKeyEvent>
#include <QMessageBox> #include <QMessageBox>
#include <QMenu> #include <QMenu>
#include <QTextEdit> #include <QTextEdit>
#include <QDir> #include <QTreeView>
#include <QKeyEvent>
#include <QDateTime>
#include <QInputDialog>
#include "RsCollectionDialog.h"
#include "RsCollection.h"
#include "util/misc.h"
#define COLUMN_FILE 0 #define COLUMN_FILE 0
#define COLUMN_FILEPATH 1 #define COLUMN_FILEPATH 1
#define COLUMN_SIZE 2 #define COLUMN_SIZE 2
@ -366,6 +372,8 @@ void RsCollectionDialog::processSettings(bool bLoad)
ui._listSplitter->restoreState(Settings->value("ListSplitterState_CM").toByteArray()); ui._listSplitter->restoreState(Settings->value("ListSplitterState_CM").toByteArray());
// Load system file header configuration // Load system file header configuration
ui._systemFileTW->header()->restoreState(Settings->value("SystemFileHeader_CM").toByteArray()); ui._systemFileTW->header()->restoreState(Settings->value("SystemFileHeader_CM").toByteArray());
// Load file entries header configuration
ui._fileEntriesTW->header()->restoreState(Settings->value("FileEntriesHeader_CM").toByteArray());
} else { } else {
// Load windows geometrie // Load windows geometrie
restoreGeometry(Settings->value("WindowGeometrie").toByteArray()); restoreGeometry(Settings->value("WindowGeometrie").toByteArray());
@ -374,22 +382,30 @@ void RsCollectionDialog::processSettings(bool bLoad)
ui._listSplitter->restoreState(Settings->value("ListSplitterState").toByteArray()); ui._listSplitter->restoreState(Settings->value("ListSplitterState").toByteArray());
// Load system file header configuration // Load system file header configuration
ui._systemFileTW->header()->restoreState(Settings->value("SystemFileHeader").toByteArray()); ui._systemFileTW->header()->restoreState(Settings->value("SystemFileHeader").toByteArray());
// Load file entries header configuration
ui._fileEntriesTW->header()->restoreState(Settings->value("FileEntriesHeader").toByteArray());
} }
} else { } else {
if(_creationMode && !_readOnly){ if(_creationMode && !_readOnly){
// Save windows geometrie // Save windows geometrie
Settings->setValue("WindowGeometrie_CM",saveGeometry()); Settings->setValue("WindowGeometrie_CM",saveGeometry());
// Save splitter state // Save splitters state
Settings->setValue("SplitterState_CM", ui._listSplitter->saveState()); Settings->setValue("MainSplitterState_CM", ui._mainSplitter->saveState());
// Save treeView header configuration Settings->setValue("ListSplitterState_CM", ui._listSplitter->saveState());
// Save system file header configuration
Settings->setValue("SystemFileHeader_CM", ui._systemFileTW->header()->saveState()); Settings->setValue("SystemFileHeader_CM", ui._systemFileTW->header()->saveState());
// Save file entries header configuration
Settings->setValue("FileEntriesHeader_CM", ui._fileEntriesTW->header()->saveState());
} else { } else {
// Save windows geometrie // Save windows geometrie
Settings->setValue("WindowGeometrie",saveGeometry()); Settings->setValue("WindowGeometrie",saveGeometry());
// Save splitter state // Save splitter state
Settings->setValue("SplitterState", ui._listSplitter->saveState()); Settings->setValue("MainSplitterState", ui._mainSplitter->saveState());
// Save treeView header configuration Settings->setValue("ListSplitterState", ui._listSplitter->saveState());
// Save system file header configuration
Settings->setValue("SystemFileHeader", ui._systemFileTW->header()->saveState()); Settings->setValue("SystemFileHeader", ui._systemFileTW->header()->saveState());
// Save file entries header configuration
Settings->setValue("FileEntriesHeader", ui._fileEntriesTW->header()->saveState());
} }
} }