summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-19 16:22:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-20 19:51:27 +0200
commitf9ccf6216022dcaf70bd01e51feb5c88b5f03731 (patch)
treea107e3d7524cb1a6ec21abc7d270799a1277bd55 /xmlsecurity
parent83c82bbb73dec5e3ba82e81b09824cd223e575a7 (diff)
rework to check cPath against nullptr only on !WNT
Change-Id: Iaca0d47b07f4b31b70ddeccb87f0f84019be81cd Reviewed-on: https://gerrit.libreoffice.org/62055 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx63
1 files changed, 31 insertions, 32 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 61300fdf6156..98f9bd1da127 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -501,41 +501,40 @@ IMPL_STATIC_LINK(DigitalSignaturesDialog, CertMgrButtonHdl, Button*, pButton, vo
#else
const OUString aGUIServers[] = { OUString("kleopatra"), OUString("seahorse"), OUString("gpa"), OUString("kgpg") };
const char* cPath = getenv("PATH");
+ if (!cPath)
+ return;
#endif
- if (cPath)
+ OUString aPath(cPath, strlen(cPath), osl_getThreadTextEncoding());
+ OUString sFoundGUIServer, sExecutable;
+
+ for ( auto const &rServer : aGUIServers )
+ {
+ osl::FileBase::RC searchError = osl::File::searchFileURL(rServer, aPath, sFoundGUIServer );
+ if (searchError == osl::FileBase::E_None)
+ {
+ osl::File::getSystemPathFromFileURL( sFoundGUIServer, sExecutable );
+ break;
+ }
+
+ }
+
+ if ( !sExecutable.isEmpty() )
+ {
+ uno::Reference< uno::XComponentContext > xContext =
+ ::comphelper::getProcessComponentContext();
+ uno::Reference< css::system::XSystemShellExecute > xSystemShell(
+ css::system::SystemShellExecute::create(xContext) );
+
+ xSystemShell->execute( sExecutable, OUString(),
+ css::system::SystemShellExecuteFlags::DEFAULTS );
+ }
+ else
{
- OUString aPath(cPath, strlen(cPath), osl_getThreadTextEncoding());
- OUString sFoundGUIServer, sExecutable;
-
- for ( auto const &rServer : aGUIServers )
- {
- osl::FileBase::RC searchError = osl::File::searchFileURL(rServer, aPath, sFoundGUIServer );
- if (searchError == osl::FileBase::E_None)
- {
- osl::File::getSystemPathFromFileURL( sFoundGUIServer, sExecutable );
- break;
- }
-
- }
-
- if ( !sExecutable.isEmpty() )
- {
- uno::Reference< uno::XComponentContext > xContext =
- ::comphelper::getProcessComponentContext();
- uno::Reference< css::system::XSystemShellExecute > xSystemShell(
- css::system::SystemShellExecute::create(xContext) );
-
- xSystemShell->execute( sExecutable, OUString(),
- css::system::SystemShellExecuteFlags::DEFAULTS );
- }
- else
- {
- std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pButton->GetFrameWeld(),
- VclMessageType::Info, VclButtonsType::Ok,
- XsResId(STR_XMLSECDLG_NO_CERT_MANAGER)));
- xInfoBox->run();
- }
+ std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pButton->GetFrameWeld(),
+ VclMessageType::Info, VclButtonsType::Ok,
+ XsResId(STR_XMLSECDLG_NO_CERT_MANAGER)));
+ xInfoBox->run();
}
}