diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeL10n.txt | 9 | ||||
-rw-r--r-- | src/CMakeLists.txt | 15 | ||||
-rw-r--r-- | src/locate.desktop | 3 | ||||
-rw-r--r-- | src/locate.protocol | 9 | ||||
-rw-r--r-- | src/locater.cpp | 18 | ||||
-rw-r--r-- | src/locater.h | 3 | ||||
-rw-r--r-- | src/locater.protocol | 9 | ||||
-rw-r--r-- | src/rlocate.protocol | 9 | ||||
-rw-r--r-- | src/tdeio_locate.cpp | 46 |
9 files changed, 68 insertions, 53 deletions
diff --git a/src/CMakeL10n.txt b/src/CMakeL10n.txt index b95d5c5..ab9a2bc 100644 --- a/src/CMakeL10n.txt +++ b/src/CMakeL10n.txt @@ -1,3 +1,10 @@ ##### create translation templates ############## -tde_l10n_create_template( "tdeio-locate" ) +tde_l10n_create_template( "messages/tdeio-locate" ) + +tde_l10n_create_template( + CATALOG "desktop_files/tdeio-locate-desktops" + SOURCES + *.desktop + *.protocol +) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0e58011..7943241 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,10 +25,17 @@ link_directories( ##### other data ################################ -install( FILES locate.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES locater.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES rlocate.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES locate.desktop DESTINATION ${SERVICES_INSTALL_DIR}/searchproviders ) +tde_create_translated_desktop( + SOURCE + locate.protocol + locater.protocol + rlocate.protocol + DESTINATION ${SERVICES_INSTALL_DIR} +) +tde_create_translated_desktop( + SOURCE locate.desktop + DESTINATION ${SERVICES_INSTALL_DIR}/searchproviders +) ##### tdeio_locate ############################## diff --git a/src/locate.desktop b/src/locate.desktop index a218ffa..000c7ed 100644 --- a/src/locate.desktop +++ b/src/locate.desktop @@ -1,7 +1,8 @@ [Desktop Entry] +Name=locate - Search for local files + Encoding=UTF-8 Type=Service -Name=locate - Search for local files X-TDE-ServiceTypes=SearchProvider Keys=locate Query=locate:\\{@} diff --git a/src/locate.protocol b/src/locate.protocol index c9d6057..c69bcc1 100644 --- a/src/locate.protocol +++ b/src/locate.protocol @@ -1,12 +1,13 @@ [Protocol] -exec=tdeio_locate +Description=TDE I/O Slave for the locate command + protocol=locate +Icon=edit-find +exec=tdeio_locate input=none output=filesystem listing=Name,Type,Size,Date,AccessDate,Access,Owner,Group,Link reading=true -Icon=edit-find -Description=TDE I/O Slave for the locate command # Using this will e.g. display previews etc. Class=:local @@ -15,4 +16,4 @@ Class=:local URIMode=rawuri # Our very sophisticated documentation -X-DocPath=tdeio-locate/index.html +X-DocPath=tdeioslave/locate/index.html diff --git a/src/locater.cpp b/src/locater.cpp index 68c1d75..b74dfd8 100644 --- a/src/locater.cpp +++ b/src/locater.cpp @@ -34,7 +34,7 @@ Locater::Locater(TQObject *parent, const char *name) : TQObject(parent, name), m_process(TQTextCodec::codecForLocale()) { - DEBUGSTR << "Locater::Locater" << endl; + kdDebug(7134) << "Locater::Locater" << endl; connect(&m_process, TQT_SIGNAL(processExited(TDEProcess*)), this, TQT_SLOT(finished(TDEProcess*))); @@ -47,13 +47,13 @@ Locater::Locater(TQObject *parent, const char *name) Locater::~Locater() { - DEBUGSTR << "Locater::~Locater" << endl; + kdDebug(7134) << "Locater::~Locater" << endl; } void Locater::setupLocate(const TQString& binary, const TQString& additionalArguments) { - DEBUGSTR << "Locater::setupLocate(" << binary << ", " << additionalArguments << ")" << endl; + kdDebug(7134) << "Locater::setupLocate(" << binary << ", " << additionalArguments << ")" << endl; // Automatically choose the correct binary if not specified. if (binary.isEmpty()) { @@ -64,7 +64,7 @@ void Locater::setupLocate(const TQString& binary, const TQString& additionalArgu } else { m_binary = "locate"; } - DEBUGSTR << "Using binary:" << m_binary << endl; + kdDebug(7134) << "Using binary:" << m_binary << endl; } else { m_binary = binary; } @@ -75,7 +75,7 @@ void Locater::setupLocate(const TQString& binary, const TQString& additionalArgu bool Locater::locate(const TQString& pattern, bool ignoreCase, bool regExp) { - DEBUGSTR << "Locater::locate(" << pattern << "," << ignoreCase << "," << regExp << ")" << endl; + kdDebug(7134) << "Locater::locate(" << pattern << "," << ignoreCase << "," << regExp << ")" << endl; m_process.resetAll(); m_process << m_binary; @@ -96,7 +96,7 @@ bool Locater::locate(const TQString& pattern, bool ignoreCase, bool regExp) void Locater::stop() { - DEBUGSTR << "Locater::stop()" << endl; + kdDebug(7134) << "Locater::stop()" << endl; m_process.kill(); emit finished(); @@ -105,13 +105,13 @@ void Locater::stop() void Locater::gotOutput(KProcIO* /*proc*/) { - //DEBUGSTR << "Locater::gotOutput" << endl; + //kdDebug(7134) << "Locater::gotOutput" << endl; TQStringList items; TQString line; while (m_process.readln(line) != -1) { - //DEBUGSTR << "OUTPUT>> '" << line << "'" << endl; + //kdDebug(7134) << "OUTPUT>> '" << line << "'" << endl; items << line; } @@ -122,7 +122,7 @@ void Locater::gotOutput(KProcIO* /*proc*/) void Locater::finished(TDEProcess* /*proc*/) { - DEBUGSTR << "Locater::finished" << endl; + kdDebug(7134) << "Locater::finished" << endl; emit finished(); } diff --git a/src/locater.h b/src/locater.h index 229f3f2..cde2c5d 100644 --- a/src/locater.h +++ b/src/locater.h @@ -32,9 +32,6 @@ #include <kprocio.h> -#define DEBUGSTR kdDebug(7199) - - /** * Interface to the locate command. * diff --git a/src/locater.protocol b/src/locater.protocol index e7f8bf2..ac40189 100644 --- a/src/locater.protocol +++ b/src/locater.protocol @@ -1,15 +1,16 @@ [Protocol] -exec=tdeio_locate +Description=TDE I/O Slave for the locate command + protocol=locater +Icon=edit-find +exec=tdeio_locate input=none output=filesystem listing=Name,Type,Size,Date,AccessDate,Access,Owner,Group,Link reading=true -Icon=edit-find -Description=TDE I/O Slave for the locate command # Using this will e.g. display previews etc. Class=:local # Our very sophisticated documentation -X-DocPath=tdeio-locate/index.html +X-DocPath=tdeioslave/locate/index.html diff --git a/src/rlocate.protocol b/src/rlocate.protocol index aefcc5d..1cbfa88 100644 --- a/src/rlocate.protocol +++ b/src/rlocate.protocol @@ -1,12 +1,13 @@ [Protocol] -exec=tdeio_locate +Description=TDE I/O Slave for the locate command + protocol=rlocate +Icon=edit-find +exec=tdeio_locate input=none output=filesystem listing=Name,Type,Size,Date,AccessDate,Access,Owner,Group,Link reading=true -Icon=edit-find -Description=TDE I/O Slave for the locate command # Using this will e.g. display previews etc. Class=:local @@ -15,4 +16,4 @@ Class=:local URIMode=rawuri # Our very sophisticated documentation -X-DocPath=tdeio-locate/index.html +X-DocPath=tdeioslave/locate/index.html diff --git a/src/tdeio_locate.cpp b/src/tdeio_locate.cpp index ff4d7b2..09f2395 100644 --- a/src/tdeio_locate.cpp +++ b/src/tdeio_locate.cpp @@ -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(); @@ -836,7 +836,7 @@ bool LocateProtocol::isHelpRequest() void LocateProtocol::helpRequest() { // Redirect the user to our help documents. - redirection("help:/tdeio-locate/"); + redirection("help:/tdeioslave/locate/"); finished(); } @@ -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; } } |