summaryrefslogtreecommitdiffstats
path: root/lilo-config
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commit4a25ca5c80d9b88fdc1a0d44d1db47da47206899 (patch)
tree8a1d1e893a80df8ad5233802c2b0e39220b86168 /lilo-config
parent441266d591a9064dd619da0e1bd49b871d6a9c70 (diff)
downloadtdeadmin-4a25ca5c80d9b88fdc1a0d44d1db47da47206899.tar.gz
tdeadmin-4a25ca5c80d9b88fdc1a0d44d1db47da47206899.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lilo-config')
-rw-r--r--lilo-config/common/String.cc8
-rw-r--r--lilo-config/common/String.h6
-rw-r--r--lilo-config/common/lilo.cc52
-rw-r--r--lilo-config/common/lilo.h4
-rw-r--r--lilo-config/common/tests/String.cc16
-rw-r--r--lilo-config/kde-qt-common/general.cpp4
-rw-r--r--lilo-config/kde-qt-common/images.cpp4
-rw-r--r--lilo-config/kde/Details.cpp4
-rw-r--r--lilo-config/qt/Details.cpp4
9 files changed, 51 insertions, 51 deletions
diff --git a/lilo-config/common/String.cc b/lilo-config/common/String.cc
index 6fda1fa..f8a0e35 100644
--- a/lilo-config/common/String.cc
+++ b/lilo-config/common/String.cc
@@ -98,7 +98,7 @@ bool String::casecmp(char const * const s) const
return false;
return (strncasecmp(data(), s, size())==0);
}
-bool String::tqcontains(String const &s, bool cs) const
+bool String::contains(String const &s, bool cs) const
{
if(cs)
if(strstr(cstr(), s.cstr()))
@@ -226,10 +226,10 @@ String &String::regex(String const &expr, bool cs) const
}
return *ret;
}
-String &String::tqreplace(String const &what, String const &with, bool all) const
+String &String::replace(String const &what, String const &with, bool all) const
{
String *result;
- if(!tqcontains(what)) {
+ if(!contains(what)) {
result=new String(*this);
return *result;
}
@@ -331,7 +331,7 @@ void StringList::operator +=(StringList const * const s)
for(const_iterator it=s->begin(); it!=s->end(); it++)
insert(end(), *it);
}
-bool StringList::tqcontains(String const &s) const
+bool StringList::contains(String const &s) const
{
for(const_iterator it=begin(); it!=end(); it++)
if(*it == s)
diff --git a/lilo-config/common/String.h b/lilo-config/common/String.h
index 5eaa77a..77caa61 100644
--- a/lilo-config/common/String.h
+++ b/lilo-config/common/String.h
@@ -54,7 +54,7 @@ public:
char * cstr() const;
bool cmp(char const * const s) const;
bool casecmp(char const * const s) const;
- bool tqcontains(String const &s, bool cs=true) const;
+ bool contains(String const &s, bool cs=true) const;
int locate(String const &s, bool cs=true, unsigned int startat=0) const;
void sprintf(const char *format, ...);
bool readfile(String filename);
@@ -63,7 +63,7 @@ public:
String right(unsigned int num=1) const;
String mid(unsigned int start, unsigned int num=0) const;
String &regex(String const &expr, bool cs=true) const;
- String &tqreplace(String const &what, String const &with, bool all=true) const;
+ String &replace(String const &what, String const &with, bool all=true) const;
static String escapeForRegExp(String const &s);
char chr(unsigned int index) const { if(index>=size()) return 0; else return data()[index]; }
int length() const { return size(); } // For compatibility with TQString
@@ -82,7 +82,7 @@ public:
void operator +=(StringList const &s);
void operator +=(StringList const * const s);
operator String() const;
- bool tqcontains(String const &s) const;
+ bool contains(String const &s) const;
void remove(String const &s);
void add(String const &s) { insert(end(), s); }
String const &grep(String const &s) const;
diff --git a/lilo-config/common/lilo.cc b/lilo-config/common/lilo.cc
index 6ce15dc..c61429a 100644
--- a/lilo-config/common/lilo.cc
+++ b/lilo-config/common/lilo.cc
@@ -42,13 +42,13 @@ using namespace std;
bool liloimage::isLinux() const {
const_iterator it=begin();
- if((*it).tqcontains("image"))
+ if((*it).contains("image"))
return true;
else
return false;
}
-liloimage *liloimages::tqfind(String const &s) const
+liloimage *liloimages::find(String const &s) const
{
String t = String::escapeForRegExp(s);
@@ -61,7 +61,7 @@ liloimage *liloimages::tqfind(String const &s) const
}
void liloimages::remove(String const &s)
{
- liloimage *i=tqfind(s);
+ liloimage *i=find(s);
for(iterator it=begin(); it!=end(); it++)
if(*it==*i) {
erase(it);
@@ -186,18 +186,18 @@ bool liloconf::probe()
images.clear();
/* Set some reasonable defaults... */
// Try to figure out the boot device first...
- if(drives.tqcontains("/dev/hda")) {
+ if(drives.contains("/dev/hda")) {
defaults += "boot=/dev/hda"; // 1st IDE/ATAPI harddisk
defaults += "lba32"; // otherwise it is assumed
}
- else if(drives.tqcontains("/dev/sda")) {
+ else if(drives.contains("/dev/sda")) {
defaults += "boot=/dev/sda"; // 1st SCSI harddisk
defaults += "linear"; // some SCSI disks need this
- } else if(drives.tqcontains("/dev/i2o/hda"))
+ } else if(drives.contains("/dev/i2o/hda"))
defaults += "boot=/dev/i2o/hda"; // 1st I2O harddisk
- else if(drives.tqcontains("/dev/eda"))
+ else if(drives.contains("/dev/eda"))
defaults += "boot=/dev/eda"; // 1st MCA ESDI harddisk
- else if(drives.tqcontains("/dev/pda"))
+ else if(drives.contains("/dev/pda"))
defaults += "boot=/dev/pda"; // 1st Parallel port IDE disk
else
defaults += "boot=Insert_your_boot_device_here"; // shouldn't happen
@@ -226,12 +226,12 @@ bool liloconf::probe()
continue;
if(s.st_size<131072) // if you managed to compile a kernel at less than 128k, you're cheating. ;)
continue;
- if((*it).tqcontains("System.map") || (*it).tqcontains("initrd")) // definitely not a kernel
+ if((*it).contains("System.map") || (*it).contains("initrd")) // definitely not a kernel
continue;
- if((*it).tqcontains("vmlinux")) {
+ if((*it).contains("vmlinux")) {
// If the kernel exists both in compressed and in
// uncompressed form, ignore the uncompressed one.
- String compr=(*it).tqreplace("vmlinux", "vmlinuz");
+ String compr=(*it).replace("vmlinux", "vmlinuz");
if(!access(compr, F_OK))
continue;
}
@@ -243,27 +243,27 @@ bool liloconf::probe()
if (label.empty())
{
label = (*it);
- if (label.tqfind('/') != string::npos)
+ if (label.find('/') != string::npos)
label = label.right(label.length()-1-label.rfind('/'));
}
// Check if we have an initial ramdisk (initrd) for this kernel...
String initrd1; // first guess
String initrd2; // second guess
- if((*it).tqcontains("vmlinuz")) {
- initrd1=(*it).tqreplace("vmlinux", "initrd")+".img";
- initrd2=(*it).tqreplace("vmlinuz", "initrd.img");
+ if((*it).contains("vmlinuz")) {
+ initrd1=(*it).replace("vmlinux", "initrd")+".img";
+ initrd2=(*it).replace("vmlinuz", "initrd.img");
}
- else if((*it).tqcontains("vmlinux")) {
- initrd1=(*it).tqreplace("vmlinux", "initrd")+".img";
- initrd2=(*it).tqreplace("vmlinuz", "initrd.img");
+ else if((*it).contains("vmlinux")) {
+ initrd1=(*it).replace("vmlinux", "initrd")+".img";
+ initrd2=(*it).replace("vmlinuz", "initrd.img");
}
- else if((*it).tqcontains("kernel")) {
- initrd1=(*it).tqreplace("kernel", "initrd")+".img";
- initrd2=(*it).tqreplace("vmlinuz", "initrd.img");
+ else if((*it).contains("kernel")) {
+ initrd1=(*it).replace("kernel", "initrd")+".img";
+ initrd2=(*it).replace("vmlinuz", "initrd.img");
}
- else if((*it).tqcontains("linux")) {
- initrd1=(*it).tqreplace("linux", "initrd")+".img";
- initrd2=(*it).tqreplace("vmlinuz", "initrd.img");
+ else if((*it).contains("linux")) {
+ initrd1=(*it).replace("linux", "initrd")+".img";
+ initrd2=(*it).replace("vmlinuz", "initrd.img");
}
else {
initrd1="/boot/initrd-"+version+".img";
@@ -277,8 +277,8 @@ bool liloconf::probe()
initrd = initrd2;
if(label.size()>15) // LILO can't handle this
- if(label.tqcontains("enterprise"))
- label=label.tqreplace("enterprise", "E");
+ if(label.contains("enterprise"))
+ label=label.replace("enterprise", "E");
if(label.size()>15)
label=label.left(15);
diff --git a/lilo-config/common/lilo.h b/lilo-config/common/lilo.h
index 22d6517..c992df0 100644
--- a/lilo-config/common/lilo.h
+++ b/lilo-config/common/lilo.h
@@ -39,8 +39,8 @@ public:
class liloimages:public std::list<liloimage> {
public:
void remove(String const &s);
- liloimage *tqfind(String const &s) const;
- liloimage *operator[](String const &s) const { return tqfind(s); }
+ liloimage *find(String const &s) const;
+ liloimage *operator[](String const &s) const { return find(s); }
};
class liloconf {
diff --git a/lilo-config/common/tests/String.cc b/lilo-config/common/tests/String.cc
index cfd9744..7b0b60e 100644
--- a/lilo-config/common/tests/String.cc
+++ b/lilo-config/common/tests/String.cc
@@ -54,20 +54,20 @@ int main(int argc, char **argv)
cerr << "regex() seems to be broken." << endl;
bugs++;
}
- if(!s.tqcontains("Red Hat")) {
- cerr << "tqcontains() seems to be broken." << endl;
+ if(!s.contains("Red Hat")) {
+ cerr << "contains() seems to be broken." << endl;
bugs++;
}
- if(t.tqreplace("Microsoft", "Windows", false) != "Windows sucks! Destroy Microsoft! Microsoft must die!") {
- cerr << "tqreplace() [once] seems to be broken." << endl;
+ if(t.replace("Microsoft", "Windows", false) != "Windows sucks! Destroy Microsoft! Microsoft must die!") {
+ cerr << "replace() [once] seems to be broken." << endl;
bugs++;
}
- if(t.tqreplace("Microsoft", "Windows") != "Windows sucks! Destroy Windows! Windows must die!") {
- cerr << "tqreplace() [all] seems to be broken." << endl;
+ if(t.replace("Microsoft", "Windows") != "Windows sucks! Destroy Windows! Windows must die!") {
+ cerr << "replace() [all] seems to be broken." << endl;
bugs++;
}
- if(u.tqreplace("Microsoft", "Windows") != "Windows sucks!") {
- cerr << "tqreplace() [all, test case 2] seems to be broken." << endl;
+ if(u.replace("Microsoft", "Windows") != "Windows sucks!") {
+ cerr << "replace() [all, test case 2] seems to be broken." << endl;
bugs++;
}
diff --git a/lilo-config/kde-qt-common/general.cpp b/lilo-config/kde-qt-common/general.cpp
index 858ba9c..bdfd12f 100644
--- a/lilo-config/kde-qt-common/general.cpp
+++ b/lilo-config/kde-qt-common/general.cpp
@@ -168,7 +168,7 @@ void General::saveChanges()
} else {
TQString mode=vga->currentText();
if(mode!="ask") {
- mode=mode.mid(mode.tqfind('(')+1);
+ mode=mode.mid(mode.find('(')+1);
mode=mode.left(mode.length()-1);
}
lilo->defaults.set("vga", mode.latin1());
@@ -201,7 +201,7 @@ void General::update()
vga->setCurrentItem(1);
else
for(int i=0; i<vga->count(); i++) {
- if(vga->text(i).tqcontains("(" + mode + ")")) {
+ if(vga->text(i).contains("(" + mode + ")")) {
vga->setCurrentItem(i);
break;
}
diff --git a/lilo-config/kde-qt-common/images.cpp b/lilo-config/kde-qt-common/images.cpp
index bdbdac4..a4872c0 100644
--- a/lilo-config/kde-qt-common/images.cpp
+++ b/lilo-config/kde-qt-common/images.cpp
@@ -131,7 +131,7 @@ void Images::probeClicked() // SLOT
void Images::dfltClicked() // SLOT
{
if (images->currentItem() < 0) return;
- lilo->setDefault(images->currentText().tqreplace(TQRegExp(" (default)", true, true), "").latin1());
+ lilo->setDefault(images->currentText().replace(TQRegExp(" (default)", true, true), "").latin1());
update();
emit configChanged();
}
@@ -246,7 +246,7 @@ void Images::removeClicked() // SLOT
TQString value(TQString const &s)
{
- TQString r=s.mid(s.tqfind('=')+1).simplifyWhiteSpace();
+ TQString r=s.mid(s.find('=')+1).simplifyWhiteSpace();
if(r.left(1)=="\"")
r=r.mid(1);
if(r.right(1)=="\"")
diff --git a/lilo-config/kde/Details.cpp b/lilo-config/kde/Details.cpp
index 385b715..ae82090 100644
--- a/lilo-config/kde/Details.cpp
+++ b/lilo-config/kde/Details.cpp
@@ -101,7 +101,7 @@ Details::Details(liloimage *lilo, TQWidget *tqparent, const char *name, WFlags /
vga->setCurrentItem(1);
else
for(int i=0; i<vga->count(); i++) {
- if(vga->text(i).tqcontains("(" + mode + ")")) {
+ if(vga->text(i).contains("(" + mode + ")")) {
vga->setCurrentItem(i);
break;
}
@@ -127,7 +127,7 @@ TQString Details::vgaMode() const
if(s=="default")
return "";
else if(s!="ask") {
- s=s.mid(s.tqfind('(')+1);
+ s=s.mid(s.find('(')+1);
s=s.left(s.length()-1);
}
return s;
diff --git a/lilo-config/qt/Details.cpp b/lilo-config/qt/Details.cpp
index 6b4e50a..f85216c 100644
--- a/lilo-config/qt/Details.cpp
+++ b/lilo-config/qt/Details.cpp
@@ -113,7 +113,7 @@ Details::Details(liloimage *lilo, TQWidget *tqparent, const char *name, WFlags f
vga->setCurrentItem(1);
else
for(int i=0; i<vga->count(); i++) {
- if(vga->text(i).tqcontains("(" + mode + ")")) {
+ if(vga->text(i).contains("(" + mode + ")")) {
vga->setCurrentItem(i);
break;
}
@@ -137,7 +137,7 @@ TQString Details::vgaMode() const
if(s=="default")
return "";
else if(s!="ask") {
- s=s.mid(s.tqfind('(')+1);
+ s=s.mid(s.find('(')+1);
s=s.left(s.length()-1);
}
return s;