[LyX/master] Properly report back if showDirectory() doesn't succeed
Juergen Spitzmueller
spitz at lyx.org
Thu Aug 27 09:33:09 UTC 2020
commit d44929ff813fcdc9c44e49491376cace21630234
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Thu Aug 27 11:58:37 2020 +0200
Properly report back if showDirectory() doesn't succeed
---
src/frontends/qt/qt_helpers.cpp | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/frontends/qt/qt_helpers.cpp b/src/frontends/qt/qt_helpers.cpp
index 20f5803..87b6593 100644
--- a/src/frontends/qt/qt_helpers.cpp
+++ b/src/frontends/qt/qt_helpers.cpp
@@ -290,12 +290,16 @@ void showDirectory(FileName const & directory)
QUrl qurl(QUrl::fromLocalFile(QDir::toNativeSeparators(toqstr(directory.absFileName()))));
// Give hints in case of bugs
if (!qurl.isValid()) {
- LYXERR0("QUrl is invalid!");
+ frontend::Alert::error(_("Invalid URL"),
+ bformat(_("The URL `%1$s' could not be resolved."),
+ qstring_to_ucs4(qurl.url())));
return;
}
if (!QDesktopServices::openUrl(qurl))
- LYXERR0("Unable to open QUrl even though dir exists!");
+ frontend::Alert::error(_("URL could not be accessed"),
+ bformat(_("The URL `%1$s' could not be opened although it exists!"),
+ qstring_to_ucs4(qurl.url())));
}
void showTarget(string const & target, string const & pdfv, string const & psv)
More information about the lyx-cvs
mailing list