From 1ca566b033adc48afdfb964e5140751c8cb14e3c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 4 Nov 2014 19:19:38 +0100 Subject: delete ini before saving to workaround Qt5 bug Issue: #91 --- facetracknoir/ui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'facetracknoir/ui.cpp') diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index 8142e20a..5d3bc591 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -122,11 +122,14 @@ void MainWindow::save_mappings() { #endif void MainWindow::save() { + const QString currentFile = group::ini_pathname(); + // Qt5 refuses writing to empty file + (void) QFile::remove(currentFile); + b->save(); save_mappings(); #if defined(__unix) || defined(__linux) - const QString currentFile = group::ini_pathname(); QByteArray bytes = QFile::encodeName(currentFile); const char* filename_as_asciiz = bytes.constData(); -- cgit v1.2.3