mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
show the error string in the GUI rather than stderr
This makes the error string just be an internal "membuffer", which the GUI can fetch and show when errors occur. The error string keeps accumulating until somebody retrieves it with "get_error_string()". This should make any write errors actually show up to the user. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b5d0cfd557
commit
ec33a95ad0
3 changed files with 33 additions and 9 deletions
|
@ -899,8 +899,10 @@ int MainWindow::file_save_as(void)
|
|||
if (ui.InfoWidget->isEditing())
|
||||
ui.InfoWidget->acceptChanges();
|
||||
|
||||
if (save_dives(filename.toUtf8().data()))
|
||||
if (save_dives(filename.toUtf8().data())) {
|
||||
showError(get_error_string());
|
||||
return -1;
|
||||
}
|
||||
|
||||
set_filename(filename.toUtf8().data(), true);
|
||||
setTitle(MWTF_FILENAME);
|
||||
|
@ -927,8 +929,10 @@ int MainWindow::file_save(void)
|
|||
if (!current_def_dir.exists())
|
||||
current_def_dir.mkpath(current_def_dir.absolutePath());
|
||||
}
|
||||
if (save_dives(existing_filename))
|
||||
if (save_dives(existing_filename)) {
|
||||
showError(get_error_string());
|
||||
return -1;
|
||||
}
|
||||
mark_divelist_changed(false);
|
||||
addRecentFile(QStringList() << QString(existing_filename));
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue