|
|
|
@ -98,7 +98,7 @@ static TQString convertWildcardsToRegExp(TQString s)
|
|
|
|
|
// Walk through the string, converting \wildcard to regexp and
|
|
|
|
|
// \\\wildcard back to \wildcard.
|
|
|
|
|
for (unsigned i = 1; i < s.length(); ++i) {
|
|
|
|
|
//DEBUGSTR << s.left(i+1) << endl;
|
|
|
|
|
//kdDebug(7134) << s.left(i+1) << endl;
|
|
|
|
|
if (i < 3 || s[i-3] != '\\' || s[i-2] != '\\') {
|
|
|
|
|
// If it was an unescaped character (now possibly escaped once)
|
|
|
|
|
if (s[i-1] == '\\') {
|
|
|
|
@ -266,7 +266,7 @@ static const UDSEntry pathToUDSEntry(const TQString& path, const TQString& displ
|
|
|
|
|
LocateProtocol::LocateProtocol(const TQCString &pool_socket, const TQCString &app_socket)
|
|
|
|
|
: SlaveBase("tdeio_locate", pool_socket, app_socket)
|
|
|
|
|
{
|
|
|
|
|
DEBUGSTR << "LocateProtocol::LocateProtocol()" << endl;
|
|
|
|
|
kdDebug(7134) << "LocateProtocol::LocateProtocol()" << endl;
|
|
|
|
|
|
|
|
|
|
connect(&m_locater, TQT_SIGNAL(found(const TQStringList&)),
|
|
|
|
|
this, TQT_SLOT(processLocateOutput(const TQStringList&)));
|
|
|
|
@ -280,7 +280,7 @@ LocateProtocol::LocateProtocol(const TQCString &pool_socket, const TQCString &ap
|
|
|
|
|
|
|
|
|
|
LocateProtocol::~LocateProtocol()
|
|
|
|
|
{
|
|
|
|
|
DEBUGSTR << "LocateProtocol::~LocateProtocol()" << endl;
|
|
|
|
|
kdDebug(7134) << "LocateProtocol::~LocateProtocol()" << endl;
|
|
|
|
|
|
|
|
|
|
delete m_baseDir;
|
|
|
|
|
}
|
|
|
|
@ -330,7 +330,7 @@ void LocateProtocol::setUrl(const KURL& url)
|
|
|
|
|
}
|
|
|
|
|
m_url = newUrl;
|
|
|
|
|
|
|
|
|
|
DEBUGSTR << "Redirect: " << m_url << endl;
|
|
|
|
|
kdDebug(7134) << "Redirect: " << m_url << endl;
|
|
|
|
|
} else {
|
|
|
|
|
m_url = url;
|
|
|
|
|
}
|
|
|
|
@ -340,7 +340,7 @@ void LocateProtocol::setUrl(const KURL& url)
|
|
|
|
|
|
|
|
|
|
void LocateProtocol::get(const KURL& url)
|
|
|
|
|
{
|
|
|
|
|
DEBUGSTR << "LocateProtocol::get(" << url << ")" << endl;
|
|
|
|
|
kdDebug(7134) << "LocateProtocol::get(" << url << ")" << endl;
|
|
|
|
|
|
|
|
|
|
setUrl(url);
|
|
|
|
|
|
|
|
|
@ -364,7 +364,7 @@ void LocateProtocol::get(const KURL& url)
|
|
|
|
|
|
|
|
|
|
void LocateProtocol::stat(const KURL& url)
|
|
|
|
|
{
|
|
|
|
|
DEBUGSTR << "LocateProtocol::stat(" << url << ")" << endl ;
|
|
|
|
|
kdDebug(7134) << "LocateProtocol::stat(" << url << ")" << endl ;
|
|
|
|
|
|
|
|
|
|
setUrl(url);
|
|
|
|
|
|
|
|
|
@ -388,7 +388,7 @@ void LocateProtocol::stat(const KURL& url)
|
|
|
|
|
|
|
|
|
|
void LocateProtocol::listDir(const KURL& url)
|
|
|
|
|
{
|
|
|
|
|
DEBUGSTR << "LocateProtocol::listDir(" << url << ")" << endl ;
|
|
|
|
|
kdDebug(7134) << "LocateProtocol::listDir(" << url << ")" << endl ;
|
|
|
|
|
|
|
|
|
|
setUrl(url);
|
|
|
|
|
|
|
|
|
@ -405,7 +405,7 @@ void LocateProtocol::listDir(const KURL& url)
|
|
|
|
|
|
|
|
|
|
void LocateProtocol::mimetype(const KURL& url)
|
|
|
|
|
{
|
|
|
|
|
DEBUGSTR << "LocateProtocol::mimetype(" << url << ")" << endl ;
|
|
|
|
|
kdDebug(7134) << "LocateProtocol::mimetype(" << url << ")" << endl ;
|
|
|
|
|
|
|
|
|
|
setUrl(url);
|
|
|
|
|
|
|
|
|
@ -505,8 +505,8 @@ void LocateProtocol::searchRequest()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DEBUGSTR << "Pattern: " << m_locatePattern << endl;
|
|
|
|
|
DEBUGSTR << "Directory: " << m_locateDirectory << endl;
|
|
|
|
|
kdDebug(7134) << "Pattern: " << m_locatePattern << endl;
|
|
|
|
|
kdDebug(7134) << "Directory: " << m_locateDirectory << endl;
|
|
|
|
|
|
|
|
|
|
// We set up the regexp used to see whether the match was in the
|
|
|
|
|
// directory part or the filename part of a path.
|
|
|
|
@ -518,7 +518,7 @@ void LocateProtocol::searchRequest()
|
|
|
|
|
bool started = m_locater.locate(m_locatePattern, !isCaseSensitive(m_locatePattern), regexp);
|
|
|
|
|
|
|
|
|
|
if (!started) {
|
|
|
|
|
DEBUGSTR << "Locate could not be found." << endl;
|
|
|
|
|
kdDebug(7134) << "Locate could not be found." << endl;
|
|
|
|
|
finished();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -542,7 +542,7 @@ bool LocateProtocol::isCaseSensitive(const TQString& text)
|
|
|
|
|
|
|
|
|
|
void LocateProtocol::addHit(const TQString& path, int subItems)
|
|
|
|
|
{
|
|
|
|
|
// DEBUGSTR << "LocateProtocol::addHit( " << path << ", " << subItems << " )" << endl;
|
|
|
|
|
// kdDebug(7134) << "LocateProtocol::addHit( " << path << ", " << subItems << " )" << endl;
|
|
|
|
|
if (TQFile::exists(path)) {
|
|
|
|
|
if (subItems > 0) {
|
|
|
|
|
m_entries += pathToUDSEntry(path, pathToDisplay(path, subItems), makeLocaterUrl(path), iconToStringTable[m_config.m_collapsedIcon]);
|
|
|
|
@ -632,7 +632,7 @@ void LocateProtocol::locateFinished()
|
|
|
|
|
}
|
|
|
|
|
addPreviousLocateOutput();
|
|
|
|
|
|
|
|
|
|
DEBUGSTR << "LocateProtocol::locateFinished" << endl;
|
|
|
|
|
kdDebug(7134) << "LocateProtocol::locateFinished" << endl;
|
|
|
|
|
infoMessage(i18n("Finished."));
|
|
|
|
|
finished();
|
|
|
|
|
}
|
|
|
|
@ -640,7 +640,7 @@ void LocateProtocol::locateFinished()
|
|
|
|
|
|
|
|
|
|
TQString LocateProtocol::partToPattern(const TQString& part, bool forLocate)
|
|
|
|
|
{
|
|
|
|
|
DEBUGSTR << "BEG part: " << part << endl;
|
|
|
|
|
kdDebug(7134) << "BEG part: " << part << endl;
|
|
|
|
|
TQString pattern = part;
|
|
|
|
|
// Unescape whitespace.
|
|
|
|
|
pattern.replace("\\ ", " ");
|
|
|
|
@ -690,7 +690,7 @@ TQString LocateProtocol::partToPattern(const TQString& part, bool forLocate)
|
|
|
|
|
}
|
|
|
|
|
pattern.replace("\\~", "~");
|
|
|
|
|
}
|
|
|
|
|
DEBUGSTR << "END part: " << pattern << endl;
|
|
|
|
|
kdDebug(7134) << "END part: " << pattern << endl;
|
|
|
|
|
return pattern;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -790,7 +790,7 @@ void LocateProtocol::configRequest()
|
|
|
|
|
|
|
|
|
|
void LocateProtocol::configFinished()
|
|
|
|
|
{
|
|
|
|
|
DEBUGSTR << "LocateProtocol::configFinished" << endl;
|
|
|
|
|
kdDebug(7134) << "LocateProtocol::configFinished" << endl;
|
|
|
|
|
|
|
|
|
|
tqApp->exit_loop();
|
|
|
|
|
|
|
|
|
@ -807,7 +807,7 @@ void LocateProtocol::configFinished()
|
|
|
|
|
void LocateProtocol::updateConfig()
|
|
|
|
|
{
|
|
|
|
|
// It's not needed to update the config if it's still up to date.
|
|
|
|
|
DEBUGSTR << "LocateProtocol::updateConfig" << endl;
|
|
|
|
|
kdDebug(7134) << "LocateProtocol::updateConfig" << endl;
|
|
|
|
|
|
|
|
|
|
KLocateConfig::self()->readConfig();
|
|
|
|
|
m_config.m_caseSensitivity = (LocateCaseSensitivity) KLocateConfig::caseSensitivity();
|
|
|
|
@ -982,10 +982,10 @@ void LocateDirectory::debugTrace(int level)
|
|
|
|
|
{
|
|
|
|
|
TQString ws;
|
|
|
|
|
ws.fill(' ', level);
|
|
|
|
|
DEBUGSTR << ws << m_path << endl;
|
|
|
|
|
kdDebug(7134) << ws << m_path << endl;
|
|
|
|
|
LocateItems::ConstIterator item = m_items.begin();
|
|
|
|
|
for (; item != m_items.end(); ++item) {
|
|
|
|
|
DEBUGSTR << ws << "+ " << (*item).m_path << endl;
|
|
|
|
|
kdDebug(7134) << ws << "+ " << (*item).m_path << endl;
|
|
|
|
|
}
|
|
|
|
|
LocateDirectoriesIterator child(m_childs);
|
|
|
|
|
for (; child.current(); ++child) {
|
|
|
|
@ -1020,17 +1020,17 @@ extern "C"
|
|
|
|
|
TDEApplication::disableAutoDcopRegistration();
|
|
|
|
|
TDEApplication app(argc, argv, "tdeio_locate", false, true, false);
|
|
|
|
|
|
|
|
|
|
DEBUGSTR << "*** Starting tdeio_locate " << endl;
|
|
|
|
|
kdDebug(7134) << "*** Starting tdeio_locate " << endl;
|
|
|
|
|
|
|
|
|
|
if (argc != 4) {
|
|
|
|
|
DEBUGSTR << "Usage: tdeio_locate protocol domain-socket1 domain-socket2" << endl;
|
|
|
|
|
kdDebug(7134) << "Usage: tdeio_locate protocol domain-socket1 domain-socket2" << endl;
|
|
|
|
|
exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LocateProtocol slave(argv[2], argv[3]);
|
|
|
|
|
slave.dispatchLoop();
|
|
|
|
|
|
|
|
|
|
DEBUGSTR << "*** tdeio_locate Done" << endl;
|
|
|
|
|
kdDebug(7134) << "*** tdeio_locate Done" << endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|