comparison src/mainwindow.cpp @ 16:6d5dd3ae2ad3

Save last selection in settings
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 14 Apr 2015 17:25:44 +0200
parents e3c8f61e45a9
children 64a51a42c01f
comparison
equal deleted inserted replaced
15:43a36293f495 16:6d5dd3ae2ad3
128 } 128 }
129 */ 129 */
130 void MainWindow::setFolder(const QString& folder) 130 void MainWindow::setFolder(const QString& folder)
131 { 131 {
132 QFileInfo fi(folder); 132 QFileInfo fi(folder);
133 mSettings.setValue(SUB_FOLDER_KEY, folder);
133 if (!fi.isDir() || !fi.isReadable()) { 134 if (!fi.isDir() || !fi.isReadable()) {
134 showErrorMessage(tr("Failed to access directory: '%1'").arg(folder)); 135 showErrorMessage(tr("Failed to access directory: '%1'").arg(folder));
135 } 136 }
136 QDir dir = QDir(folder); 137 QDir dir = QDir(folder);
137 QFileInfo metaData = dir.absoluteFilePath("metadata.csv"); 138 QFileInfo metaData = dir.absoluteFilePath("metadata.csv");
160 } 161 }
161 } 162 }
162 163
163 void MainWindow::setRootFolder(const QString &folder) { 164 void MainWindow::setRootFolder(const QString &folder) {
164 mRootFolder = folder; 165 mRootFolder = folder;
166 QDir dir(folder);
167 dir.cdUp();
168 mSettings.setValue(ROOT_FOLDER_KEY, dir.absolutePath());
169
165 showSubFolderSelect(); 170 showSubFolderSelect();
166 } 171 }
167 172
168 void MainWindow::showSubFolderSelect() { 173 void MainWindow::showSubFolderSelect() {
169 const QString subPattern = mSettings.value(SUB_FOLDER_PATTERN_KEY, 174 const QString subPattern = mSettings.value(SUB_FOLDER_PATTERN_KEY,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)