diff options
Diffstat (limited to 'desktop/source/app/lockfile.cxx')
-rw-r--r-- | desktop/source/app/lockfile.cxx | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/desktop/source/app/lockfile.cxx b/desktop/source/app/lockfile.cxx index 514aa65d0b..db23c7db19 100644 --- a/desktop/source/app/lockfile.cxx +++ b/desktop/source/app/lockfile.cxx @@ -86,24 +86,6 @@ static rtl::OString impl_getHostname() namespace desktop { - // initialize static members... - // lock suffix - const OUString Lockfile::Suffix() - { return OUString::createFromAscii( "/.lock" ); } - // values for datafile - const ByteString Lockfile::Group() - { return ByteString( "Lockdata" ); } - const ByteString Lockfile::Userkey() - { return ByteString( "User" ); } - const ByteString Lockfile::Hostkey() - { return ByteString( "Host" ); } - const ByteString Lockfile::Stampkey() - { return ByteString( "Stamp" ); } - const ByteString Lockfile::Timekey() - { return ByteString( "Time" ); } - const ByteString Lockfile::IPCkey() - { return ByteString( "IPCServer" ); } - Lockfile::Lockfile( bool bIPCserver ) :m_bIPCserver(bIPCserver) ,m_bRemove(sal_False) @@ -112,7 +94,7 @@ namespace desktop { // build the file-url to use for the lock OUString aUserPath; utl::Bootstrap::locateUserInstallation( aUserPath ); - m_aLockname = aUserPath + Suffix(); + m_aLockname = aUserPath + LOCKFILE_SUFFIX; // generate ID const int nIdBytes = 16; @@ -182,13 +164,13 @@ namespace desktop { // to assume that it is a stale lockfile which can be overwritten String aLockname = m_aLockname; Config aConfig(aLockname); - aConfig.SetGroup(Group()); - ByteString aIPCserver = aConfig.ReadKey( IPCkey() ); + aConfig.SetGroup(LOCKFILE_GROUP); + ByteString aIPCserver = aConfig.ReadKey( LOCKFILE_IPCKEY ); if (! aIPCserver.EqualsIgnoreCaseAscii( "true" )) return false; - ByteString aHost = aConfig.ReadKey( Hostkey() ); - ByteString aUser = aConfig.ReadKey( Userkey() ); + ByteString aHost = aConfig.ReadKey( LOCKFILE_HOSTKEY ); + ByteString aUser = aConfig.ReadKey( LOCKFILE_USERKEY ); // lockfile from same host? ByteString myHost( impl_getHostname() ); @@ -208,7 +190,7 @@ namespace desktop { { String aLockname = m_aLockname; Config aConfig(aLockname); - aConfig.SetGroup(Group()); + aConfig.SetGroup(LOCKFILE_GROUP); // get information ByteString aHost( impl_getHostname() ); @@ -220,12 +202,12 @@ namespace desktop { ByteString aStamp = OUStringToOString( m_aId, RTL_TEXTENCODING_ASCII_US ); // write information - aConfig.WriteKey( Userkey(), aUser ); - aConfig.WriteKey( Hostkey(), aHost ); - aConfig.WriteKey( Stampkey(), aStamp ); - aConfig.WriteKey( Timekey(), aTime ); + aConfig.WriteKey( LOCKFILE_USERKEY, aUser ); + aConfig.WriteKey( LOCKFILE_HOSTKEY, aHost ); + aConfig.WriteKey( LOCKFILE_STAMPKEY, aStamp ); + aConfig.WriteKey( LOCKFILE_TIMEKEY, aTime ); aConfig.WriteKey( - IPCkey(), + LOCKFILE_IPCKEY, m_bIPCserver ? ByteString("true") : ByteString("false") ); aConfig.Flush( ); } |