@ -45,7 +45,7 @@
# include "klocateconfigfilterwidget.h"
# include "klocateconfiglocatewidget.h"
using namespace K IO;
using namespace TDE IO;
static const TQString queryQuery = " q " ;
@ -202,26 +202,26 @@ static const UDSEntry pathToUDSEntry(const TQString& path, const TQString& displ
const TQString & url = TQString ( ) , const TQString & icon = TQString ( ) )
{
UDSEntry entry ;
addAtom ( entry , K IO: : UDS_NAME , display ) ;
addAtom ( entry , TDE IO: : UDS_NAME , display ) ;
if ( ! path . isEmpty ( ) ) {
KDE_struct_stat info ;
KDE_lstat ( path . local8Bit ( ) , & info ) ;
addAtom ( entry , K IO: : UDS_SIZE , info . st_size ) ;
addAtom ( entry , K IO: : UDS_ACCESS , info . st_mode ) ;
addAtom ( entry , K IO: : UDS_MODIFICATION_TIME , info . st_mtime ) ;
addAtom ( entry , K IO: : UDS_ACCESS_TIME , info . st_atime ) ;
addAtom ( entry , K IO: : UDS_CREATION_TIME , info . st_ctime ) ;
addAtom ( entry , TDE IO: : UDS_SIZE , info . st_size ) ;
addAtom ( entry , TDE IO: : UDS_ACCESS , info . st_mode ) ;
addAtom ( entry , TDE IO: : UDS_MODIFICATION_TIME , info . st_mtime ) ;
addAtom ( entry , TDE IO: : UDS_ACCESS_TIME , info . st_atime ) ;
addAtom ( entry , TDE IO: : UDS_CREATION_TIME , info . st_ctime ) ;
struct passwd * user = getpwuid ( info . st_uid ) ;
struct group * group = getgrgid ( info . st_gid ) ;
addAtom ( entry , K IO: : UDS_USER , ( ( user ! = NULL ) ? user - > pw_name : " ??? " ) ) ;
addAtom ( entry , K IO: : UDS_GROUP , ( ( group ! = NULL ) ? group - > gr_name : " ??? " ) ) ;
addAtom ( entry , TDE IO: : UDS_USER , ( ( user ! = NULL ) ? user - > pw_name : " ??? " ) ) ;
addAtom ( entry , TDE IO: : UDS_GROUP , ( ( group ! = NULL ) ? group - > gr_name : " ??? " ) ) ;
if ( url . isEmpty ( ) ) {
// List an existing file.
addAtom ( entry , K IO: : UDS_URL , " file: " + path ) ;
addAtom ( entry , TDE IO: : UDS_URL , " file: " + path ) ;
mode_t type = info . st_mode ;
if ( S_ISLNK ( type ) ) {
@ -232,28 +232,28 @@ static const UDSEntry pathToUDSEntry(const TQString& path, const TQString& displ
buff [ n ] = 0 ;
slink = buff ;
}
addAtom ( entry , K IO: : UDS_LINK_DEST , slink ) ;
addAtom ( entry , TDE IO: : UDS_LINK_DEST , slink ) ;
} else {
type & = S_IFMT ;
}
addAtom ( entry , K IO: : UDS_FILE_TYPE , type ) ;
addAtom ( entry , TDE IO: : UDS_FILE_TYPE , type ) ;
# ifdef HAVE_UDS_HIDDEN
if ( path . contains ( " /. " ) ) {
addAtom ( entry , K IO: : UDS_HIDDEN , 1 ) ;
addAtom ( entry , TDE IO: : UDS_HIDDEN , 1 ) ;
}
# endif
} else {
// List a locate link.
addAtom ( entry , K IO: : UDS_URL , url ) ;
addAtom ( entry , K IO: : UDS_FILE_TYPE , S_IFDIR ) ;
addAtom ( entry , TDE IO: : UDS_URL , url ) ;
addAtom ( entry , TDE IO: : UDS_FILE_TYPE , S_IFDIR ) ;
}
} else {
addAtom ( entry , K IO: : UDS_URL , url ) ;
addAtom ( entry , TDE IO: : UDS_URL , url ) ;
}
if ( ! icon . isEmpty ( ) ) {
addAtom ( entry , K IO: : UDS_ICON_NAME , icon ) ;
addAtom ( entry , TDE IO: : UDS_ICON_NAME , icon ) ;
}
return entry ;
@ -346,7 +346,7 @@ void LocateProtocol::get(const KURL& url)
if ( isSearchRequest ( ) ) {
if ( m_locater . binaryExists ( ) ) {
error ( K IO: : ERR_IS_DIRECTORY , TQString ( ) ) ;
error ( TDE IO: : ERR_IS_DIRECTORY , TQString ( ) ) ;
} else {
TQString html = i18n ( " <h1> \" %1 \" could not be started.</h1><p>Please note that kio-locate can't be used on its own. You need an additional program for doing searches. Typically this is the command line tool <i>locate</i> that can be found in many distributions by default. You can check if the correct tool is used by looking at the <a href= \" locater:config \" >setting</a> \" Locate Binary \" .<p>Besides the mentioned tool <i>locate</i>, kio-locate can use any tool that uses the same syntax. In particular, it was reported to work with <i>slocate</i> and <i>rlocate</i>. " ) . arg ( m_locater . binary ( ) ) ;
outputHtml ( html ) ;
@ -357,7 +357,7 @@ void LocateProtocol::get(const KURL& url)
helpRequest ( ) ;
} else {
// What's this?
error ( K IO: : ERR_DOES_NOT_EXIST , TQString ( ) ) ;
error ( TDE IO: : ERR_DOES_NOT_EXIST , TQString ( ) ) ;
}
}
@ -373,15 +373,15 @@ void LocateProtocol::stat(const KURL& url)
/// \todo Is UDS_NAME used for anything in stat? If so we should
/// at least strip of the protocol part.
UDSEntry entry ;
addAtom ( entry , K IO: : UDS_NAME , url . decode_string ( url . url ( ) ) ) ;
addAtom ( entry , K IO: : UDS_FILE_TYPE , isDir ? S_IFDIR : S_IFREG ) ;
addAtom ( entry , TDE IO: : UDS_NAME , url . decode_string ( url . url ( ) ) ) ;
addAtom ( entry , TDE IO: : UDS_FILE_TYPE , isDir ? S_IFDIR : S_IFREG ) ;
statEntry ( entry ) ;
finished ( ) ;
/// \todo Somehow locate: and locate:/ is thought to be a directory
/// by konqueror anyway. How to change this?
} else {
// What's this?
error ( K IO: : ERR_DOES_NOT_EXIST , TQString ( ) ) ;
error ( TDE IO: : ERR_DOES_NOT_EXIST , TQString ( ) ) ;
}
}
@ -395,10 +395,10 @@ void LocateProtocol::listDir(const KURL& url)
if ( isSearchRequest ( ) ) {
searchRequest ( ) ;
} else if ( isConfigRequest ( ) | | isHelpRequest ( ) ) {
error ( K IO: : ERR_IS_FILE , TQString ( ) ) ;
error ( TDE IO: : ERR_IS_FILE , TQString ( ) ) ;
} else {
// What's this?
error ( K IO: : ERR_DOES_NOT_EXIST , TQString ( ) ) ;
error ( TDE IO: : ERR_DOES_NOT_EXIST , TQString ( ) ) ;
}
}
@ -764,10 +764,10 @@ void LocateProtocol::configRequest()
m_configUpdated = false ;
// Don't show it twice. During my tests I never got there however.
if ( K ConfigDialog: : showDialog ( " settings " ) )
if ( TDE ConfigDialog: : showDialog ( " settings " ) )
return ;
KConfigDialog * dialog = new K ConfigDialog( 0 , " settings " , KLocateConfig : : self ( ) ,
TDEConfigDialog * dialog = new TDE ConfigDialog( 0 , " settings " , KLocateConfig : : self ( ) ,
KDialogBase : : IconList ,
KDialogBase : : Default | KDialogBase : : Ok | KDialogBase : : Cancel | KDialogBase : : Help ,
KDialogBase : : Ok , true ) ;