Rename KCModule, KConfig, KIO, KServer, and KSocket to avoid conflicts with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent a16d1de56d
commit 2ec1b629e4

@ -45,7 +45,7 @@
#include "klocateconfigfilterwidget.h" #include "klocateconfigfilterwidget.h"
#include "klocateconfiglocatewidget.h" #include "klocateconfiglocatewidget.h"
using namespace KIO; using namespace TDEIO;
static const TQString queryQuery = "q"; 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()) const TQString& url = TQString(), const TQString& icon = TQString())
{ {
UDSEntry entry; UDSEntry entry;
addAtom(entry, KIO::UDS_NAME, display); addAtom(entry, TDEIO::UDS_NAME, display);
if (!path.isEmpty()) { if (!path.isEmpty()) {
KDE_struct_stat info; KDE_struct_stat info;
KDE_lstat(path.local8Bit(), &info); KDE_lstat(path.local8Bit(), &info);
addAtom(entry, KIO::UDS_SIZE, info.st_size); addAtom(entry, TDEIO::UDS_SIZE, info.st_size);
addAtom(entry, KIO::UDS_ACCESS, info.st_mode); addAtom(entry, TDEIO::UDS_ACCESS, info.st_mode);
addAtom(entry, KIO::UDS_MODIFICATION_TIME, info.st_mtime); addAtom(entry, TDEIO::UDS_MODIFICATION_TIME, info.st_mtime);
addAtom(entry, KIO::UDS_ACCESS_TIME, info.st_atime); addAtom(entry, TDEIO::UDS_ACCESS_TIME, info.st_atime);
addAtom(entry, KIO::UDS_CREATION_TIME, info.st_ctime); addAtom(entry, TDEIO::UDS_CREATION_TIME, info.st_ctime);
struct passwd * user = getpwuid(info.st_uid); struct passwd * user = getpwuid(info.st_uid);
struct group * group = getgrgid(info.st_gid); struct group * group = getgrgid(info.st_gid);
addAtom(entry, KIO::UDS_USER, ((user != NULL) ? user->pw_name : "???" )); addAtom(entry, TDEIO::UDS_USER, ((user != NULL) ? user->pw_name : "???" ));
addAtom(entry, KIO::UDS_GROUP, ((group != NULL) ? group->gr_name : "???" )); addAtom(entry, TDEIO::UDS_GROUP, ((group != NULL) ? group->gr_name : "???" ));
if (url.isEmpty()) { if (url.isEmpty()) {
// List an existing file. // List an existing file.
addAtom(entry, KIO::UDS_URL, "file:" + path); addAtom(entry, TDEIO::UDS_URL, "file:" + path);
mode_t type = info.st_mode; mode_t type = info.st_mode;
if (S_ISLNK(type)) { if (S_ISLNK(type)) {
@ -232,28 +232,28 @@ static const UDSEntry pathToUDSEntry(const TQString& path, const TQString& displ
buff[n] = 0; buff[n] = 0;
slink = buff; slink = buff;
} }
addAtom(entry, KIO::UDS_LINK_DEST, slink); addAtom(entry, TDEIO::UDS_LINK_DEST, slink);
} else { } else {
type &= S_IFMT; type &= S_IFMT;
} }
addAtom(entry, KIO::UDS_FILE_TYPE, type); addAtom(entry, TDEIO::UDS_FILE_TYPE, type);
#ifdef HAVE_UDS_HIDDEN #ifdef HAVE_UDS_HIDDEN
if (path.contains("/.")) { if (path.contains("/.")) {
addAtom(entry, KIO::UDS_HIDDEN, 1); addAtom(entry, TDEIO::UDS_HIDDEN, 1);
} }
#endif #endif
} else { } else {
// List a locate link. // List a locate link.
addAtom(entry, KIO::UDS_URL, url); addAtom(entry, TDEIO::UDS_URL, url);
addAtom(entry, KIO::UDS_FILE_TYPE, S_IFDIR); addAtom(entry, TDEIO::UDS_FILE_TYPE, S_IFDIR);
} }
} else { } else {
addAtom(entry, KIO::UDS_URL, url); addAtom(entry, TDEIO::UDS_URL, url);
} }
if (!icon.isEmpty()) { if (!icon.isEmpty()) {
addAtom(entry, KIO::UDS_ICON_NAME, icon); addAtom(entry, TDEIO::UDS_ICON_NAME, icon);
} }
return entry; return entry;
@ -346,7 +346,7 @@ void LocateProtocol::get(const KURL& url)
if (isSearchRequest()) { if (isSearchRequest()) {
if (m_locater.binaryExists()) { if (m_locater.binaryExists()) {
error(KIO::ERR_IS_DIRECTORY, TQString()); error(TDEIO::ERR_IS_DIRECTORY, TQString());
} else { } 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()); 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); outputHtml(html);
@ -357,7 +357,7 @@ void LocateProtocol::get(const KURL& url)
helpRequest(); helpRequest();
} else { } else {
// What's this? // What's this?
error(KIO::ERR_DOES_NOT_EXIST, TQString()); error(TDEIO::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 /// \todo Is UDS_NAME used for anything in stat? If so we should
/// at least strip of the protocol part. /// at least strip of the protocol part.
UDSEntry entry; UDSEntry entry;
addAtom(entry, KIO::UDS_NAME, url.decode_string(url.url())); addAtom(entry, TDEIO::UDS_NAME, url.decode_string(url.url()));
addAtom(entry, KIO::UDS_FILE_TYPE, isDir ? S_IFDIR : S_IFREG); addAtom(entry, TDEIO::UDS_FILE_TYPE, isDir ? S_IFDIR : S_IFREG);
statEntry(entry); statEntry(entry);
finished(); finished();
/// \todo Somehow locate: and locate:/ is thought to be a directory /// \todo Somehow locate: and locate:/ is thought to be a directory
/// by konqueror anyway. How to change this? /// by konqueror anyway. How to change this?
} else { } else {
// What's this? // What's this?
error(KIO::ERR_DOES_NOT_EXIST, TQString()); error(TDEIO::ERR_DOES_NOT_EXIST, TQString());
} }
} }
@ -395,10 +395,10 @@ void LocateProtocol::listDir(const KURL& url)
if (isSearchRequest()) { if (isSearchRequest()) {
searchRequest(); searchRequest();
} else if (isConfigRequest() || isHelpRequest()) { } else if (isConfigRequest() || isHelpRequest()) {
error(KIO::ERR_IS_FILE, TQString()); error(TDEIO::ERR_IS_FILE, TQString());
} else { } else {
// What's this? // What's this?
error(KIO::ERR_DOES_NOT_EXIST, TQString()); error(TDEIO::ERR_DOES_NOT_EXIST, TQString());
} }
} }
@ -764,10 +764,10 @@ void LocateProtocol::configRequest()
m_configUpdated = false; m_configUpdated = false;
// Don't show it twice. During my tests I never got there however. // Don't show it twice. During my tests I never got there however.
if(KConfigDialog::showDialog("settings")) if(TDEConfigDialog::showDialog("settings"))
return; return;
KConfigDialog *dialog = new KConfigDialog(0, "settings", KLocateConfig::self(), TDEConfigDialog *dialog = new TDEConfigDialog(0, "settings", KLocateConfig::self(),
KDialogBase::IconList, KDialogBase::IconList,
KDialogBase::Default|KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Help, KDialogBase::Default|KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Help,
KDialogBase::Ok, true); KDialogBase::Ok, true);

