diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-05-19 17:18:44 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-19 17:18:44 -0700 |
commit | f67d3d4bbcb42b8660f4f9833acc6234332d8d68 (patch) | |
tree | e7d6f6e0ccfe70bb7350126e741abd5aaaabcc2f /qt-ui | |
parent | 25b8092c0300a223321fc5a537d913fb14c91243 (diff) | |
download | subsurface-f67d3d4bbcb42b8660f4f9833acc6234332d8d68.tar.gz |
Replace glib file/directory handling with equivalent Qt code
I hope this is indeed equivalent...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/mainwindow.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 70023aeee..32b909a6e 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -521,14 +521,9 @@ void MainWindow::file_save(void) if (strcmp(existing_filename, current_default) == 0) { /* if we are using the default filename the directory * that we are creating the file in may not exist */ - char *current_def_dir; - struct stat sb; - - current_def_dir = g_path_get_dirname(existing_filename); - if (stat(current_def_dir, &sb) != 0) { - g_mkdir(current_def_dir, S_IRWXU); - } - free(current_def_dir); + QDir current_def_dir = QFileInfo(current_default).absoluteDir(); + if (!current_def_dir.exists()) + current_def_dir.mkpath(current_def_dir.absolutePath()); } save_dives(existing_filename); mark_divelist_changed(FALSE); |