summaryrefslogtreecommitdiffstats
path: root/kdf
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
commit6335dc55802871b5a43492f217b6edbb420204c4 (patch)
tree50c6c8672a52687568edea475614dfe3d98e62e5 /kdf
parent9b8c9f1f9e974ff0176108cfbd8852cd99ea68c8 (diff)
downloadtdeutils-6335dc55802871b5a43492f217b6edbb420204c4.tar.gz
tdeutils-6335dc55802871b5a43492f217b6edbb420204c4.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdf')
-rw-r--r--kdf/disklist.cpp66
-rw-r--r--kdf/disklist.h2
-rw-r--r--kdf/disks.cpp38
-rw-r--r--kdf/kdfwidget.cpp18
-rw-r--r--kdf/kwikdisk.cpp6
-rw-r--r--kdf/listview.cpp2
-rw-r--r--kdf/mntconfig.cpp6
7 files changed, 69 insertions, 69 deletions
diff --git a/kdf/disklist.cpp b/kdf/disklist.cpp
index b6c07b7..1c21d15 100644
--- a/kdf/disklist.cpp
+++ b/kdf/disklist.cpp
@@ -183,27 +183,27 @@ TQFile f(FSTAB);
while (! t.eof()) {
s=t.readLine();
s=s.simplifyWhiteSpace();
- if ( (!s.isEmpty() ) && (s.tqfind(DELIMITER)!=0) ) {
+ if ( (!s.isEmpty() ) && (s.find(DELIMITER)!=0) ) {
// not empty or commented out by '#'
// kdDebug() << "GOT: [" << s << "]" << endl;
disk = new DiskEntry();// Q_CHECK_PTR(disk);
disk->setMounted(FALSE);
- disk->setDeviceName(expandEscapes(s.left(s.tqfind(BLANK))));
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ disk->setDeviceName(expandEscapes(s.left(s.find(BLANK))));
+ s=s.remove(0,s.find(BLANK)+1 );
// kdDebug() << " deviceName: [" << disk->deviceName() << "]" << endl;
#ifdef _OS_SOLARIS_
//device to fsck
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ s=s.remove(0,s.find(BLANK)+1 );
#endif
- disk->setMountPoint(expandEscapes(s.left(s.tqfind(BLANK))));
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ disk->setMountPoint(expandEscapes(s.left(s.find(BLANK))));
+ s=s.remove(0,s.find(BLANK)+1 );
//kdDebug() << " MountPoint: [" << disk->mountPoint() << "]" << endl;
//kdDebug() << " Icon: [" << disk->iconName() << "]" << endl;
- disk->setFsType(s.left(s.tqfind(BLANK)) );
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ disk->setFsType(s.left(s.find(BLANK)) );
+ s=s.remove(0,s.find(BLANK)+1 );
//kdDebug() << " FS-Type: [" << disk->fsType() << "]" << endl;
- disk->setMountOptions(s.left(s.tqfind(BLANK)) );
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ disk->setMountOptions(s.left(s.find(BLANK)) );
+ s=s.remove(0,s.find(BLANK)+1 );
//kdDebug() << " Mount-Options: [" << disk->mountOptions() << "]" << endl;
if ( (disk->deviceName() != "none")
&& (disk->fsType() != "swap")
@@ -211,7 +211,7 @@ TQFile f(FSTAB);
&& (disk->mountPoint() != "/dev/swap")
&& (disk->mountPoint() != "/dev/pts")
&& (disk->mountPoint() != "/dev/shm")
- && (disk->mountPoint().tqfind("/proc") == -1 ) )
+ && (disk->mountPoint().find("/proc") == -1 ) )
replaceDeviceEntry(disk);
else
delete disk;
@@ -295,7 +295,7 @@ void DiskList::dfDone()
if ( !s.isEmpty() ) {
disk = new DiskEntry(); Q_CHECK_PTR(disk);
- if (s.tqfind(BLANK)<0) // devicename was too long, rest in next line
+ if (s.find(BLANK)<0) // devicename was too long, rest in next line
if ( !t.eof() ) { // just appends the next line
v=t.readLine();
s=s.append(v.latin1() );
@@ -305,37 +305,37 @@ void DiskList::dfDone()
//kdDebug() << "EFFECTIVELY GOT " << s.length() << " chars: [" << s << "]" << endl;
- disk->setDeviceName(s.left(s.tqfind(BLANK)) );
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ disk->setDeviceName(s.left(s.find(BLANK)) );
+ s=s.remove(0,s.find(BLANK)+1 );
//kdDebug() << " DeviceName: [" << disk->deviceName() << "]" << endl;
if (NO_FS_TYPE) {
//kdDebug() << "THERE IS NO FS_TYPE_FIELD!" << endl;
disk->setFsType("?");
} else {
- disk->setFsType(s.left(s.tqfind(BLANK)) );
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ disk->setFsType(s.left(s.find(BLANK)) );
+ s=s.remove(0,s.find(BLANK)+1 );
};
//kdDebug() << " FS-Type: [" << disk->fsType() << "]" << endl;
//kdDebug() << " Icon: [" << disk->iconName() << "]" << endl;
- u=s.left(s.tqfind(BLANK));
+ u=s.left(s.find(BLANK));
disk->setKBSize(u.toInt() );
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ s=s.remove(0,s.find(BLANK)+1 );
//kdDebug() << " Size: [" << disk->kBSize() << "]" << endl;
- u=s.left(s.tqfind(BLANK));
+ u=s.left(s.find(BLANK));
disk->setKBUsed(u.toInt() );
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ s=s.remove(0,s.find(BLANK)+1 );
//kdDebug() << " Used: [" << disk->kBUsed() << "]" << endl;
- u=s.left(s.tqfind(BLANK));
+ u=s.left(s.find(BLANK));
disk->setKBAvail(u.toInt() );
- s=s.remove(0,s.tqfind(BLANK)+1 );
+ s=s.remove(0,s.find(BLANK)+1 );
//kdDebug() << " Avail: [" << disk->kBAvail() << "]" << endl;
- s=s.remove(0,s.tqfind(BLANK)+1 ); // delete the capacity 94%
+ s=s.remove(0,s.find(BLANK)+1 ); // delete the capacity 94%
disk->setMountPoint(s);
//kdDebug() << " MountPoint: [" << disk->mountPoint() << "]" << endl;
@@ -346,7 +346,7 @@ void DiskList::dfDone()
&& (disk->mountPoint() != "/dev/swap")
&& (disk->mountPoint() != "/dev/pts")
&& (disk->mountPoint() != "/dev/shm")
- && (disk->mountPoint().tqfind("/proc") == -1 ) ) {
+ && (disk->mountPoint().find("/proc") == -1 ) ) {
disk->setMounted(TRUE); // its now mounted (df lists only mounted)
replaceDeviceEntry(disk);
} else
@@ -391,10 +391,10 @@ void DiskList::replaceDeviceEntry(DiskEntry *disk)
//
// 1999-27-11 Espen Sand:
- // I can't get tqfind() to work. The Disks::compareItems(..) is
+ // I can't get find() to work. The Disks::compareItems(..) is
// never called.
//
- //int pos=disks->tqfind(disk);
+ //int pos=disks->find(disk);
TQString deviceRealName = disk->deviceRealName();
TQString realMountPoint = disk->realMountPoint();
@@ -426,13 +426,13 @@ void DiskList::replaceDeviceEntry(DiskEntry *disk)
// eg. /cache/cache/.cfs_mnt_points/srv:_home_jesus
// ^ ^
TQString odiskName = olddisk->deviceName();
- int ci=odiskName.tqfind(':'); // goto host-column
- while ((ci =odiskName.tqfind('/',ci)) > 0) {
- odiskName.tqreplace(ci,1,"_");
+ int ci=odiskName.find(':'); // goto host-column
+ while ((ci =odiskName.find('/',ci)) > 0) {
+ odiskName.replace(ci,1,"_");
}//while
// check if there is something that is exactly the tail
// eg. [srv:/tmp3] is exact tail of [/cache/.cfs_mnt_points/srv:_tmp3]
- if ( ( (p=disk->deviceName().tqfindRev(odiskName
+ if ( ( (p=disk->deviceName().findRev(odiskName
,disk->deviceName().length()) )
!= -1)
&& (p + odiskName.length()
@@ -455,10 +455,10 @@ void DiskList::replaceDeviceEntry(DiskEntry *disk)
}
#endif
- if (pos != -1) { // tqreplace
+ if (pos != -1) { // replace
DiskEntry * olddisk = disks->at(pos);
- if ( (-1!=olddisk->mountOptions().tqfind("user")) &&
- (-1==disk->mountOptions().tqfind("user")) ) {
+ if ( (-1!=olddisk->mountOptions().find("user")) &&
+ (-1==disk->mountOptions().find("user")) ) {
// add "user" option to new diskEntry
TQString s=disk->mountOptions();
if (s.length()>0) s.append(",");
diff --git a/kdf/disklist.h b/kdf/disklist.h
index 4f01d87..638dc59 100644
--- a/kdf/disklist.h
+++ b/kdf/disklist.h
@@ -101,7 +101,7 @@ public:
~DiskList();
int readFSTAB();
int readDF();
- int tqfind(const DiskEntry* disk) {return disks->tqfind(disk);}
+ int find(const DiskEntry* disk) {return disks->find(disk);}
DiskEntry* at(uint index) {return disks->at(index);}
DiskEntry* first() {return disks->first();}
DiskEntry* next() {return disks->next();}
diff --git a/kdf/disks.cpp b/kdf/disks.cpp
index 0ae7c2b..721f10d 100644
--- a/kdf/disks.cpp
+++ b/kdf/disks.cpp
@@ -107,10 +107,10 @@ int DiskEntry::mount()
cmdS=TQString::tqfromLatin1("mount -t%t -o%o %d %m");
}
- cmdS.tqreplace(TQString::tqfromLatin1("%d"),deviceName());
- cmdS.tqreplace(TQString::tqfromLatin1("%m"),mountPoint());
- cmdS.tqreplace(TQString::tqfromLatin1("%t"),fsType());
- cmdS.tqreplace(TQString::tqfromLatin1("%o"),mountOptions());
+ cmdS.replace(TQString::tqfromLatin1("%d"),deviceName());
+ cmdS.replace(TQString::tqfromLatin1("%m"),mountPoint());
+ cmdS.replace(TQString::tqfromLatin1("%t"),fsType());
+ cmdS.replace(TQString::tqfromLatin1("%o"),mountOptions());
kdDebug() << "mount-cmd: [" << cmdS << "]" << endl;
int e=sysCall(cmdS);
@@ -126,8 +126,8 @@ int DiskEntry::umount()
if (cmdS.isEmpty()) // generate default umount cmd
cmdS="umount %d";
- cmdS.tqreplace(TQString::tqfromLatin1("%d"),deviceName());
- cmdS.tqreplace(TQString::tqfromLatin1("%m"),mountPoint());
+ cmdS.replace(TQString::tqfromLatin1("%d"),deviceName());
+ cmdS.replace(TQString::tqfromLatin1("%m"),mountPoint());
kdDebug() << "umount-cmd: [" << cmdS << "]" << endl;
int e=sysCall(cmdS);
@@ -193,23 +193,23 @@ TQString DiskEntry::guessIconName()
{
TQString iconName;
// try to be intelligent
- if (-1!=mountPoint().tqfind("cdrom",0,FALSE)) iconName+="cdrom";
- else if (-1!=deviceName().tqfind("cdrom",0,FALSE)) iconName+="cdrom";
- else if (-1!=mountPoint().tqfind("writer",0,FALSE)) iconName+="cdwriter";
- else if (-1!=deviceName().tqfind("writer",0,FALSE)) iconName+="cdwriter";
- else if (-1!=mountPoint().tqfind("mo",0,FALSE)) iconName+="mo";
- else if (-1!=deviceName().tqfind("mo",0,FALSE)) iconName+="mo";
- else if (-1!=deviceName().tqfind("fd",0,FALSE)) {
- if (-1!=deviceName().tqfind("360",0,FALSE)) iconName+="5floppy";
- if (-1!=deviceName().tqfind("1200",0,FALSE)) iconName+="5floppy";
+ if (-1!=mountPoint().find("cdrom",0,FALSE)) iconName+="cdrom";
+ else if (-1!=deviceName().find("cdrom",0,FALSE)) iconName+="cdrom";
+ else if (-1!=mountPoint().find("writer",0,FALSE)) iconName+="cdwriter";
+ else if (-1!=deviceName().find("writer",0,FALSE)) iconName+="cdwriter";
+ else if (-1!=mountPoint().find("mo",0,FALSE)) iconName+="mo";
+ else if (-1!=deviceName().find("mo",0,FALSE)) iconName+="mo";
+ else if (-1!=deviceName().find("fd",0,FALSE)) {
+ if (-1!=deviceName().find("360",0,FALSE)) iconName+="5floppy";
+ if (-1!=deviceName().find("1200",0,FALSE)) iconName+="5floppy";
else iconName+="3floppy";
}
- else if (-1!=mountPoint().tqfind("floppy",0,FALSE)) iconName+="3floppy";
- else if (-1!=mountPoint().tqfind("zip",0,FALSE)) iconName+="zip";
- else if (-1!=fsType().tqfind("nfs",0,FALSE)) iconName+="nfs";
+ else if (-1!=mountPoint().find("floppy",0,FALSE)) iconName+="3floppy";
+ else if (-1!=mountPoint().find("zip",0,FALSE)) iconName+="zip";
+ else if (-1!=fsType().find("nfs",0,FALSE)) iconName+="nfs";
else iconName+="hdd";
mounted() ? iconName+="_mount" : iconName+="_unmount";
-// if ( -1==mountOptions().tqfind("user",0,FALSE) )
+// if ( -1==mountOptions().find("user",0,FALSE) )
// iconName.prepend("root_"); // special root icon, normal user canīt mount
//debug("device %s is %s",deviceName().latin1(),iconName.latin1());
diff --git a/kdf/kdfwidget.cpp b/kdf/kdfwidget.cpp
index 5fab6a9..c81d5a3 100644
--- a/kdf/kdfwidget.cpp
+++ b/kdf/kdfwidget.cpp
@@ -343,7 +343,7 @@ void KDFWidget::updateDFDone( void ){
int k=0;
item = new CListViewItem( mList, item );
- bool root = disk->mountOptions().tqfind("user",0,false)==-1 ? true : false;
+ bool root = disk->mountOptions().find("user",0,false)==-1 ? true : false;
item->setPixmap( k++, mList->icon( disk->iconName(), root ) );
item->setText( k++, disk->deviceName() );
item->setText( k++, disk->fsType() );
@@ -400,10 +400,10 @@ DiskEntry *KDFWidget::selectedDisk( TQListViewItem *item )
DiskEntry disk(item->text(deviceCol));
disk.setMountPoint(item->text(mntCol));
- // I can't get tqfind() to work. The Disks::compareItems(..) is
+ // I can't get find() to work. The Disks::compareItems(..) is
// never called.
//
- //int pos=mDiskList->tqfind(disk);
+ //int pos=mDiskList->find(disk);
int pos = -1;
for( u_int i=0; i<mDiskList.count(); i++ )
@@ -515,10 +515,10 @@ void KDFWidget::popupMenu( TQListViewItem *item, const TQPoint &p )
if( mStd.fileManager().isEmpty() == false )
{
TQString cmd = mStd.fileManager();
- int pos = cmd.tqfind("%m");
+ int pos = cmd.find("%m");
if( pos > 0 )
{
- cmd = cmd.tqreplace( pos, 2, KProcess::quote(disk->mountPoint()) ) + " &";
+ cmd = cmd.replace( pos, 2, KProcess::quote(disk->mountPoint()) ) + " &";
}
else
{
@@ -569,10 +569,10 @@ void KDFWidget::updateDiskBarPixmaps( void )
int i=0;
for(TQListViewItem *it=mList->firstChild(); it!=0;it=it->nextSibling(),i++ )
{
- // I can't get tqfind() to work. The Disks::compareItems(..) is
+ // I can't get find() to work. The Disks::compareItems(..) is
// never called.
//
- //int pos=mDiskList->tqfind(disk);
+ //int pos=mDiskList->find(disk);
DiskEntry dummy(it->text(deviceCol));
dummy.setMountPoint(it->text(mntCol));
@@ -609,8 +609,8 @@ void KDFWidget::updateDiskBarPixmaps( void )
p.setPen(black);
p.drawRect(0,0,w,h);
TQColor c;
- if ( (disk->iconName().tqfind("cdrom") != -1)
- || (disk->iconName().tqfind("writer") != -1) )
+ if ( (disk->iconName().find("cdrom") != -1)
+ || (disk->iconName().find("writer") != -1) )
c = gray;
else
c = disk->percentFull() > FULL_PERCENT ? red : darkGreen;
diff --git a/kdf/kwikdisk.cpp b/kdf/kwikdisk.cpp
index e6c4020..fb85996 100644
--- a/kdf/kwikdisk.cpp
+++ b/kdf/kwikdisk.cpp
@@ -190,7 +190,7 @@ void KwikDisk::updateDFDone()
TQPixmap *pix = new TQPixmap(KSystemTray::loadIcon(disk->iconName()));
- if( getuid() !=0 && disk->mountOptions().tqfind("user",0, false) == -1 )
+ if( getuid() !=0 && disk->mountOptions().find("user",0, false) == -1 )
{
//
// Special root icon, normal user cant mount.
@@ -264,10 +264,10 @@ void KwikDisk::toggleMount(int item)
if( m_options.fileManager().isEmpty() == false )
{
TQString cmd = m_options.fileManager();
- int pos = cmd.tqfind("%m");
+ int pos = cmd.find("%m");
if( pos > 0 )
{
- cmd = cmd.tqreplace( pos, 2, KProcess::quote(disk->mountPoint()) ) + " &";
+ cmd = cmd.replace( pos, 2, KProcess::quote(disk->mountPoint()) ) + " &";
}
else
{
diff --git a/kdf/listview.cpp b/kdf/listview.cpp
index fc2dde6..df11e96 100644
--- a/kdf/listview.cpp
+++ b/kdf/listview.cpp
@@ -99,7 +99,7 @@ const TQPixmap &CListView::icon( const TQString &iconName, bool drawBorder )
}
}
- mPixDict.tqreplace( iconName, pix );
+ mPixDict.replace( iconName, pix );
}
return( *pix );
diff --git a/kdf/mntconfig.cpp b/kdf/mntconfig.cpp
index caf584c..12d968a 100644
--- a/kdf/mntconfig.cpp
+++ b/kdf/mntconfig.cpp
@@ -251,9 +251,9 @@ void MntConfigWidget::iconChangedButton(TQString iconName)
}
void MntConfigWidget::iconChanged(const TQString &iconName)
{
- if( iconName.tqfindRev('_') == 0 ||
- (iconName.right(iconName.length()-iconName.tqfindRev('_'))!="_mount" &&
- iconName.right(iconName.length()-iconName.tqfindRev('_'))!="_unmount"))
+ if( iconName.findRev('_') == 0 ||
+ (iconName.right(iconName.length()-iconName.findRev('_'))!="_mount" &&
+ iconName.right(iconName.length()-iconName.findRev('_'))!="_unmount"))
{
TQString msg = i18n(""
"This filename is not valid: %1\n"