@ -36,7 +36,7 @@
# include <klocale.h>
# include <kurl.h>
# include <kuser.h>
# include < qfile.h>
# include < t qfile.h>
# include "kio_locate.h"
# include "klocateconfig.h"
@ -47,12 +47,12 @@
using namespace KIO ;
static const QString queryQuery = " q " ;
static const QString queryDirectory = " directory " ;
static const QString queryCase = " case " ;
static const QString queryRegExp = " regexp " ;
static const T QString queryQuery = " q " ;
static const T QString queryDirectory = " directory " ;
static const T QString queryCase = " case " ;
static const T QString queryRegExp = " regexp " ;
static const QString iconToStringTable [ ] = {
static const T QString iconToStringTable [ ] = {
" folder " , " folder_green " , " folder_grey " , " folder_orange " ,
" folder_red " , " folder_violet " , " folder_yellow "
} ;
@ -67,7 +67,7 @@ static const QString iconToStringTable[] = {
* For older versions of Konqueror : + behaves identical to *
* @ param s the string to inspect
*/
static bool hasWildcards ( const QString& s )
static bool hasWildcards ( const T QString& s )
{
for ( unsigned int i = 0 ; i < s . length ( ) ; + + i ) {
if ( ( s [ i ] = = ' * ' | | s [ i ] = = ' + ' | | s [ i ] = = ' ? ' | | s [ i ] = = ' [ ' | | s [ i ] = = ' ] ' ) & & ( i < 1 | | s [ i - 1 ] ! = ' \\ ' ) )
@ -84,7 +84,7 @@ static bool hasWildcards(const QString& s)
* @ param s the string to convert
* @ return the converted string
*/
static QString convertWildcardsToRegExp ( QString s )
static T QString convertWildcardsToRegExp ( T QString s )
{
bool in_set = false ;
@ -92,7 +92,7 @@ static QString convertWildcardsToRegExp(QString s)
// (Konqueror makes passing chars like "/" almost impossible anyway.)
// Note that this converts actual wildcards to escaped wildcards (\wildcard),
// and escaped wildcards to 'triple'-escaped wildcards (\\\wildcard).
s = QRegExp: : escape ( s ) ;
s = T QRegExp: : escape ( s ) ;
// Walk through the string, converting \wildcard to regexp and
// \\\wildcard back to \wildcard.
@ -144,7 +144,7 @@ static QString convertWildcardsToRegExp(QString s)
* Determines if path includes a trailing slash .
* @ param path the path to inspect
*/
static bool hasTrailingSlash ( const QString& path )
static bool hasTrailingSlash ( const T QString& path )
{
int n = path . length ( ) ;
return ( ( n > 0 ) & & ( path [ n - 1 ] = = ' / ' ) ) ;
@ -155,7 +155,7 @@ static bool hasTrailingSlash(const QString& path)
* Strips a trailing slash / from a path .
* @ param path the path to strip the slash off
*/
static QString stripTrailingSlash ( const QString& path )
static T QString stripTrailingSlash ( const T QString& path )
{
int n = path . length ( ) ;
if ( ( n > 0 ) & & ( path [ n - 1 ] = = ' / ' ) ) {
@ -169,7 +169,7 @@ static QString stripTrailingSlash(const QString& path)
* Add a trailing slash / to a path if there is none yet .
* @ param path the path to append the slash to
*/
static QString addTrailingSlash ( const QString& path )
static T QString addTrailingSlash ( const T QString& path )
{
int n = path . length ( ) ;
if ( ( n > 0 ) & & ( path [ n - 1 ] = = ' / ' ) ) {
@ -179,7 +179,7 @@ static QString addTrailingSlash(const QString& path)
}
static void addAtom ( UDSEntry & entry , unsigned int uds , const QString& s )
static void addAtom ( UDSEntry & entry , unsigned int uds , const T QString& s )
{
UDSAtom a ;
a . m_uds = uds ;
@ -197,8 +197,8 @@ static void addAtom(UDSEntry& entry, unsigned int uds, long l)
}
static const UDSEntry pathToUDSEntry ( const QString& path , const QString& display ,
const QString& url = QString: : null , const QString & icon = QString : : null )
static const UDSEntry pathToUDSEntry ( const T QString& path , const T QString& display ,
const T QString& url = TQString( ) , const TQString & icon = TQString ( ) )
{
UDSEntry entry ;
addAtom ( entry , KIO : : UDS_NAME , display ) ;
@ -224,7 +224,7 @@ static const UDSEntry pathToUDSEntry(const QString& path, const QString& display
mode_t type = info . st_mode ;
if ( S_ISLNK ( type ) ) {
QString slink = QString : : null ;
TQString slink = TQString ( ) ;
char buff [ 1000 ] ;
int n = readlink ( path , buff , 1000 ) ;
if ( n ! = - 1 ) {
@ -238,7 +238,7 @@ static const UDSEntry pathToUDSEntry(const QString& path, const QString& display
addAtom ( entry , KIO : : UDS_FILE_TYPE , type ) ;
# ifdef HAVE_UDS_HIDDEN
if ( path . contains( " /. " ) ) {
if ( path . tq contains( " /. " ) ) {
addAtom ( entry , KIO : : UDS_HIDDEN , 1 ) ;
}
# endif
@ -262,15 +262,15 @@ static const UDSEntry pathToUDSEntry(const QString& path, const QString& display
/////////////////////////////////////////////////////////////////////
// INITIALIZATION
LocateProtocol : : LocateProtocol ( const QCString & pool_socket , const QCString & app_socket )
LocateProtocol : : LocateProtocol ( const T QCString & pool_socket , const T QCString & app_socket )
: SlaveBase ( " kio_locate " , pool_socket , app_socket )
{
DEBUGSTR < < " LocateProtocol::LocateProtocol() " < < endl ;
connect ( & m_locater , SIGNAL( found ( const QStringList& ) ) ,
this , SLOT( processLocateOutput ( const QStringList& ) ) ) ;
connect ( & m_locater , SIGNAL( finished ( ) ) ,
this , SLOT( locateFinished ( ) ) ) ;
connect ( & m_locater , TQT_ SIGNAL( found ( const T QStringList& ) ) ,
this , TQT_ SLOT( processLocateOutput ( const T QStringList& ) ) ) ;
connect ( & m_locater , TQT_ SIGNAL( finished ( ) ) ,
this , TQT_ SLOT( locateFinished ( ) ) ) ;
m_baseDir = NULL ;
m_curDir = NULL ;
@ -303,7 +303,7 @@ int LocateProtocol::getCollapseDirectoryThreshold() const
void LocateProtocol : : setUrl ( const KURL & url )
{
if ( url . protocol ( ) ! = " locater " ) {
QString pattern = KURL : : decode_string ( url . url ( ) ) ;
T QString pattern = KURL : : decode_string ( url . url ( ) ) ;
pattern = pattern . mid ( url . protocol ( ) . length ( ) + 1 ) ;
KURL newUrl ;
@ -345,9 +345,9 @@ void LocateProtocol::get(const KURL& url)
if ( isSearchRequest ( ) ) {
if ( m_locater . binaryExists ( ) ) {
error ( KIO : : ERR_IS_DIRECTORY , QString: : null ) ;
error ( KIO : : ERR_IS_DIRECTORY , TQString( ) ) ;
} else {
QString 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 ( ) ) ;
T QString 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>. " ) . tq arg( m_locater . binary ( ) ) ;
outputHtml ( html ) ;
}
} else if ( isConfigRequest ( ) ) {
@ -356,7 +356,7 @@ void LocateProtocol::get(const KURL& url)
helpRequest ( ) ;
} else {
// What's this?
error ( KIO : : ERR_DOES_NOT_EXIST , QString: : null ) ;
error ( KIO : : ERR_DOES_NOT_EXIST , TQString( ) ) ;
}
}
@ -380,7 +380,7 @@ void LocateProtocol::stat(const KURL& url)
/// by konqueror anyway. How to change this?
} else {
// What's this?
error ( KIO : : ERR_DOES_NOT_EXIST , QString: : null ) ;
error ( KIO : : ERR_DOES_NOT_EXIST , TQString( ) ) ;
}
}
@ -394,10 +394,10 @@ void LocateProtocol::listDir(const KURL& url)
if ( isSearchRequest ( ) ) {
searchRequest ( ) ;
} else if ( isConfigRequest ( ) | | isHelpRequest ( ) ) {
error ( KIO : : ERR_IS_FILE , QString: : null ) ;
error ( KIO : : ERR_IS_FILE , TQString( ) ) ;
} else {
// What's this?
error ( KIO : : ERR_DOES_NOT_EXIST , QString: : null ) ;
error ( KIO : : ERR_DOES_NOT_EXIST , TQString( ) ) ;
}
}
@ -421,11 +421,11 @@ void LocateProtocol::mimetype(const KURL& url)
}
void LocateProtocol : : outputHtml ( const QString& body )
void LocateProtocol : : outputHtml ( const T QString& body )
{
mimeType ( " text/html " ) ;
QString theData = " <html><body> " + body + " </body></html> " ;
T QString theData = " <html><body> " + body + " </body></html> " ;
data ( theData . local8Bit ( ) ) ;
finished ( ) ;
}
@ -445,10 +445,10 @@ void LocateProtocol::searchRequest()
// Reset old values.
m_caseSensitivity = caseAuto ;
m_useRegExp = false ;
m_locatePattern = QString: : null ;
m_locateDirectory = QString: : null ;
m_locatePattern = TQString( ) ;
m_locateDirectory = TQString( ) ;
m_regExps . clear ( ) ;
m_pendingPath = QString: : null ;
m_pendingPath = TQString( ) ;
delete m_baseDir ;
m_baseDir = NULL ;
@ -456,17 +456,17 @@ void LocateProtocol::searchRequest()
updateConfig ( ) ;
QString query = m_url . queryItem ( queryQuery ) ;
T QString query = m_url . queryItem ( queryQuery ) ;
m_locateDirectory = addTrailingSlash ( m_url . queryItem ( queryDirectory ) ) ;
QString caseSensitivity = m_url . queryItem ( queryCase ) ;
T QString caseSensitivity = m_url . queryItem ( queryCase ) ;
if ( caseSensitivity = = " sensitive " ) {
m_caseSensitivity = caseSensitive ;
} else if ( caseSensitivity = = " insensitive " ) {
m_caseSensitivity = caseInsensitive ;
}
QString useRegExp = m_url . queryItem ( queryRegExp ) ;
T QString useRegExp = m_url . queryItem ( queryRegExp ) ;
if ( ! useRegExp . isEmpty ( ) & & useRegExp ! = " 0 " ) {
m_useRegExp = true ;
}
@ -480,12 +480,12 @@ void LocateProtocol::searchRequest()
int s = 0 ;
int n = query . length ( ) ;
bool regexp ;
QString display ;
T QString display ;
for ( int i = 0 ; i < = n ; i + + ) {
if ( ( i = = n ) | | ( ( query [ i ] = = ' ' ) & & ( i > 0 )
& & ( query [ i - 1 ] ! = ' \\ ' ) & & ( i - s > 0 ) ) ) {
QString temp = query . mid ( s , i - s ) ;
QString part = partToPattern ( temp , s = = 0 ) ;
T QString temp = query . mid ( s , i - s ) ;
T QString part = partToPattern ( temp , s = = 0 ) ;
if ( s = = 0 ) {
// We don't want to show the escaped regexpified string to
// the user, so we store the string we get in for later display.
@ -512,7 +512,7 @@ void LocateProtocol::searchRequest()
m_locateRegExp = LocateRegExp ( convertWildcardsToRegExp ( m_locatePattern ) , ! isCaseSensitive ( m_locatePattern ) ) ;
// Now perform the search...
infoMessage ( i18n ( " Locating %1 ... " ) . arg( display ) ) ;
infoMessage ( i18n ( " Locating %1 ... " ) . tq arg( display ) ) ;
bool started = m_locater . locate ( m_locatePattern , ! isCaseSensitive ( m_locatePattern ) , regexp ) ;
@ -523,7 +523,7 @@ void LocateProtocol::searchRequest()
}
bool LocateProtocol : : isCaseSensitive ( const QString& text )
bool LocateProtocol : : isCaseSensitive ( const T QString& text )
{
if ( m_caseSensitivity = = caseSensitive ) {
return true ;
@ -539,10 +539,10 @@ bool LocateProtocol::isCaseSensitive(const QString& text)
}
void LocateProtocol : : addHit ( const QString& path , int subItems )
void LocateProtocol : : addHit ( const T QString& path , int subItems )
{
// DEBUGSTR << "LocateProtocol::addHit( " << path << ", " << subItems << " )" << endl;
if ( QFile: : exists ( path ) ) {
if ( T QFile: : exists ( path ) ) {
if ( subItems > 0 ) {
m_entries + = pathToUDSEntry ( path , pathToDisplay ( path , subItems ) , makeLocaterUrl ( path ) , iconToStringTable [ m_config . m_collapsedIcon ] ) ;
} else {
@ -574,7 +574,7 @@ void LocateProtocol::addPreviousLocateOutput()
}
void LocateProtocol : : processPath ( const QString & path , const QString & nextPath )
void LocateProtocol : : processPath ( const T QString & path , const T QString & nextPath )
{
if ( ! nextPath ) {
// We need to know the next path, so we remember this path for later processing.
@ -586,8 +586,8 @@ void LocateProtocol::processPath(const QString &path, const QString &nextPath)
}
// Add path to current directory.
if ( m_baseDir = = NULL ) {
int p = path . find( ' / ' , 1 ) ;
QString base = path ;
int p = path . tq find( ' / ' , 1 ) ;
T QString base = path ;
if ( p > = 0 ) {
base = path . left ( p + 1 ) ;
}
@ -600,7 +600,7 @@ void LocateProtocol::processPath(const QString &path, const QString &nextPath)
}
void LocateProtocol : : processLocateOutput ( const QStringList& items )
void LocateProtocol : : processLocateOutput ( const T QStringList& items )
{
// I don't know if this really necessary, but if we were signaled, we'll
// better stop.
@ -609,15 +609,15 @@ void LocateProtocol::processLocateOutput(const QStringList& items)
return ;
}
// Go through what we have found.
QStringList: : ConstIterator it = items . begin ( ) ;
T QStringList: : ConstIterator it = items . begin ( ) ;
if ( m_pendingPath ) {
processPath ( m_pendingPath , * it ) ;
m_pendingPath = QString: : null ;
m_pendingPath = TQString( ) ;
}
for ( ; it ! = items . end ( ) ; ) {
QString path = * it ;
T QString path = * it ;
+ + it ;
processPath ( path , it ! = items . end ( ) ? * it : QString: : null ) ;
processPath ( path , it ! = items . end ( ) ? * it : TQString( ) ) ;
}
}
@ -627,7 +627,7 @@ void LocateProtocol::locateFinished()
// Add any pending items.
if ( m_pendingPath ) {
processPath ( m_pendingPath , " " ) ;
m_pendingPath = QString: : null ;
m_pendingPath = TQString( ) ;
}
addPreviousLocateOutput ( ) ;
@ -637,12 +637,12 @@ void LocateProtocol::locateFinished()
}
QString LocateProtocol : : partToPattern ( const QString& part , bool forLocate )
T QString LocateProtocol : : partToPattern ( const T QString& part , bool forLocate )
{
DEBUGSTR < < " BEG part: " < < part < < endl ;
QString pattern = part ;
T QString pattern = part ;
// Unescape whitespace.
pattern . replace( " \\ " , " " ) ;
pattern . tq replace( " \\ " , " " ) ;
// Unquote quoted pattern.
int n = pattern . length ( ) , index ;
if ( ( n > 1 ) & & ( pattern [ 0 ] = = ' " ' ) & & ( pattern [ n - 1 ] = = ' " ' ) ) {
@ -651,7 +651,7 @@ QString LocateProtocol::partToPattern(const QString& part, bool forLocate)
// We can't do regular expression matching on the locate pattern,
// the regular expression format used by locate is incompatible
// with the format used by QRegExp.
// with the format used by T QRegExp.
if ( ! m_useRegExp | | forLocate ) {
// Escape regexp characters for filtering pattern, and for locate,
// but the latter only if it is actually necessary to pass a regexp to locate.
@ -661,11 +661,11 @@ QString LocateProtocol::partToPattern(const QString& part, bool forLocate)
} else {
// Special case for locate pattern without wildcards:
// Unescape all escaped wildcards.
pattern . replace( " \\ * " , " * " ) ;
pattern . replace( " \\ + " , " + " ) ;
pattern . replace( " \\ ? " , " ? " ) ;
pattern . replace( " \\ [ " , " [ " ) ;
pattern . replace( " \\ ] " , " ] " ) ;
pattern . tq replace( " \\ * " , " * " ) ;
pattern . tq replace( " \\ + " , " + " ) ;
pattern . tq replace( " \\ ? " , " ? " ) ;
pattern . tq replace( " \\ [ " , " [ " ) ;
pattern . tq replace( " \\ ] " , " ] " ) ;
}
}
@ -673,28 +673,28 @@ QString LocateProtocol::partToPattern(const QString& part, bool forLocate)
if ( forLocate ) {
// Replace ~/ and ~user/ at the beginning (as the shell does)
if ( ( pattern . length ( ) > 0 ) & & ( pattern [ 0 ] = = ' ~ ' ) ) {
index = pattern . find( ' / ' ) ;
index = pattern . tq find( ' / ' ) ;
if ( index > = 0 ) {
QString name = pattern . mid ( 1 , index - 1 ) ;
QString homeDir ;
T QString name = pattern . mid ( 1 , index - 1 ) ;
T QString homeDir ;
if ( name . isEmpty ( ) ) {
homeDir = KUser ( KUser : : UseRealUserID ) . homeDir ( ) ;
} else {
homeDir = KUser ( name ) . homeDir ( ) ;
}
if ( ! homeDir . isEmpty ( ) ) {
pattern . replace( 0 , index , homeDir ) ;
pattern . tq replace( 0 , index , homeDir ) ;
}
}
}
pattern . replace( " \\ ~ " , " ~ " ) ;
pattern . tq replace( " \\ ~ " , " ~ " ) ;
}
DEBUGSTR < < " END part: " < < pattern < < endl ;
return pattern ;
}
bool LocateProtocol : : isMatching ( const QString& path )
bool LocateProtocol : : isMatching ( const T QString& path )
{
// The file has to belong to our directory.
if ( ! path . startsWith ( m_locateDirectory ) ) {
@ -717,28 +717,28 @@ bool LocateProtocol::isMatching(const QString& path)
}
QString LocateProtocol : : pathToDisplay ( const QString& path , int subItems )
T QString LocateProtocol : : pathToDisplay ( const T QString& path , int subItems )
{
// Split off the directory part. If it is not just the minimal '/'.
QString display = path ;
T QString display = path ;
if ( ( m_locateDirectory ! = " / " ) & & display . startsWith ( m_locateDirectory ) ) {
display = display . mid ( m_locateDirectory . length ( ) ) ;
}
if ( subItems > 0 ) {
// Can't use m_collapsedDisplay. arg(subItems).arg(display); here
// Can't use m_collapsedDisplay. tq arg(subItems).tq arg(display); here
// because user might forget to type %1 or %2, or type it twice.
// In both cases the result of arg() is undefined.
QString output = m_config . m_collapsedDisplay , temp ;
T QString output = m_config . m_collapsedDisplay , temp ;
temp . setNum ( subItems ) ;
output . replace( " %1 " , temp ) ;
output . replace( " %2 " , display ) ;
output . tq replace( " %1 " , temp ) ;
output . tq replace( " %2 " , display ) ;
display = output ;
}
return display ;
}
QString LocateProtocol : : makeLocaterUrl ( const QString& directory )
T QString LocateProtocol : : makeLocaterUrl ( const T QString& directory )
{
KURL url ( m_url ) ;
url . removeQueryItem ( queryDirectory ) ;
@ -771,18 +771,18 @@ void LocateProtocol::configRequest()
KDialogBase : : Default | KDialogBase : : Ok | KDialogBase : : Cancel | KDialogBase : : Help ,
KDialogBase : : Ok , true ) ;
dialog - > setCaption ( i18n ( " Configure - kio-locate " ) ) ;
dialog - > setIcon ( SmallIcon ( " find" ) ) ;
dialog - > setIcon ( SmallIcon ( " tq find" ) ) ;
dialog - > addPage ( new KLocateConfigWidget ( ) , i18n ( " General " ) , " package_settings " ) ;
dialog - > addPage ( new KLocateConfigFilterWidget ( ) , i18n ( " Filters " ) , " filter " ) ;
dialog - > addPage ( new KLocateConfigLocateWidget ( ) , i18n ( " Locate " ) , " find" ) ;
dialog - > addPage ( new KLocateConfigLocateWidget ( ) , i18n ( " Locate " ) , " tq find" ) ;
// React on user's actions.
connect ( dialog , SIGNAL( settingsChanged ( ) ) , this , SLOT( updateConfig ( ) ) ) ;
connect ( dialog , SIGNAL( finished ( ) ) , this , SLOT( configFinished ( ) ) ) ;
connect ( dialog , TQT_ SIGNAL( settingsChanged ( ) ) , this , TQT_ SLOT( updateConfig ( ) ) ) ;
connect ( dialog , TQT_ SIGNAL( finished ( ) ) , this , TQT_ SLOT( configFinished ( ) ) ) ;
dialog - > show ( ) ;
qApp- > enter_loop ( ) ;
t qApp- > enter_loop ( ) ;
delete dialog ;
}
@ -791,9 +791,9 @@ void LocateProtocol::configFinished()
{
DEBUGSTR < < " LocateProtocol::configFinished " < < endl ;
qApp- > exit_loop ( ) ;
t qApp- > exit_loop ( ) ;
QString html ;
T QString html ;
if ( m_configUpdated ) {
html = i18n ( " Configuration succesfully updated. " ) ;
} else {
@ -843,20 +843,20 @@ void LocateProtocol::helpRequest()
/////////////////////////////////////////////////////////////////////
// SEARCH STRUCTURES
LocateDirectory : : LocateDirectory ( LocateDirectory * parent, const QString& path )
LocateDirectory : : LocateDirectory ( LocateDirectory * tq parent, const T QString& path )
{
m_parent = parent;
m_parent = tq parent;
m_path = path ;
m_childs . setAutoDelete ( true ) ;
m_itemsCount = 0 ;
}
LocateDirectory * LocateDirectory : : addPath ( const QString& path )
LocateDirectory * LocateDirectory : : addPath ( const T QString& path )
{
if ( path . startsWith ( m_path ) ) {
QString relPath = path . mid ( m_path . length ( ) ) ;
int p = relPath . findRev( ' / ' ) ;
T QString relPath = path . mid ( m_path . length ( ) ) ;
int p = relPath . tq findRev( ' / ' ) ;
if ( p > = 0 ) {
LocateDirectory * child = getSubDirectory ( relPath . left ( p ) ) ;
child - > addItem ( relPath . mid ( p + 1 ) ) ;
@ -873,14 +873,14 @@ LocateDirectory *LocateDirectory::addPath(const QString& path)
}
LocateDirectory * LocateDirectory : : getSubDirectory ( const QString& relPath )
LocateDirectory * LocateDirectory : : getSubDirectory ( const T QString& relPath )
{
QString base = relPath ;
int p = relPath . find( ' / ' ) ;
T QString base = relPath ;
int p = relPath . tq find( ' / ' ) ;
if ( p > = 0 ) {
base = relPath . left ( p ) ;
}
LocateDirectory * child = m_childs . find( base ) ;
LocateDirectory * child = m_childs . tq find( base ) ;
if ( child = = NULL ) {
child = new LocateDirectory ( this , addTrailingSlash ( m_path + base ) ) ;
m_childs . insert ( base , child ) ;
@ -892,7 +892,7 @@ LocateDirectory *LocateDirectory::getSubDirectory(const QString& relPath)
}
void LocateDirectory : : addItem ( const QString& path )
void LocateDirectory : : addItem ( const T QString& path )
{
m_items + = LocateItem ( m_path + path , 0 ) ;
m_itemsCount + + ;
@ -929,20 +929,20 @@ void LocateDirectory::prepareListing(const LocateProtocol* protocol, int skip)
m_fullCount = countMatchingItems ( protocol , newSkip ) ;
// Collapse if directory part matches.
LocateDirectory * parent = m_parent ;
if ( parent = = NULL ) {
parent = this ;
LocateDirectory * tq parent = m_parent ;
if ( tq parent = = NULL ) {
tq parent = this ;
}
if ( n > skip & & protocol - > getRegExp ( ) . isMatching ( m_path . mid ( skip ) ) ) {
// Directory part matches.
m_childs . clear ( ) ;
m_items . clear ( ) ;
m_itemsCount = 0 ;
parent- > m_items + = LocateItem ( m_path , m_fullCount ) ;
+ + parent- > m_itemsCount ;
tq parent- > m_items + = LocateItem ( m_path , m_fullCount ) ;
+ + tq parent- > m_itemsCount ;
if ( m_fullCount ! = 0 ) {
parent- > m_items + = LocateItem ( m_path , 0 ) ;
+ + parent- > m_itemsCount ;
tq parent- > m_items + = LocateItem ( m_path , 0 ) ;
+ + tq parent- > m_itemsCount ;
}
}
@ -958,7 +958,7 @@ void LocateDirectory::prepareListing(const LocateProtocol* protocol, int skip)
+ + m_itemsCount ;
}
} else {
// Propagate items to parent.
// Propagate items to tq parent.
// (only root LocateDirectory runs listItems)
if ( m_parent ! = NULL ) {
m_parent - > m_items + = m_items ;
@ -979,7 +979,7 @@ void LocateDirectory::listItems(LocateProtocol *protocol)
void LocateDirectory : : debugTrace ( int level )
{
QString ws ;
T QString ws ;
ws . fill ( ' ' , level ) ;
DEBUGSTR < < ws < < m_path < < endl ;
LocateItems : : ConstIterator item = m_items . begin ( ) ;
@ -998,7 +998,7 @@ LocateItem::LocateItem()
}
LocateItem : : LocateItem ( const QString& path , int subItems )
LocateItem : : LocateItem ( const T QString& path , int subItems )
{
m_path = path ;
m_subItems = subItems ;