@ -43,34 +43,34 @@ extern "C"
}
}
TDEInstance instance ( " tdeio_appinfo " ) ;
TDEInstance instance ( " tdeio_appinfo " ) ;
tdeio_appInfoProtocol slave ( argv [ 2 ] , argv [ 3 ] ) ;
TDEIO_AppInfo slave ( argv [ 2 ] , argv [ 3 ] ) ;
slave . dispatchLoop ( ) ;
slave . dispatchLoop ( ) ;
return 0 ;
return 0 ;
}
}
}
}
tdeio_appInfoProtocol: : tdeio_appInfoProtocol ( const TQCString & pool_socket ,
TDEIO_AppInfo: : TDEIO_AppInfo ( const TQCString & pool_socket , const TQCString & app_socket )
const TQCString & app_socket ) : SlaveBase ( " tdeio_appinfo " , pool_socket , app_socket )
: SlaveBase ( " tdeio_appinfo " , pool_socket , app_socket ) , m_impl ( this )
{
{
kdDebug ( ) < < " tdeio_appInfoProtocol::tdeio_appInfoProtocol ()" < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo::TDEIO_AppInfo ()" < < endl ;
}
}
tdeio_appInfoProtocol: : ~ tdeio_appInfoProtocol ( )
TDEIO_AppInfo: : ~ TDEIO_AppInfo ( )
{
{
kdDebug ( ) < < " tdeio_appInfoProtocol::~tdeio_appInfoProtocol ()" < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo::~TDEIO_AppInfo ()" < < endl ;
}
}
void tdeio_appInfoProtocol : : stat ( const KURL & url )
void TDEIO_AppInfo : : stat ( const KURL & url )
{
{
kdDebug ( ) < < " tdeio_appInfoProtocol ::stat: " < < url < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo ::stat: " < < url < < endl ;
TQString path = url . path ( ) ;
TQString path = url . path ( ) ;
if ( path . isEmpty ( ) | | path = = " / " )
if ( path . isEmpty ( ) | | path = = " / " )
{
{
kdDebug ( ) < < " tdeio_appInfoProtocol ::stat: " < < " creating top level entry " < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo ::stat: " < < " creating top level entry " < < endl ;
// The root is "virtual" - it's not a single physical directory
// The root is "virtual" - it's not a single physical directory
TDEIO : : UDSEntry entry ;
TDEIO : : UDSEntry entry ;
m_impl . createTopLevelEntry ( entry ) ;
m_impl . createTopLevelEntry ( entry ) ;
@ -83,14 +83,14 @@ void tdeio_appInfoProtocol::stat(const KURL &url)
bool ok = m_impl . parseURL ( url , name , path ) ;
bool ok = m_impl . parseURL ( url , name , path ) ;
if ( ! ok )
if ( ! ok )
{
{
kdDebug ( ) < < " tdeio_appInfoProtocol ::stat: " < < " can't parse url " < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo ::stat: " < < " can't parse url " < < endl ;
error ( TDEIO : : ERR_MALFORMED_URL , url . prettyURL ( ) ) ;
error ( TDEIO : : ERR_MALFORMED_URL , url . prettyURL ( ) ) ;
return ;
return ;
}
}
if ( path . isEmpty ( ) )
if ( path . isEmpty ( ) )
{
{
kdDebug ( ) < < " tdeio_appInfoProtocol ::stat: " < < " url empty after parsing " < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo ::stat: " < < " url empty after parsing " < < endl ;
TDEIO : : UDSEntry entry ;
TDEIO : : UDSEntry entry ;
if ( m_impl . statByName ( name , entry ) )
if ( m_impl . statByName ( name , entry ) )
@ -105,18 +105,18 @@ void tdeio_appInfoProtocol::stat(const KURL &url)
}
}
else
else
{
{
kdDebug ( ) < < " tdeio_appInfoProtocol ::stat: " < < " url not empty after parsing: statting " < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo ::stat: " < < " url not empty after parsing: statting " < < endl ;
SlaveBase : : stat ( url ) ;
SlaveBase : : stat ( url ) ;
}
}
}
}
void tdeio_appInfoProtocol : : listDir ( const KURL & url )
void TDEIO_AppInfo : : listDir ( const KURL & url )
{
{
kdDebug ( ) < < " tdeio_appInfoProtocol ::listDir: " < < url < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo ::listDir: " < < url < < endl ;
if ( url . path ( ) . length ( ) < = 1 )
if ( url . path ( ) . length ( ) < = 1 )
{
{
kdDebug ( ) < < " tdeio_appInfoProtocol ::listDir: " < < " url empty: listing root " < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo ::listDir: " < < " url empty: listing root " < < endl ;
listRoot ( ) ;
listRoot ( ) ;
return ;
return ;
}
}
@ -129,33 +129,19 @@ void tdeio_appInfoProtocol::listDir(const KURL &url)
return ;
return ;
}
}
kdDebug ( ) < < " tdeio_appInfoProtocol ::listDir: " < < " name is " < < name < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo ::listDir: " < < " name is " < < name < < endl ;
kdDebug ( ) < < " tdeio_appInfoProtocol ::listDir: " < < " path is " < < path < < endl ;
kdDebug ( ) < < " TDEIO_AppInfo ::listDir: " < < " path is " < < path < < endl ;
// We've been given something like appinfo:/name
// We've been given something like appinfo:/name
listAppContents ( name ) ;
listAppContents ( name ) ;
}
}
void tdeio_appInfoProtocol : : listRoot ( )
void TDEIO_AppInfo : : listRoot ( )
{
{
TDEIO : : UDSEntryList system_entries ;
m_impl . listRoot ( ) ;
bool ok = m_impl . listRoot ( system_entries ) ;
if ( ! ok )
{
error ( m_impl . lastErrorCode ( ) , m_impl . lastErrorMessage ( ) ) ;
return ;
}
totalSize ( system_entries . count ( ) + 1 ) ;
TDEIO : : UDSEntry entry ;
m_impl . createTopLevelEntry ( entry ) ;
listEntry ( entry , false ) ;
listEntries ( system_entries ) ;
finished ( ) ;
}
}
void tdeio_appInfoProtocol : : listAppContents ( const TQString & name )
void TDEIO_AppInfo : : listAppContents ( const TQString & name )
{
{
TDEIO : : UDSEntryList app_entries ;
TDEIO : : UDSEntryList app_entries ;
bool ok = m_impl . listAppContents ( name , app_entries ) ;
bool ok = m_impl . listAppContents ( name , app_entries ) ;