diff options
author | Elton Chung <elton@layerjet.com> | 2012-02-21 00:39:36 +0800 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-02-21 14:52:56 +0000 |
commit | 4cd2af27cbedc0f59f5a8a3f0a7c27b158b42fce (patch) | |
tree | fce0edd30e45a12fcb764b8d945bbc01f45d8675 | |
parent | 836d98646203e0d9d3916571ed55d6572c2cb3dc (diff) |
fdo#44993: Remove obsolete FSysRedirector
-rw-r--r-- | tools/inc/tools/fsys.hxx | 37 | ||||
-rw-r--r-- | tools/source/fsys/comdep.hxx | 2 | ||||
-rw-r--r-- | tools/source/fsys/dirent.cxx | 64 | ||||
-rw-r--r-- | tools/source/fsys/wntmsc.cxx | 1 | ||||
-rw-r--r-- | tools/source/stream/strmunx.cxx | 1 | ||||
-rw-r--r-- | tools/source/stream/strmwnt.cxx | 1 |
6 files changed, 0 insertions, 106 deletions
diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index 42ddcab27bd5..33ac3cbf56d5 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -422,43 +422,6 @@ public: DirEntry& operator []( size_t nIndex ) const; }; -//======================================================================== - -/** FSysRedirector is an abstract base class for a hook to redirect - mirrored directory trees. - - <P>One instance of a subclass can be instanciated and registered - using the method FSysRedirector::Register(FSysRedirector*). - */ - -class FSysRedirector -{ - static FSysRedirector* _pRedirector; - static sal_Bool _bEnabled; - -public: - //----------------------------------------------------------------------- - /** This method is to be used to redirect a file system path. - - <P>It will not redirect while redirection is disabled. - - <P>It may block while another thread is accessing the redirector - or another thread has disabled redirections. - - @param String &rPath<BR> - This inout-argument accepts a file:-URL even as a native - file system path name to redirect in 'rPath'. It returns the - redirected (modified) path too, which can be of both formats - too. - - @return sal_Bool<BR> - sal_True, if the path is redirected - sal_False, if the path is not redirected (unchanged) - */ - static void DoRedirect( String &rPath ); -}; - - #if defined(DBG_UTIL) void FSysTest(); #endif diff --git a/tools/source/fsys/comdep.hxx b/tools/source/fsys/comdep.hxx index 193041b960a1..3a56549c3b41 100644 --- a/tools/source/fsys/comdep.hxx +++ b/tools/source/fsys/comdep.hxx @@ -76,8 +76,6 @@ struct DirReader_Impl bReady ( sal_False ), bInUse( sal_False ) { - // Redirection - FSysRedirector::DoRedirect( aPath ); // nur den String der Memer-Var nehmen! diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index 3018cf44ab1e..1a60e0c3c0ea 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -128,62 +128,6 @@ int Sys2SolarError_Impl( int nSysErr ) //-------------------------------------------------------------------- -FSysRedirector* FSysRedirector::_pRedirector = 0; -sal_Bool FSysRedirector::_bEnabled = sal_True; -#ifdef UNX -sal_Bool bInRedirection = sal_True; -#else -sal_Bool bInRedirection = sal_False; -#endif -static osl::Mutex* pRedirectMutex = 0; - -//------------------------------------------------------------------------ -void FSysRedirector::DoRedirect( String &rPath ) -{ - String aURL(rPath); - - // if redirection is disabled or not even registered do nothing - if ( !_bEnabled || !pRedirectMutex ) - return; - - // redirect only removable or remote volumes - if (!IsRedirectable_Impl(rtl::OUStringToOString(aURL, osl_getThreadTextEncoding()))) - return; - - // Redirection is acessible only by one thread per time - // dont move the guard behind the bInRedirection check!!! - // think of nested calls (when called from callback) - osl::MutexGuard aGuard( pRedirectMutex ); - - // if already in redirection, dont redirect - if ( bInRedirection ) - return; - - // dont redirect on nested calls - bInRedirection = sal_True; - - // convert to URL -#ifndef UNX - for ( sal_Unicode *p = (sal_Unicode*)aURL.GetBuffer(); *p; ++p ) - if ( '\\' == *p ) *p = '/'; - else if ( ':' == *p ) *p = '|'; -#endif - - aURL.Insert( String("file:///", osl_getThreadTextEncoding()), 0 ); - - // do redirection - if ( !_pRedirector ) - { - pRedirectMutex = new osl::Mutex; - _pRedirector = new FSysRedirector; - } - - bInRedirection = sal_False; - return; -} - -//-------------------------------------------------------------------- - class DirEntryStack { private: @@ -966,7 +910,6 @@ sal_Bool DirEntry::First() FSysFailOnErrorImpl(); String aUniPathName( GetPath().GetFull() ); - FSysRedirector::DoRedirect( aUniPathName ); rtl::OString aPathName(rtl::OUStringToOString(aUniPathName, osl_getThreadTextEncoding())); DIR *pDir = opendir(aPathName.getStr()); @@ -1667,7 +1610,6 @@ DirEntry DirEntry::TempName( DirEntryKind eKind ) const // Redirect String aRetVal(ret_val, osl_getThreadTextEncoding()); String aRedirected (aRetVal); - FSysRedirector::DoRedirect( aRedirected ); if ( FSYS_KIND_DIR == eKind ) { if (0 == _mkdir(rtl::OUStringToOString(aRedirected, osl_getThreadTextEncoding()).getStr())) @@ -1764,7 +1706,6 @@ sal_Bool DirEntry::MakeDir( sal_Bool bSloppy ) const { FSysFailOnErrorImpl(); String aDirName(pNewDir->GetFull()); - FSysRedirector::DoRedirect( aDirName ); rtl::OString bDirName(rtl::OUStringToOString(aDirName, osl_getThreadTextEncoding())); #ifdef WIN32 @@ -1850,12 +1791,8 @@ FSysError DirEntry::MoveTo( const DirEntry& rNewName ) const FSysFailOnErrorImpl(); String aFrom( GetFull() ); - FSysRedirector::DoRedirect(aFrom); - String aTo( aDest.GetFull() ); - FSysRedirector::DoRedirect(aTo); - rtl::OString bFrom(rtl::OUStringToOString(aFrom, osl_getThreadTextEncoding())); rtl::OString bTo(rtl::OUStringToOString(aTo, osl_getThreadTextEncoding())); @@ -1993,7 +1930,6 @@ FSysError DirEntry::Kill( FSysAction nActions ) const // Name als doppelt 0-terminierter String String aTmpName( GetFull() ); - FSysRedirector::DoRedirect( aTmpName ); rtl::OString bTmpName(rtl::OUStringToOString(aTmpName, osl_getThreadTextEncoding())); char *pName = new char[bTmpName.getLength()+2]; diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx index 962fae30ffa5..ef7dba87add9 100644 --- a/tools/source/fsys/wntmsc.cxx +++ b/tools/source/fsys/wntmsc.cxx @@ -666,7 +666,6 @@ sal_Bool FileStat::Update( const DirEntry& rDirEntry, sal_Bool bForceAccess ) // Redirect String aPath( rDirEntry.GetFull() ); - FSysRedirector::DoRedirect( aPath ); DirEntry aDirEntry( aPath ); // ist ein Medium im Laufwerk? diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index 3709f00f4cb0..425a68f66630 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -687,7 +687,6 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode ) // !!! DirEntry aDirEntry( rFilename ); // !!! aFilename = aDirEntry.GetFull(); aFilename = rFilename; - FSysRedirector::DoRedirect( aFilename ); rtl::OString aLocalFilename(rtl::OUStringToOString(aFilename, osl_getThreadTextEncoding())); #ifdef DBG_UTIL diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx index c1c6f1396713..d0d355647919 100644 --- a/tools/source/stream/strmwnt.cxx +++ b/tools/source/stream/strmwnt.cxx @@ -396,7 +396,6 @@ void SvFileStream::Open( const String& rFilename, StreamMode nMode ) // !!! aFilename = aDirEntry.GetFull(); aFilename = aParsedFilename; rtl::OString aFileNameA(rtl::OUStringToOString(aFilename, osl_getThreadTextEncoding())); - FSysRedirector::DoRedirect( aFilename ); SetLastError( ERROR_SUCCESS ); // ggf. durch Redirector geaendert! DWORD nOpenAction; |