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
40544014
Kaydet (Commit)
40544014
authored
Ara 17, 2010
tarafından
Hans-Joachim Lankenau
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
CWS-TOOLING: integrate CWS dv22
üst
b13f1c43
6ae418e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
34 deletions
+87
-34
updatecheckconfig.cxx
extensions/source/update/check/updatecheckconfig.cxx
+74
-27
updatecheckconfig.hxx
extensions/source/update/check/updatecheckconfig.hxx
+7
-3
updateprotocol.cxx
extensions/source/update/check/updateprotocol.cxx
+6
-4
No files found.
extensions/source/update/check/updatecheckconfig.cxx
100644 → 100755
Dosyayı görüntüle @
40544014
...
...
@@ -32,10 +32,8 @@
#include "updatecheckconfig.hxx"
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#ifndef _COM_SUN_STAR_CONTAINER_CHANGESEVENT_HPP_
#include <com/sun/star/beans/XPropertyState.hpp>
#endif
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <osl/security.hxx>
#include <osl/time.h>
...
...
@@ -78,6 +76,8 @@ namespace uno = com::sun::star::uno ;
#define RELEASE_NOTE "ReleaseNote"
#define EXTENSION_PREFIX "Extension_"
#define PROPERTY_VERSION UNISTRING("Version")
static
const
sal_Char
*
const
aUpdateEntryProperties
[]
=
{
UPDATE_VERSION
,
UPDATE_BUILDID
,
...
...
@@ -246,19 +246,19 @@ rtl::OUString UpdateCheckConfig::getAllUsersDirectory()
}
//------------------------------------------------------------------------------
UpdateCheckConfig
::
UpdateCheckConfig
(
const
uno
::
Reference
<
container
::
XNameContainer
>&
xContainer
,
const
::
rtl
::
Reference
<
UpdateCheckConfigListener
>&
rListener
)
:
m_xContainer
(
xContainer
),
m_rListener
(
rListener
)
{
}
UpdateCheckConfig
::
UpdateCheckConfig
(
const
uno
::
Reference
<
container
::
XNameContainer
>&
xContainer
,
const
uno
::
Reference
<
container
::
XNameContainer
>&
xAvailableUpdates
,
const
uno
::
Reference
<
container
::
XNameContainer
>&
xIgnoredUpdates
,
const
::
rtl
::
Reference
<
UpdateCheckConfigListener
>&
rListener
)
:
m_xContainer
(
xContainer
),
m_xAvailableUpdates
(
xAvailableUpdates
),
m_xIgnoredUpdates
(
xIgnoredUpdates
),
m_rListener
(
rListener
)
{}
//------------------------------------------------------------------------------
UpdateCheckConfig
::~
UpdateCheckConfig
()
{
}
{}
//------------------------------------------------------------------------------
...
...
@@ -295,7 +295,15 @@ UpdateCheckConfig::get(
UNISTRING
(
"com.sun.star.configuration.ConfigurationUpdateAccess"
),
aArgumentList
),
uno
::
UNO_QUERY_THROW
);
return
new
UpdateCheckConfig
(
xContainer
,
rListener
);
aProperty
.
Value
=
uno
::
makeAny
(
UNISTRING
(
"/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/IgnoredUpdates"
)
);
aArgumentList
[
0
]
=
uno
::
makeAny
(
aProperty
);
uno
::
Reference
<
container
::
XNameContainer
>
xIgnoredExt
(
xConfigProvider
->
createInstanceWithArguments
(
UNISTRING
(
"com.sun.star.configuration.ConfigurationUpdateAccess"
),
aArgumentList
),
uno
::
UNO_QUERY_THROW
);
aProperty
.
Value
=
uno
::
makeAny
(
UNISTRING
(
"/org.openoffice.Office.ExtensionManager/ExtensionUpdateData/AvailableUpdates"
)
);
aArgumentList
[
0
]
=
uno
::
makeAny
(
aProperty
);
uno
::
Reference
<
container
::
XNameContainer
>
xUpdateAvail
(
xConfigProvider
->
createInstanceWithArguments
(
UNISTRING
(
"com.sun.star.configuration.ConfigurationUpdateAccess"
),
aArgumentList
),
uno
::
UNO_QUERY_THROW
);
return
new
UpdateCheckConfig
(
xContainer
,
xUpdateAvail
,
xIgnoredExt
,
rListener
);
}
//------------------------------------------------------------------------------
...
...
@@ -627,6 +635,19 @@ UpdateCheckConfig::commitChanges()
}
}
}
xChangesBatch
=
uno
::
Reference
<
util
::
XChangesBatch
>
(
m_xAvailableUpdates
,
uno
::
UNO_QUERY
);
if
(
xChangesBatch
.
is
()
&&
xChangesBatch
->
hasPendingChanges
()
)
{
util
::
ChangesSet
aChangesSet
=
xChangesBatch
->
getPendingChanges
();
xChangesBatch
->
commitChanges
();
}
xChangesBatch
=
uno
::
Reference
<
util
::
XChangesBatch
>
(
m_xIgnoredUpdates
,
uno
::
UNO_QUERY
);
if
(
xChangesBatch
.
is
()
&&
xChangesBatch
->
hasPendingChanges
()
)
{
util
::
ChangesSet
aChangesSet
=
xChangesBatch
->
getPendingChanges
();
xChangesBatch
->
commitChanges
();
}
}
//------------------------------------------------------------------------------
...
...
@@ -654,40 +675,66 @@ UpdateCheckConfig::getPendingChanges( ) throw (uno::RuntimeException)
}
//------------------------------------------------------------------------------
void
UpdateCheckConfig
::
storeExtensionVersion
(
const
rtl
::
OUString
&
rExtensionName
,
bool
UpdateCheckConfig
::
storeExtensionVersion
(
const
rtl
::
OUString
&
rExtensionName
,
const
rtl
::
OUString
&
rVersion
)
{
const
rtl
::
OUString
aExtName
=
UNISTRING
(
EXTENSION_PREFIX
)
+
rExtensionName
;
const
uno
::
Any
aValue
=
uno
::
makeAny
(
rVersion
);
bool
bNotify
=
true
;
if
(
m_xContainer
->
hasByName
(
aExt
Name
)
)
m_xContainer
->
replaceByName
(
aExtName
,
aValue
);
if
(
m_xAvailableUpdates
->
hasByName
(
rExtension
Name
)
)
uno
::
Reference
<
beans
::
XPropertySet
>
(
m_xAvailableUpdates
->
getByName
(
rExtensionName
),
uno
::
UNO_QUERY_THROW
)
->
setPropertyValue
(
PROPERTY_VERSION
,
uno
::
Any
(
rVersion
)
);
else
m_xContainer
->
insertByName
(
aExtName
,
aValue
);
{
uno
::
Reference
<
beans
::
XPropertySet
>
elem
(
uno
::
Reference
<
lang
::
XSingleServiceFactory
>
(
m_xAvailableUpdates
,
uno
::
UNO_QUERY_THROW
)
->
createInstance
(),
uno
::
UNO_QUERY_THROW
);
elem
->
setPropertyValue
(
PROPERTY_VERSION
,
uno
::
Any
(
rVersion
)
);
m_xAvailableUpdates
->
insertByName
(
rExtensionName
,
uno
::
Any
(
elem
)
);
}
if
(
m_xIgnoredUpdates
->
hasByName
(
rExtensionName
)
)
{
::
rtl
::
OUString
aIgnoredVersion
;
uno
::
Any
aValue
(
uno
::
Reference
<
beans
::
XPropertySet
>
(
m_xIgnoredUpdates
->
getByName
(
rExtensionName
),
uno
::
UNO_QUERY_THROW
)
->
getPropertyValue
(
PROPERTY_VERSION
)
);
aValue
>>=
aIgnoredVersion
;
if
(
aIgnoredVersion
.
getLength
()
==
0
)
// no version means ignore all updates
bNotify
=
false
;
else
if
(
aIgnoredVersion
==
rVersion
)
// the user wanted to ignore this update
bNotify
=
false
;
}
commitChanges
();
return
bNotify
;
}
//------------------------------------------------------------------------------
bool
UpdateCheckConfig
::
checkExtensionVersion
(
const
rtl
::
OUString
&
rExtensionName
,
const
rtl
::
OUString
&
rVersion
)
{
const
rtl
::
OUString
aExtName
=
UNISTRING
(
EXTENSION_PREFIX
)
+
rExtensionName
;
if
(
m_xContainer
->
hasByName
(
aExtName
)
)
if
(
m_xAvailableUpdates
->
hasByName
(
rExtensionName
)
)
{
uno
::
Any
aValue
=
m_xContainer
->
getByName
(
aExtName
)
;
rtl
::
OUString
aStoredVersion
;
::
rtl
::
OUString
aStoredVersion
;
uno
::
Any
aValue
(
uno
::
Reference
<
beans
::
XPropertySet
>
(
m_xAvailableUpdates
->
getByName
(
rExtensionName
),
uno
::
UNO_QUERY_THROW
)
->
getPropertyValue
(
PROPERTY_VERSION
)
)
;
aValue
>>=
aStoredVersion
;
if
(
m_xIgnoredUpdates
->
hasByName
(
rExtensionName
)
)
{
::
rtl
::
OUString
aIgnoredVersion
;
uno
::
Any
aValue2
(
uno
::
Reference
<
beans
::
XPropertySet
>
(
m_xIgnoredUpdates
->
getByName
(
rExtensionName
),
uno
::
UNO_QUERY_THROW
)
->
getPropertyValue
(
PROPERTY_VERSION
)
);
aValue2
>>=
aIgnoredVersion
;
if
(
aIgnoredVersion
.
getLength
()
==
0
)
// no version means ignore all updates
return
false
;
else
if
(
aIgnoredVersion
==
aStoredVersion
)
// the user wanted to ignore this update
return
false
;
// TODO: else delete ignored entry?
}
if
(
isVersionGreater
(
rVersion
,
aStoredVersion
)
)
return
true
;
else
{
m_x
Container
->
removeByName
(
aExt
Name
);
m_x
AvailableUpdates
->
removeByName
(
rExtension
Name
);
commitChanges
();
}
}
return
false
;
}
...
...
extensions/source/update/check/updatecheckconfig.hxx
100644 → 100755
Dosyayı görüntüle @
40544014
...
...
@@ -93,8 +93,10 @@ class UpdateCheckConfig : public ::cppu::WeakImplHelper3<
::
com
::
sun
::
star
::
util
::
XChangesBatch
,
::
com
::
sun
::
star
::
lang
::
XServiceInfo
>
{
UpdateCheckConfig
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XNameContainer
>&
xContainer
,
const
::
rtl
::
Reference
<
UpdateCheckConfigListener
>&
rListener
);
UpdateCheckConfig
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XNameContainer
>&
xContainer
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XNameContainer
>&
xAvailableUpdates
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XNameContainer
>&
xIgnoredUpdates
,
const
::
rtl
::
Reference
<
UpdateCheckConfigListener
>&
rListener
);
virtual
~
UpdateCheckConfig
();
...
...
@@ -154,7 +156,7 @@ public:
static
rtl
::
OUString
getAllUsersDirectory
();
// store and retrieve information about extensions
void
storeExtensionVersion
(
const
rtl
::
OUString
&
rExtensionName
,
bool
storeExtensionVersion
(
const
rtl
::
OUString
&
rExtensionName
,
const
rtl
::
OUString
&
rVersion
);
bool
checkExtensionVersion
(
const
rtl
::
OUString
&
rExtensionName
,
const
rtl
::
OUString
&
rVersion
);
...
...
@@ -205,6 +207,8 @@ private:
static
bool
isVersionGreater
(
const
rtl
::
OUString
&
rVersion1
,
const
rtl
::
OUString
&
rVersion2
);
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XNameContainer
>
m_xContainer
;
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XNameContainer
>
m_xAvailableUpdates
;
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XNameContainer
>
m_xIgnoredUpdates
;
const
::
rtl
::
Reference
<
UpdateCheckConfigListener
>
m_rListener
;
};
...
...
extensions/source/update/check/updateprotocol.cxx
100644 → 100755
Dosyayı görüntüle @
40544014
...
...
@@ -255,16 +255,18 @@ checkForUpdates(
bool
storeExtensionUpdateInfos
(
const
uno
::
Reference
<
uno
::
XComponentContext
>
&
rxContext
,
const
uno
::
Sequence
<
uno
::
Sequence
<
rtl
::
OUString
>
>
&
rUpdateInfos
)
{
bool
bNotify
=
false
;
if
(
rUpdateInfos
.
hasElements
()
)
{
rtl
::
Reference
<
UpdateCheckConfig
>
aConfig
=
UpdateCheckConfig
::
get
(
rxContext
);
for
(
sal_Int32
i
=
rUpdateInfos
.
getLength
()
-
1
;
i
>=
0
;
i
--
)
{
aConfig
->
storeExtensionVersion
(
rUpdateInfos
[
i
][
0
],
rUpdateInfos
[
i
][
1
]
);
bNotify
|=
aConfig
->
storeExtensionVersion
(
rUpdateInfos
[
i
][
0
],
rUpdateInfos
[
i
][
1
]
);
}
}
return
rUpdateInfos
.
hasElements
()
;
return
bNotify
;
}
//------------------------------------------------------------------------------
...
...
@@ -289,9 +291,9 @@ bool checkForExtensionUpdates( const uno::Reference< uno::XComponentContext > &
if
(
!
xInfoProvider
.
is
()
)
return
false
;
aUpdateList
=
xInfoProvider
->
isUpdateAvailable
(
::
rtl
::
OUString
()
);
storeExtensionUpdateInfos
(
rxContext
,
aUpdateList
);
bool
bNotify
=
storeExtensionUpdateInfos
(
rxContext
,
aUpdateList
);
return
aUpdateList
.
hasElements
()
;
return
bNotify
;
}
//------------------------------------------------------------------------------
...
...
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