summaryrefslogtreecommitdiff
path: root/extensions/source
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-05-15 14:12:42 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-05-15 14:12:42 +0000
commit399748e1635d70636c0f68a840243185cd7de1b6 (patch)
tree0d6f58a8b6eee1d758de93abb55b9160660c90cf /extensions/source
parent4ffc989a7dacff3ad6344f43316355a1260840ff (diff)
CWS-TOOLING: integrate CWS dv11
2009-05-13 16:50:24 +0200 dv r271863 : #i101829# Use UPGRADINGPRODUCTCODE to detect major upgrade 2009-04-17 15:55:48 +0200 dv r270953 : CWS-TOOLING: rebase CWS dv11 to trunk@270723 (milestone: DEV300:m46) 2009-04-17 09:14:21 +0200 dv r270916 : #i100915# Use better product name 2009-04-16 14:41:49 +0200 dv r270884 : #i101132# Use a waiting thread to defere update check 2009-04-07 15:46:52 +0200 dv r270599 : #i100915# Use one include file for all version.rc files 2009-04-07 13:49:56 +0200 dv r270596 : #i100915# Use one include file for all version.rc files 2009-04-03 09:04:08 +0200 dv r270447 : #100776# Added Microsoft XML file types to 'Default Applications', cleaned up Application name display in 'Default Applications' 2009-04-01 10:13:28 +0200 dv r270306 : #i100713# Remove instmsia.exe from installation set 2009-03-30 16:35:35 +0200 dv r270240 : CWS-TOOLING: rebase CWS dv11 to trunk@270033 (milestone: DEV300:m45) 2009-03-27 10:24:40 +0100 dv r270138 : #i100410# Show survey after deinstalling OpenOffice.org (Windows only) 2009-03-18 15:05:31 +0100 dv r269679 : #i98780# Use 'Desktop' folder only, if it exists 2009-03-17 11:19:47 +0100 dv r269581 : #i100082# Ignore updates with failed dependencies for automatic update check 2009-03-13 14:37:27 +0100 dv r269479 : #i100082# Use 'value' instead of 'name' to create error message 2009-03-13 10:14:48 +0100 dv r269460 : #i100082# Support better error message when extension manager update finds an incompatible update
Diffstat (limited to 'extensions/source')
-rw-r--r--extensions/source/update/check/updatecheckconfig.cxx13
-rw-r--r--extensions/source/update/check/updatecheckjob.cxx81
2 files changed, 83 insertions, 11 deletions
diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx
index 704b8c4fc065..45a7c15ecb2e 100644
--- a/extensions/source/update/check/updatecheckconfig.cxx
+++ b/extensions/source/update/check/updatecheckconfig.cxx
@@ -6,9 +6,6 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatecheckconfig.cxx,v $
- * $Revision: 1.11 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -213,8 +210,14 @@ rtl::OUString UpdateCheckConfig::getDesktopDirectory()
}
#else
// This should become a desktop specific setting in some system backend ..
- osl::Security().getHomeDir(aRet);
- aRet += rtl::OUString::createFromAscii("/Desktop");
+ rtl::OUString aHomeDir;
+ osl::Security().getHomeDir( aHomeDir );
+ aRet = aHomeDir + rtl::OUString::createFromAscii("/Desktop");
+
+ // Set path to home directory when there is no /Desktop directory
+ osl::Directory aDocumentsDir( aRet );
+ if( osl::FileBase::E_None != aDocumentsDir.open() )
+ aRet = aHomeDir;
#endif
return aRet;
diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx
index 38abc9e28bc5..3bc292e4c8ef 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -51,6 +51,27 @@ namespace uno = com::sun::star::uno ;
namespace
{
+class InitUpdateCheckJobThread : public osl::Thread
+{
+public:
+ InitUpdateCheckJobThread( const uno::Reference< uno::XComponentContext > &xContext,
+ const uno::Sequence< beans::NamedValue > &xParameters );
+
+ virtual void SAL_CALL run();
+ virtual void SAL_CALL onTerminated();
+
+ void showDialog();
+
+protected:
+ ~InitUpdateCheckJobThread();
+
+private:
+ osl::Condition m_aCondition;
+ uno::Reference<uno::XComponentContext> m_xContext;
+ uno::Sequence<beans::NamedValue> m_xParameters;
+ bool m_bShowDialog;
+};
+
class UpdateCheckJob :
public ::cppu::WeakImplHelper2< task::XJob, lang::XServiceInfo >
{
@@ -80,15 +101,64 @@ public:
throw (uno::RuntimeException);
private:
- uno::Reference<uno::XComponentContext> m_xContext;
+ uno::Reference<uno::XComponentContext> m_xContext;
+ InitUpdateCheckJobThread *m_pInitThread;
void handleExtensionUpdates( const uno::Sequence< beans::NamedValue > &rListProp );
};
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+InitUpdateCheckJobThread::InitUpdateCheckJobThread(
+ const uno::Reference< uno::XComponentContext > &xContext,
+ const uno::Sequence< beans::NamedValue > &xParameters ) :
+ m_xContext( xContext ),
+ m_xParameters( xParameters ),
+ m_bShowDialog( false )
+{
+ create();
+}
+
+//------------------------------------------------------------------------------
+InitUpdateCheckJobThread::~InitUpdateCheckJobThread()
+{
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL InitUpdateCheckJobThread::run()
+{
+ TimeValue tv = { 25, 0 };
+
+ m_aCondition.wait( &tv );
+
+ rtl::Reference< UpdateCheck > aController( UpdateCheck::get() );
+ aController->initialize( m_xParameters, m_xContext );
+
+ if ( m_bShowDialog )
+ aController->showDialog( true );
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL InitUpdateCheckJobThread::onTerminated()
+{
+ delete this;
+}
+
+//------------------------------------------------------------------------------
+void InitUpdateCheckJobThread::showDialog()
+{
+ m_bShowDialog = true;
+ m_aCondition.set();
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
UpdateCheckJob::UpdateCheckJob(const uno::Reference<uno::XComponentContext>& xContext) :
- m_xContext(xContext)
+ m_xContext(xContext),
+ m_pInitThread( NULL )
{
}
@@ -141,11 +211,10 @@ UpdateCheckJob::execute(const uno::Sequence<beans::NamedValue>& namedValues)
}
}
}
+
uno::Sequence<beans::NamedValue> aConfig =
getValue< uno::Sequence<beans::NamedValue> > (namedValues, "JobConfig");
-
- rtl::Reference<UpdateCheck> aController(UpdateCheck::get());
- aController->initialize(aConfig, m_xContext);
+ m_pInitThread = new InitUpdateCheckJobThread( m_xContext, aConfig );
/* Determine the way we got invoked here -
* see Developers Guide Chapter "4.7.2 Jobs" to understand the magic
@@ -158,7 +227,7 @@ UpdateCheckJob::execute(const uno::Sequence<beans::NamedValue>& namedValues)
if( ! aEventName.equalsAscii("onFirstVisibleTask") )
{
- aController->showDialog(true);
+ m_pInitThread->showDialog();
}
return uno::Any();