|
|
|
@ -238,7 +238,7 @@ static const UDSEntry pathToUDSEntry(const TQString& path, const TQString& displ
|
|
|
|
|
addAtom(entry, KIO::UDS_FILE_TYPE, type);
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_UDS_HIDDEN
|
|
|
|
|
if (path.tqcontains("/.")) {
|
|
|
|
|
if (path.contains("/.")) {
|
|
|
|
|
addAtom(entry, KIO::UDS_HIDDEN, 1);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
@ -586,7 +586,7 @@ void LocateProtocol::processPath(const TQString &path, const TQString &nextPath)
|
|
|
|
|
}
|
|
|
|
|
// Add path to current directory.
|
|
|
|
|
if (m_baseDir == NULL) {
|
|
|
|
|
int p = path.tqfind('/', 1);
|
|
|
|
|
int p = path.find('/', 1);
|
|
|
|
|
TQString base = path;
|
|
|
|
|
if (p >= 0) {
|
|
|
|
|
base = path.left(p+1);
|
|
|
|
@ -642,7 +642,7 @@ TQString LocateProtocol::partToPattern(const TQString& part, bool forLocate)
|
|
|
|
|
DEBUGSTR << "BEG part: " << part << endl;
|
|
|
|
|
TQString pattern = part;
|
|
|
|
|
// Unescape whitespace.
|
|
|
|
|
pattern.tqreplace("\\ ", " ");
|
|
|
|
|
pattern.replace("\\ ", " ");
|
|
|
|
|
// Unquote quoted pattern.
|
|
|
|
|
int n = pattern.length(), index;
|
|
|
|
|
if ((n > 1) && (pattern[0] == '"') && (pattern[n-1] == '"')) {
|
|
|
|
@ -661,11 +661,11 @@ TQString LocateProtocol::partToPattern(const TQString& part, bool forLocate)
|
|
|
|
|
} else {
|
|
|
|
|
// Special case for locate pattern without wildcards:
|
|
|
|
|
// Unescape all escaped wildcards.
|
|
|
|
|
pattern.tqreplace("\\*", "*");
|
|
|
|
|
pattern.tqreplace("\\+", "+");
|
|
|
|
|
pattern.tqreplace("\\?", "?");
|
|
|
|
|
pattern.tqreplace("\\[", "[");
|
|
|
|
|
pattern.tqreplace("\\]", "]");
|
|
|
|
|
pattern.replace("\\*", "*");
|
|
|
|
|
pattern.replace("\\+", "+");
|
|
|
|
|
pattern.replace("\\?", "?");
|
|
|
|
|
pattern.replace("\\[", "[");
|
|
|
|
|
pattern.replace("\\]", "]");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -673,7 +673,7 @@ TQString LocateProtocol::partToPattern(const TQString& part, bool forLocate)
|
|
|
|
|
if (forLocate) {
|
|
|
|
|
// Replace ~/ and ~user/ at the beginning (as the shell does)
|
|
|
|
|
if ((pattern.length() > 0) && (pattern[0] == '~')) {
|
|
|
|
|
index = pattern.tqfind('/');
|
|
|
|
|
index = pattern.find('/');
|
|
|
|
|
if (index >= 0) {
|
|
|
|
|
TQString name = pattern.mid(1, index-1);
|
|
|
|
|
TQString homeDir;
|
|
|
|
@ -683,11 +683,11 @@ TQString LocateProtocol::partToPattern(const TQString& part, bool forLocate)
|
|
|
|
|
homeDir = KUser(name).homeDir();
|
|
|
|
|
}
|
|
|
|
|
if (!homeDir.isEmpty()) {
|
|
|
|
|
pattern.tqreplace(0, index, homeDir);
|
|
|
|
|
pattern.replace(0, index, homeDir);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pattern.tqreplace("\\~", "~");
|
|
|
|
|
pattern.replace("\\~", "~");
|
|
|
|
|
}
|
|
|
|
|
DEBUGSTR << "END part: " << pattern << endl;
|
|
|
|
|
return pattern;
|
|
|
|
@ -730,8 +730,8 @@ TQString LocateProtocol::pathToDisplay(const TQString& path, int subItems)
|
|
|
|
|
// In both cases the result of arg() is undefined.
|
|
|
|
|
TQString output = m_config.m_collapsedDisplay, temp;
|
|
|
|
|
temp.setNum(subItems);
|
|
|
|
|
output.tqreplace("%1", temp);
|
|
|
|
|
output.tqreplace("%2", display);
|
|
|
|
|
output.replace("%1", temp);
|
|
|
|
|
output.replace("%2", display);
|
|
|
|
|
display = output;
|
|
|
|
|
}
|
|
|
|
|
return display;
|
|
|
|
@ -771,11 +771,11 @@ void LocateProtocol::configRequest()
|
|
|
|
|
KDialogBase::Default|KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Help,
|
|
|
|
|
KDialogBase::Ok, true);
|
|
|
|
|
dialog->setCaption(i18n("Configure - kio-locate"));
|
|
|
|
|
dialog->setIcon(SmallIcon("tqfind"));
|
|
|
|
|
dialog->setIcon(SmallIcon("find"));
|
|
|
|
|
|
|
|
|
|
dialog->addPage(new KLocateConfigWidget(), i18n("General"), "package_settings");
|
|
|
|
|
dialog->addPage(new KLocateConfigFilterWidget(), i18n("Filters"), "filter");
|
|
|
|
|
dialog->addPage(new KLocateConfigLocateWidget(), i18n("Locate"), "tqfind");
|
|
|
|
|
dialog->addPage(new KLocateConfigLocateWidget(), i18n("Locate"), "find");
|
|
|
|
|
|
|
|
|
|
// React on user's actions.
|
|
|
|
|
connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(updateConfig()));
|
|
|
|
@ -856,7 +856,7 @@ LocateDirectory *LocateDirectory::addPath(const TQString& path)
|
|
|
|
|
{
|
|
|
|
|
if (path.startsWith(m_path)) {
|
|
|
|
|
TQString relPath = path.mid(m_path.length());
|
|
|
|
|
int p = relPath.tqfindRev('/');
|
|
|
|
|
int p = relPath.findRev('/');
|
|
|
|
|
if (p >= 0) {
|
|
|
|
|
LocateDirectory *child = getSubDirectory(relPath.left(p));
|
|
|
|
|
child->addItem(relPath.mid(p+1));
|
|
|
|
@ -876,11 +876,11 @@ LocateDirectory *LocateDirectory::addPath(const TQString& path)
|
|
|
|
|
LocateDirectory *LocateDirectory::getSubDirectory(const TQString& relPath)
|
|
|
|
|
{
|
|
|
|
|
TQString base = relPath;
|
|
|
|
|
int p = relPath.tqfind('/');
|
|
|
|
|
int p = relPath.find('/');
|
|
|
|
|
if (p >= 0) {
|
|
|
|
|
base = relPath.left(p);
|
|
|
|
|
}
|
|
|
|
|
LocateDirectory *child = m_childs.tqfind(base);
|
|
|
|
|
LocateDirectory *child = m_childs.find(base);
|
|
|
|
|
if (child == NULL) {
|
|
|
|
|
child = new LocateDirectory(this, addTrailingSlash(m_path + base));
|
|
|
|
|
m_childs.insert(base, child);
|
|
|
|
|