summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-11-04 19:19:13 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-11-04 19:20:17 +0100
commit1bd781484b6846195a39c09aee81bdadac214ef4 (patch)
treef5386616183d8ec276160d5fe37b955cca8ee8cd
parent4c71c6cf336b4891fede0e300f4ab20a5d0a19b4 (diff)
nix nonsensical "save as" logic
-rw-r--r--facetracknoir/ui.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index e89fbc73..8142e20a 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -143,27 +143,14 @@ void MainWindow::saveAs()
QString fileName = QFileDialog::getSaveFileName(this, tr("Save file"),
oldFile,
tr("Settings file (*.ini);;All Files (*)"));
- if (!fileName.isEmpty()) {
+ (void) QFile::remove(fileName);
- QFileInfo newFileInfo ( fileName );
- if ((newFileInfo.exists()) && (oldFile != fileName)) {
- QFile newFileFile ( fileName );
- newFileFile.remove();
- }
-
- QFileInfo oldFileInfo ( oldFile );
- if (oldFileInfo.exists()) {
- QFile oldFileFile ( oldFile );
- oldFileFile.copy( fileName );
- }
-
- {
- QSettings settings(group::org);
- settings.setValue (group::filename_key, fileName);
- }
- save();
+ {
+ QSettings settings(group::org);
+ settings.setValue (group::filename_key, fileName);
}
+ save();
fill_profile_combobox();
}