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
3a14fa97
Kaydet (Commit)
3a14fa97
authored
Ara 12, 2012
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clean up configuration access in Desktop::CheckFirstRun
Change-Id: I8765f0939302bd7ed24de4539e682330f4f4d59b
üst
058deb4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
59 deletions
+35
-59
app.cxx
desktop/source/app/app.cxx
+35
-59
No files found.
desktop/source/app/app.cxx
Dosyayı görüntüle @
3a14fa97
...
@@ -66,10 +66,11 @@
...
@@ -66,10 +66,11 @@
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <com/sun/star/frame/XUIControllerRegistration.hpp>
#include <toolkit/unohlp.hxx>
#include <toolkit/unohlp.hxx>
#include <comphelper/configuration.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/confignode.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/moduleoptions.hxx>
#include <officecfg/Office/Common.hxx>
#include <officecfg/Office/Recovery.hxx>
#include <officecfg/Office/Recovery.hxx>
#include <osl/file.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
#include <osl/process.h>
...
@@ -2912,70 +2913,45 @@ void Desktop::ShowBackingComponent(Desktop * progress)
...
@@ -2912,70 +2913,45 @@ void Desktop::ShowBackingComponent(Desktop * progress)
// ========================================================================
// ========================================================================
void
Desktop
::
CheckFirstRun
(
)
void
Desktop
::
CheckFirstRun
(
)
{
{
const
::
rtl
::
OUString
sCommonMiscNodeName
(
"/org.openoffice.Office.Common/Misc"
);
if
(
officecfg
::
Office
::
Common
::
Misc
::
FirstRun
::
get
())
const
::
rtl
::
OUString
sFirstRunNodeName
(
"FirstRun"
);
{
// this has once been done using a vos timer. this could lead to problems when
// --------------------------------------------------------------------
// the timer would trigger when the app is already going down again, since VCL would
// check if this is the first office start
// no longer be available. Since the old handler would do a postUserEvent to the main
// thread anyway, we can use a vcl timer here to prevent the race contition (#107197#)
// for this, open the Common/Misc node where this info is stored
m_firstRunTimer
.
SetTimeout
(
3000
);
// 3 sec.
::
utl
::
OConfigurationTreeRoot
aCommonMisc
=
::
utl
::
OConfigurationTreeRoot
::
createWithServiceFactory
(
m_firstRunTimer
.
SetTimeoutHdl
(
LINK
(
this
,
Desktop
,
AsyncInitFirstRun
));
::
comphelper
::
getProcessServiceFactory
(
),
m_firstRunTimer
.
Start
();
sCommonMiscNodeName
,
2
,
::
utl
::
OConfigurationTreeRoot
::
CM_UPDATABLE
);
// read the flag
OSL_ENSURE
(
aCommonMisc
.
isValid
(),
"Desktop::CheckFirstRun: could not open the config node needed!"
);
sal_Bool
bIsFirstRun
=
sal_False
;
aCommonMisc
.
getNodeValue
(
sFirstRunNodeName
)
>>=
bIsFirstRun
;
if
(
!
bIsFirstRun
)
// nothing to do ....
return
;
// --------------------------------------------------------------------
// it is the first run
// this has once been done using a vos timer. this could lead to problems when
// the timer would trigger when the app is already going down again, since VCL would
// no longer be available. Since the old handler would do a postUserEvent to the main
// thread anyway, we can use a vcl timer here to prevent the race contition (#107197#)
m_firstRunTimer
.
SetTimeout
(
3000
);
// 3 sec.
m_firstRunTimer
.
SetTimeoutHdl
(
LINK
(
this
,
Desktop
,
AsyncInitFirstRun
));
m_firstRunTimer
.
Start
();
#ifdef WNT
#ifdef WNT
// Check if Quckstarter should be started (on Windows only)
// Check if Quckstarter should be started (on Windows only)
TCHAR
szValue
[
8192
];
TCHAR
szValue
[
8192
];
DWORD
nValueSize
=
sizeof
(
szValue
);
DWORD
nValueSize
=
sizeof
(
szValue
);
HKEY
hKey
;
HKEY
hKey
;
if
(
ERROR_SUCCESS
==
RegOpenKey
(
HKEY_LOCAL_MACHINE
,
"Software
\\
LibreOffice"
,
&
hKey
)
)
if
(
ERROR_SUCCESS
==
RegOpenKey
(
HKEY_LOCAL_MACHINE
,
"Software
\\
LibreOffice"
,
&
hKey
)
)
{
if
(
ERROR_SUCCESS
==
RegQueryValueEx
(
hKey
,
TEXT
(
"RunQuickstartAtFirstStart"
),
NULL
,
NULL
,
(
LPBYTE
)
szValue
,
&
nValueSize
)
)
{
{
sal_Bool
bQuickstart
(
sal_True
);
if
(
ERROR_SUCCESS
==
RegQueryValueEx
(
hKey
,
TEXT
(
"RunQuickstartAtFirstStart"
),
NULL
,
NULL
,
(
LPBYTE
)
szValue
,
&
nValueSize
)
)
sal_Bool
bAutostart
(
sal_True
);
{
Sequence
<
Any
>
aSeq
(
2
);
sal_Bool
bQuickstart
(
sal_True
);
aSeq
[
0
]
<<=
bQuickstart
;
sal_Bool
bAutostart
(
sal_True
);
aSeq
[
1
]
<<=
bAutostart
;
Sequence
<
Any
>
aSeq
(
2
);
aSeq
[
0
]
<<=
bQuickstart
;
Reference
<
XInitialization
>
xQuickstart
(
::
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
aSeq
[
1
]
<<=
bAutostart
;
OUString
::
createFromAscii
(
"com.sun.star.office.Quickstart"
)),
UNO_QUERY
);
if
(
xQuickstart
.
is
()
)
Reference
<
XInitialization
>
xQuickstart
(
::
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
xQuickstart
->
initialize
(
aSeq
);
OUString
::
createFromAscii
(
"com.sun.star.office.Quickstart"
)),
UNO_QUERY
);
RegCloseKey
(
hKey
);
if
(
xQuickstart
.
is
()
)
xQuickstart
->
initialize
(
aSeq
);
RegCloseKey
(
hKey
);
}
}
}
}
#endif
#endif
// --------------------------------------------------------------------
boost
::
shared_ptr
<
comphelper
::
ConfigurationChanges
>
batch
(
// reset the config flag
comphelper
::
ConfigurationChanges
::
create
());
officecfg
::
Office
::
Common
::
Misc
::
FirstRun
::
set
(
false
,
batch
);
// set the value
batch
->
commit
();
aCommonMisc
.
setNodeValue
(
sFirstRunNodeName
,
makeAny
(
(
sal_Bool
)
sal_False
)
);
}
// commit the changes
aCommonMisc
.
commit
();
}
}
}
}
...
...
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