]> git.lyx.org Git - lyx.git/commitdiff
Properly report back if showDirectory() doesn't succeed
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 27 Aug 2020 09:58:37 +0000 (11:58 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 27 Aug 2020 09:58:37 +0000 (11:58 +0200)
src/frontends/qt/qt_helpers.cpp

index 20f58034c73aed0f76d9109cc5f6312b43c1905c..87b6593a71c7be79bebd3581b997029aa9b2c3c0 100644 (file)
@@ -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)