[Libreoffice-commits] .: desktop/inc desktop/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Nov 25 01:40:20 PST 2010


 desktop/inc/app.hxx                  |    1 +
 desktop/source/app/app.cxx           |   25 ++++++++++++++++++++++---
 desktop/source/app/appfirststart.cxx |    3 ++-
 3 files changed, 25 insertions(+), 4 deletions(-)

New commits:
commit f3c0854fc93928772e7a3fba92402441ec51e312
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 25 09:40:08 2010 +0000

    start quickstarter on every launch if configured to use it

diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index b657374..977080c 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -155,6 +155,7 @@ class Desktop : public Application
         sal_Bool				InitializeInstallation( const rtl::OUString& rAppFilename );
         sal_Bool				InitializeConfiguration();
         void                    FlushConfiguration();
+        static sal_Bool         shouldLaunchQuickstart();
         sal_Bool				InitializeQuickstartMode( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr );
 
         void					HandleBootstrapPathErrors( ::utl::Bootstrap::Status, const ::rtl::OUString& aMsg );
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 9ec6e87..cefe65e 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -140,6 +140,9 @@
 #include <vcl/stdtext.hxx>
 #include <vcl/msgbox.hxx>
 #include <sfx2/sfx.hrc>
+#include <sfx2/app.hxx>
+#include <svl/itemset.hxx>
+#include <svl/eitem.hxx>
 #include <ucbhelper/contentbroker.hxx>
 #include <unotools/bootstrap.hxx>
 #include <cppuhelper/bootstrap.hxx>
@@ -2071,6 +2074,22 @@ void Desktop::FlushConfiguration()
     }
 }
 
+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, FALSE, &pItem);
+        if (SFX_ITEM_SET == eState)
+            bQuickstart = ((SfxBoolItem*)pItem)->GetValue();
+    }
+    return bQuickstart;
+}
+
+
 sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& rSMgr )
 {
     try
@@ -2080,9 +2099,7 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
         // this will only be activated if -quickstart was specified on cmdline
         RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) createInstance com.sun.star.office.Quickstart" );
 
-        sal_Bool bQuickstart = GetCommandLineArgs()->IsQuickstart();
-        Sequence< Any > aSeq( 1 );
-        aSeq[0] <<= bQuickstart;
+        sal_Bool bQuickstart = shouldLaunchQuickstart();
 
         // Try to instanciate quickstart service. This service is not mandatory, so
         // do nothing if service is not available
@@ -2095,6 +2112,8 @@ sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& r
         if ( bQuickstart )
         #endif
         {
+            Sequence< Any > aSeq( 1 );
+            aSeq[0] <<= bQuickstart;
             Reference < XComponent > xQuickstart( rSMgr->createInstanceWithArguments(
                                                 DEFINE_CONST_UNICODE( "com.sun.star.office.Quickstart" ), aSeq ),
                                                 UNO_QUERY );
diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx
index b1af02c..dc6c960 100644
--- a/desktop/source/app/appfirststart.cxx
+++ b/desktop/source/app/appfirststart.cxx
@@ -286,7 +286,8 @@ void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart )
                 Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges();
 
                 Sequence< Any > aSeq( 1 );
-                aSeq[0] <<= sal_True;
+                sal_Bool bQuickstart = shouldLaunchQuickstart();
+                aSeq[0] <<= bQuickstart;
 
                 Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance(
                     OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Quickstart" ) ) ),UNO_QUERY_THROW );


More information about the Libreoffice-commits mailing list