@ -93,7 +93,7 @@ enum LocateCollapsedIcon { iconBlue, iconGreen, iconGrey, iconOrange, iconRed, i
* Enables you to enter "locate:pattern" wherever an URL can be used * Enables you to enter "locate:pattern" wherever an URL can be used
* in KDE. * in KDE.
*/ */
class LocateProtocol : public TQObject, public KIO::SlaveBase class LocateProtocol : public TQObject, public TDEIO::SlaveBase
{ {
Q_OBJECT Q_OBJECT
@ -179,7 +179,7 @@ class LocateProtocol : public TQObject, public KIO::SlaveBase
LocateDirectory *m_baseDir; // The toplevel directory, e.g. "/usr/". LocateDirectory *m_baseDir; // The toplevel directory, e.g. "/usr/".
LocateDirectory *m_curDir; // The current directory (while locating). LocateDirectory *m_curDir; // The current directory (while locating).
KIO::UDSEntryList m_entries; // Used to cache a lot of hits and list them all at once. TDEIO::UDSEntryList m_entries; // Used to cache a lot of hits and list them all at once.
TQString partToPattern(const TQString& part, bool forLocate); TQString partToPattern(const TQString& part, bool forLocate);
bool isMatching(const TQString& file); bool isMatching(const TQString& file);

Loading…
Cancel
Save