Kaydet (Commit) f9ccf621 authored tarafından Caolán McNamara's avatar Caolán McNamara

rework to check cPath against nullptr only on !WNT

Change-Id: Iaca0d47b07f4b31b70ddeccb87f0f84019be81cd
Reviewed-on: https://gerrit.libreoffice.org/62055
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 83c82bbb
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment