diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-10-18 17:35:57 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-18 17:36:10 +0200 |
commit | 5732ff540edbaa4ad5d92177c48e0a79e385b5cb (patch) | |
tree | 66ee174998e5ded97b921c125d3cd30949dca593 /desktop/source/app/app.cxx | |
parent | 9567fbdff6141a605f54df77ddcae173467d5cba (diff) |
Some clean-up
Change-Id: I142f9c4e73585272c3028880e40c20f4a056f3c3
Diffstat (limited to 'desktop/source/app/app.cxx')
-rw-r--r-- | desktop/source/app/app.cxx | 63 |
1 files changed, 47 insertions, 16 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 4c36cd330301..b9e4ad13278d 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -84,6 +84,7 @@ #include <unotools/moduleoptions.hxx> #include <officecfg/Office/Common.hxx> #include <officecfg/Office/Recovery.hxx> +#include <officecfg/Setup.hxx> #include <osl/file.hxx> #include <osl/process.h> #include <rtl/uri.hxx> @@ -318,6 +319,52 @@ bool cleanExtensionCache() { return true; } +bool shouldLaunchQuickstart() +{ + bool bQuickstart = Desktop::GetCommandLineArgs().IsQuickstart(); + if (!bQuickstart) + { + const SfxPoolItem* pItem=0; + SfxItemSet aQLSet(SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER); + SFX_APP()->GetOptions(aQLSet); + SfxItemState eState = aQLSet.GetItemState(SID_ATTR_QUICKLAUNCHER, sal_False, &pItem); + if (SFX_ITEM_SET == eState) + bQuickstart = ((SfxBoolItem*)pItem)->GetValue(); + } + return bQuickstart; +} + +void SetRestartState() { + try { + boost::shared_ptr< comphelper::ConfigurationChanges > batch( + comphelper::ConfigurationChanges::create()); + officecfg::Setup::Office::OfficeRestartInProgress::set(true, batch); + batch->commit(); + } catch (css::uno::Exception & e) { + SAL_WARN("desktop.app", "ignoring Exception \"" << e.Message << "\""); + } +} + +void DoRestartActionsIfNecessary(bool quickstart) { + if (quickstart) { + try { + if (officecfg::Setup::Office::OfficeRestartInProgress::get()) { + boost::shared_ptr< comphelper::ConfigurationChanges > batch( + comphelper::ConfigurationChanges::create()); + officecfg::Setup::Office::OfficeRestartInProgress::set( + false, batch); + batch->commit(); + css::office::Quickstart::createStart( + comphelper::getProcessComponentContext(), + shouldLaunchQuickstart()); + } + } catch (css::uno::Exception & e) { + SAL_WARN( + "desktop.app", "ignoring Exception \"" << e.Message << "\""); + } + } +} + } // ---------------------------------------------------------------------------- @@ -1858,22 +1905,6 @@ void Desktop::FlushConfiguration() css::uno::UNO_QUERY_THROW)->flush(); } -sal_Bool Desktop::shouldLaunchQuickstart() -{ - sal_Bool bQuickstart = GetCommandLineArgs().IsQuickstart(); - if (!bQuickstart) - { - const SfxPoolItem* pItem=0; - SfxItemSet aQLSet(SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER); - SFX_APP()->GetOptions(aQLSet); - SfxItemState eState = aQLSet.GetItemState(SID_ATTR_QUICKLAUNCHER, sal_False, &pItem); - if (SFX_ITEM_SET == eState) - bQuickstart = ((SfxBoolItem*)pItem)->GetValue(); - } - return bQuickstart; -} - - sal_Bool Desktop::InitializeQuickstartMode( const Reference< XComponentContext >& rxContext ) { try |