summaryrefslogtreecommitdiff
path: root/extensions/source/update/check
diff options
context:
space:
mode:
authorDirk Voelzke <dv@openoffice.org>2010-04-22 09:14:14 +0200
committerDirk Voelzke <dv@openoffice.org>2010-04-22 09:14:14 +0200
commit812d2fbc2e17ba26b9a12fbb065f80bb879e849b (patch)
tree72b1cd3c3d2958a270699daee522ee1146bb2e88 /extensions/source/update/check
parent5f8c5abf34eb4ee9e975f75195e60e2051c99f14 (diff)
parent1b192bd38a3695cc2965ece438d47d6f74958289 (diff)
dv12: merge with DEV300_m76
Diffstat (limited to 'extensions/source/update/check')
-rw-r--r--extensions/source/update/check/actionlistener.hxx5
-rw-r--r--extensions/source/update/check/download.cxx5
-rw-r--r--extensions/source/update/check/download.hxx5
-rw-r--r--extensions/source/update/check/makefile.mk6
-rw-r--r--extensions/source/update/check/transform.pl6
-rw-r--r--extensions/source/update/check/updatecheck.cxx41
-rw-r--r--extensions/source/update/check/updatecheck.hxx5
-rw-r--r--extensions/source/update/check/updatecheckconfig.cxx2
-rw-r--r--extensions/source/update/check/updatecheckconfig.hxx5
-rw-r--r--extensions/source/update/check/updatecheckconfiglistener.hxx5
-rw-r--r--extensions/source/update/check/updatecheckjob.cxx5
-rw-r--r--extensions/source/update/check/updatehdl.cxx16
-rw-r--r--extensions/source/update/check/updatehdl.hrc5
-rw-r--r--extensions/source/update/check/updatehdl.hxx5
-rw-r--r--extensions/source/update/check/updatehdl.src5
-rw-r--r--extensions/source/update/check/updateinfo.hxx5
-rw-r--r--extensions/source/update/check/updateprotocol.cxx5
-rw-r--r--extensions/source/update/check/updateprotocol.hxx5
-rw-r--r--extensions/source/update/check/updateprotocoltest.cxx5
19 files changed, 58 insertions, 83 deletions
diff --git a/extensions/source/update/check/actionlistener.hxx b/extensions/source/update/check/actionlistener.hxx
index 76f942d402d7..6d90357aef85 100644
--- a/extensions/source/update/check/actionlistener.hxx
+++ b/extensions/source/update/check/actionlistener.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: actionlistener.hxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx
index 76d4b373a329..9e10abf27a0e 100644
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: download.cxx,v $
- * $Revision: 1.7.88.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/download.hxx b/extensions/source/update/check/download.hxx
index 034f39dbe733..ff16ef52f7fb 100644
--- a/extensions/source/update/check/download.hxx
+++ b/extensions/source/update/check/download.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: download.hxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/makefile.mk b/extensions/source/update/check/makefile.mk
index 1824a1f63c7d..b87eb0377803 100644
--- a/extensions/source/update/check/makefile.mk
+++ b/extensions/source/update/check/makefile.mk
@@ -2,14 +2,10 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2008 by Sun Microsystems, Inc.
+# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
-# $RCSfile: makefile.mk,v $
-#
-# $Revision: 1.12 $
-#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/transform.pl b/extensions/source/update/check/transform.pl
index 79859cb455a4..fb452ae0482c 100644
--- a/extensions/source/update/check/transform.pl
+++ b/extensions/source/update/check/transform.pl
@@ -6,14 +6,10 @@ eval 'exec perl -wS $0 ${1+"$@"}'
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2008 by Sun Microsystems, Inc.
+# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
-# $RCSfile: transform.pl,v $
-#
-# $Revision: 1.3 $
-#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx
index 09776f1fc1c4..d89233e88dc2 100644
--- a/extensions/source/update/check/updatecheck.cxx
+++ b/extensions/source/update/check/updatecheck.cxx
@@ -2,12 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatecheck.cxx,v $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -264,7 +262,7 @@ protected:
virtual void SAL_CALL onTerminated();
/* Wrapper around checkForUpdates */
- bool runCheck();
+ bool runCheck( bool & rbExtensionsChecked );
private:
@@ -453,7 +451,7 @@ UpdateCheckThread::cancel()
//------------------------------------------------------------------------------
bool
-UpdateCheckThread::runCheck()
+UpdateCheckThread::runCheck( bool & rbExtensionsChecked )
{
bool ret = false;
UpdateState eUIState = UPDATESTATE_NO_UPDATE_AVAIL;
@@ -474,12 +472,14 @@ UpdateCheckThread::runCheck()
// and when there was no office update found
if ( ( eUIState != UPDATESTATE_UPDATE_AVAIL ) &&
( eUIState != UPDATESTATE_UPDATE_NO_DOWNLOAD ) &&
- !aController->isDialogShowing() )
+ !aController->isDialogShowing() &&
+ !rbExtensionsChecked )
{
bool bHasExtensionUpdates = checkForExtensionUpdates( m_xContext );
aController->setHasExtensionUpdates( bHasExtensionUpdates );
if ( bHasExtensionUpdates )
aController->setUIState( UPDATESTATE_EXT_UPD_AVAIL );
+ rbExtensionsChecked = true;
}
// joining with this thread is safe again
@@ -500,6 +500,11 @@ UpdateCheckThread::onTerminated()
void SAL_CALL
UpdateCheckThread::run()
{
+ bool bExtensionsChecked = false;
+ TimeValue systime;
+ TimeValue nExtCheckTime;
+ osl_getSystemTime( &nExtCheckTime );
+
osl::Condition::Result aResult = osl::Condition::result_timeout;
TimeValue tv = { 10, 0 };
@@ -547,7 +552,6 @@ UpdateCheckThread::run()
if( ! checkNow )
{
- TimeValue systime;
osl_getSystemTime(&systime);
// Go back to sleep until time has elapsed
@@ -563,19 +567,28 @@ UpdateCheckThread::run()
static sal_uInt8 n = 0;
- if( ! hasInternetConnection() || ! runCheck() )
+ if( ! hasInternetConnection() || ! runCheck( bExtensionsChecked ) )
{
- // Increase next by 1, 5, 15, 60, .. minutes
- static const sal_Int16 nRetryInterval[] = { 60, 300, 900, 3600 };
+ // the extension update check should be independent from the office update check
+ //
+ osl_getSystemTime( &systime );
+ if ( nExtCheckTime.Seconds + offset < systime.Seconds )
+ bExtensionsChecked = false;
- if( n < sizeof(nRetryInterval) / sizeof(sal_Int16) )
+ // Increase next by 15, 60, .. minutes
+ static const sal_Int32 nRetryInterval[] = { 900, 3600, 14400, 86400 };
+
+ if( n < sizeof(nRetryInterval) / sizeof(sal_Int32) )
++n;
tv.Seconds = nRetryInterval[n-1];
aResult = m_aCondition.wait(&tv);
}
else // reset retry counter
+ {
n = 0;
+ bExtensionsChecked = false;
+ }
}
}
@@ -591,8 +604,10 @@ UpdateCheckThread::run()
void SAL_CALL
ManualUpdateCheckThread::run()
{
+ bool bExtensionsChecked = false;
+
try {
- runCheck();
+ runCheck( bExtensionsChecked );
m_aCondition.reset();
}
catch(const uno::Exception& e) {
@@ -1571,6 +1586,8 @@ void UpdateCheck::showExtensionDialog()
rtl::Reference<UpdateHandler>
UpdateCheck::getUpdateHandler()
{
+ osl::MutexGuard aGuard(m_aMutex);
+
if( ! m_aUpdateHandler.is() )
m_aUpdateHandler = new UpdateHandler(m_xContext, this);
diff --git a/extensions/source/update/check/updatecheck.hxx b/extensions/source/update/check/updatecheck.hxx
index ff16fc3ed95b..7283288769e0 100644
--- a/extensions/source/update/check/updatecheck.hxx
+++ b/extensions/source/update/check/updatecheck.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatecheck.hxx,v $
- * $Revision: 1.6.70.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx
index 45a7c15ecb2e..b3e559c5f136 100644
--- a/extensions/source/update/check/updatecheckconfig.cxx
+++ b/extensions/source/update/check/updatecheckconfig.cxx
@@ -2,7 +2,7 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
diff --git a/extensions/source/update/check/updatecheckconfig.hxx b/extensions/source/update/check/updatecheckconfig.hxx
index dc66656314dd..bc1fd0987b18 100644
--- a/extensions/source/update/check/updatecheckconfig.hxx
+++ b/extensions/source/update/check/updatecheckconfig.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatecheckconfig.hxx,v $
- * $Revision: 1.9 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updatecheckconfiglistener.hxx b/extensions/source/update/check/updatecheckconfiglistener.hxx
index 6ff0af2fb457..9d2c406b455a 100644
--- a/extensions/source/update/check/updatecheckconfiglistener.hxx
+++ b/extensions/source/update/check/updatecheckconfiglistener.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatecheckconfiglistener.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updatecheckjob.cxx b/extensions/source/update/check/updatecheckjob.cxx
index f64ba851e679..3be38dd9888a 100644
--- a/extensions/source/update/check/updatecheckjob.cxx
+++ b/extensions/source/update/check/updatecheckjob.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatecheckjob.cxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx
index ca9da74d3525..bb38c34a0b4e 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -2,12 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatehdl.cxx,v $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -31,7 +29,7 @@
#include "precompiled_extensions.hxx"
#include "updatehdl.hxx"
-#include "extensio.hrc"
+#include "update.hrc"
#include "osl/diagnose.h"
#include "osl/thread.hxx"
@@ -202,6 +200,10 @@ void UpdateHandler::setVisible( bool bVisible )
if ( !mxUpdDlg.is() )
createDialog();
+ // this should never happen, but if it happens we better return here
+ if ( !mxUpdDlg.is() )
+ return;
+
updateState( meCurState );
uno::Reference< awt::XWindow > xWindow( mxUpdDlg, uno::UNO_QUERY );
@@ -1135,6 +1137,12 @@ void UpdateHandler::showControls( short nControls )
//--------------------------------------------------------------------
void UpdateHandler::createDialog()
{
+ if ( !mxContext.is() )
+ {
+ OSL_ASSERT( false );
+ return;
+ }
+
uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager() );
if( xServiceManager.is() )
diff --git a/extensions/source/update/check/updatehdl.hrc b/extensions/source/update/check/updatehdl.hrc
index 567269f97e52..ad3d472eaf68 100644
--- a/extensions/source/update/check/updatehdl.hrc
+++ b/extensions/source/update/check/updatehdl.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatehdl.hrc,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updatehdl.hxx b/extensions/source/update/check/updatehdl.hxx
index 5a980228b9e2..bd525853dda1 100644
--- a/extensions/source/update/check/updatehdl.hxx
+++ b/extensions/source/update/check/updatehdl.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatehdl.hxx,v $
- * $Revision: 1.5.94.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updatehdl.src b/extensions/source/update/check/updatehdl.src
index 99e4a6dcbf59..58f88b7e4852 100644
--- a/extensions/source/update/check/updatehdl.src
+++ b/extensions/source/update/check/updatehdl.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updatehdl.src,v $
- * $Revision: 1.5 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updateinfo.hxx b/extensions/source/update/check/updateinfo.hxx
index 3de0fcbea24e..3249a59ad7d0 100644
--- a/extensions/source/update/check/updateinfo.hxx
+++ b/extensions/source/update/check/updateinfo.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updateinfo.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updateprotocol.cxx b/extensions/source/update/check/updateprotocol.cxx
index 2794f299928c..5d51ea14cc6f 100644
--- a/extensions/source/update/check/updateprotocol.cxx
+++ b/extensions/source/update/check/updateprotocol.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updateprotocol.cxx,v $
- * $Revision: 1.11.70.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updateprotocol.hxx b/extensions/source/update/check/updateprotocol.hxx
index 92fd663612ac..d99ae9e7af2d 100644
--- a/extensions/source/update/check/updateprotocol.hxx
+++ b/extensions/source/update/check/updateprotocol.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updateprotocol.hxx,v $
- * $Revision: 1.6 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/extensions/source/update/check/updateprotocoltest.cxx b/extensions/source/update/check/updateprotocoltest.cxx
index df1a07430e35..70623cea6224 100644
--- a/extensions/source/update/check/updateprotocoltest.cxx
+++ b/extensions/source/update/check/updateprotocoltest.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: updateprotocoltest.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify