Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b1b93020
Kaydet (Commit)
b1b93020
authored
Kas 26, 2009
tarafından
Dirk Völzke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i107166# Make check for extension update independent from office update check
üst
d3af929c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
8 deletions
+25
-8
updatecheck.cxx
extensions/source/update/check/updatecheck.cxx
+25
-8
No files found.
extensions/source/update/check/updatecheck.cxx
Dosyayı görüntüle @
b1b93020
...
@@ -264,7 +264,7 @@ protected:
...
@@ -264,7 +264,7 @@ protected:
virtual
void
SAL_CALL
onTerminated
();
virtual
void
SAL_CALL
onTerminated
();
/* Wrapper around checkForUpdates */
/* Wrapper around checkForUpdates */
bool
runCheck
();
bool
runCheck
(
bool
&
rbExtensionsChecked
);
private
:
private
:
...
@@ -453,7 +453,7 @@ UpdateCheckThread::cancel()
...
@@ -453,7 +453,7 @@ UpdateCheckThread::cancel()
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
bool
UpdateCheckThread
::
runCheck
()
UpdateCheckThread
::
runCheck
(
bool
&
rbExtensionsChecked
)
{
{
bool
ret
=
false
;
bool
ret
=
false
;
UpdateState
eUIState
=
UPDATESTATE_NO_UPDATE_AVAIL
;
UpdateState
eUIState
=
UPDATESTATE_NO_UPDATE_AVAIL
;
...
@@ -474,12 +474,14 @@ UpdateCheckThread::runCheck()
...
@@ -474,12 +474,14 @@ UpdateCheckThread::runCheck()
// and when there was no office update found
// and when there was no office update found
if
(
(
eUIState
!=
UPDATESTATE_UPDATE_AVAIL
)
&&
if
(
(
eUIState
!=
UPDATESTATE_UPDATE_AVAIL
)
&&
(
eUIState
!=
UPDATESTATE_UPDATE_NO_DOWNLOAD
)
&&
(
eUIState
!=
UPDATESTATE_UPDATE_NO_DOWNLOAD
)
&&
!
aController
->
isDialogShowing
()
)
!
aController
->
isDialogShowing
()
&&
!
rbExtensionsChecked
)
{
{
bool
bHasExtensionUpdates
=
checkForExtensionUpdates
(
m_xContext
);
bool
bHasExtensionUpdates
=
checkForExtensionUpdates
(
m_xContext
);
aController
->
setHasExtensionUpdates
(
bHasExtensionUpdates
);
aController
->
setHasExtensionUpdates
(
bHasExtensionUpdates
);
if
(
bHasExtensionUpdates
)
if
(
bHasExtensionUpdates
)
aController
->
setUIState
(
UPDATESTATE_EXT_UPD_AVAIL
);
aController
->
setUIState
(
UPDATESTATE_EXT_UPD_AVAIL
);
rbExtensionsChecked
=
true
;
}
}
// joining with this thread is safe again
// joining with this thread is safe again
...
@@ -500,6 +502,11 @@ UpdateCheckThread::onTerminated()
...
@@ -500,6 +502,11 @@ UpdateCheckThread::onTerminated()
void
SAL_CALL
void
SAL_CALL
UpdateCheckThread
::
run
()
UpdateCheckThread
::
run
()
{
{
bool
bExtensionsChecked
=
false
;
TimeValue
systime
;
TimeValue
nExtCheckTime
;
osl_getSystemTime
(
&
nExtCheckTime
);
osl
::
Condition
::
Result
aResult
=
osl
::
Condition
::
result_timeout
;
osl
::
Condition
::
Result
aResult
=
osl
::
Condition
::
result_timeout
;
TimeValue
tv
=
{
10
,
0
};
TimeValue
tv
=
{
10
,
0
};
...
@@ -547,7 +554,6 @@ UpdateCheckThread::run()
...
@@ -547,7 +554,6 @@ UpdateCheckThread::run()
if
(
!
checkNow
)
if
(
!
checkNow
)
{
{
TimeValue
systime
;
osl_getSystemTime
(
&
systime
);
osl_getSystemTime
(
&
systime
);
// Go back to sleep until time has elapsed
// Go back to sleep until time has elapsed
...
@@ -563,10 +569,16 @@ UpdateCheckThread::run()
...
@@ -563,10 +569,16 @@ UpdateCheckThread::run()
static
sal_uInt8
n
=
0
;
static
sal_uInt8
n
=
0
;
if
(
!
hasInternetConnection
()
||
!
runCheck
()
)
if
(
!
hasInternetConnection
()
||
!
runCheck
(
bExtensionsChecked
)
)
{
{
// Increase next by 1, 5, 15, 60, .. minutes
// the extension update check should be independent from the office update check
static
const
sal_Int16
nRetryInterval
[]
=
{
60
,
300
,
900
,
3600
};
//
osl_getSystemTime
(
&
systime
);
if
(
nExtCheckTime
.
Seconds
+
offset
<
systime
.
Seconds
)
bExtensionsChecked
=
false
;
// Increase next by 15, 60, .. minutes
static
const
sal_Int16
nRetryInterval
[]
=
{
900
,
3600
,
14400
,
86400
};
if
(
n
<
sizeof
(
nRetryInterval
)
/
sizeof
(
sal_Int16
)
)
if
(
n
<
sizeof
(
nRetryInterval
)
/
sizeof
(
sal_Int16
)
)
++
n
;
++
n
;
...
@@ -575,7 +587,10 @@ UpdateCheckThread::run()
...
@@ -575,7 +587,10 @@ UpdateCheckThread::run()
aResult
=
m_aCondition
.
wait
(
&
tv
);
aResult
=
m_aCondition
.
wait
(
&
tv
);
}
}
else
// reset retry counter
else
// reset retry counter
{
n
=
0
;
n
=
0
;
bExtensionsChecked
=
false
;
}
}
}
}
}
...
@@ -591,8 +606,10 @@ UpdateCheckThread::run()
...
@@ -591,8 +606,10 @@ UpdateCheckThread::run()
void
SAL_CALL
void
SAL_CALL
ManualUpdateCheckThread
::
run
()
ManualUpdateCheckThread
::
run
()
{
{
bool
bExtensionsChecked
=
false
;
try
{
try
{
runCheck
();
runCheck
(
bExtensionsChecked
);
m_aCondition
.
reset
();
m_aCondition
.
reset
();
}
}
catch
(
const
uno
::
Exception
&
e
)
{
catch
(
const
uno
::
Exception
&
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment