rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdpkg@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 48371ee0af
commit 6bb0f6dafc

@ -222,16 +222,16 @@ TQStringList install::getVersions(TQString package)
TQStringList input = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() ); TQStringList input = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
TQString sysVersion = input[1]; TQString sysVersion = input[1];
sysVersion = TQStringList::split( ":", sysVersion)[1].tqreplace(" ",""); sysVersion = TQStringList::split( ":", sysVersion)[1].replace(" ","");
if( sysVersion.tqcontains("(") || sysVersion == "" ) if( sysVersion.contains("(") || sysVersion == "" )
sysVersion = i18n("not installed"); sysVersion = i18n("not installed");
TQString repVersion = input[2]; TQString repVersion = input[2];
repVersion = TQStringList::split( ":", repVersion)[1].tqreplace(" ",""); repVersion = TQStringList::split( ":", repVersion)[1].replace(" ","");
if( repVersion.tqcontains("(") || repVersion == "" ) if( repVersion.contains("(") || repVersion == "" )
repVersion = i18n("not available"); repVersion = i18n("not available");
@ -275,7 +275,7 @@ void install::showDependencies()
for(uint i = 0; i < allDepends.count(); i++) for(uint i = 0; i < allDepends.count(); i++)
{ {
if( allDepends[i].tqcontains("|") ) { if( allDepends[i].contains("|") ) {
tmp = TQStringList::split( " | ", allDepends[i] ); tmp = TQStringList::split( " | ", allDepends[i] );
uint j = 0; uint j = 0;
bool exit = FALSE; bool exit = FALSE;
@ -294,10 +294,10 @@ void install::showDependencies()
} }
} }
while (missingDepends.tqfind("(") != -1) { while (missingDepends.find("(") != -1) {
start_index = missingDepends.tqfind("("); start_index = missingDepends.find("(");
stop_index = missingDepends.tqfind(")", start_index); stop_index = missingDepends.find(")", start_index);
missingDepends.tqreplace(start_index, stop_index-start_index+1, ""); missingDepends.replace(start_index, stop_index-start_index+1, "");
} }
this->shell->setCommand("apt-get -s install "+missingDepends); this->shell->setCommand("apt-get -s install "+missingDepends);
this->shell->start(true); this->shell->start(true);
@ -309,10 +309,10 @@ void install::showDependencies()
TQString name = TQStringList::split( " ", installList[i] )[1]; TQString name = TQStringList::split( " ", installList[i] )[1];
TQString pkgVersion; TQString pkgVersion;
TQString sysVersion; TQString sysVersion;
if( installList[i].tqcontains("[") ) if( installList[i].contains("[") )
{ {
pkgVersion = TQStringList::split( " ", installList[i] )[3].mid(1); pkgVersion = TQStringList::split( " ", installList[i] )[3].mid(1);
sysVersion = TQStringList::split( " ", installList[i] )[2].mid(1).tqreplace("]", ""); sysVersion = TQStringList::split( " ", installList[i] )[2].mid(1).replace("]", "");
} }
else else
pkgVersion = TQStringList::split( " ", installList[i] )[2].mid(1); pkgVersion = TQStringList::split( " ", installList[i] )[2].mid(1);
@ -339,14 +339,14 @@ void install::showDependencies()
for(uint i = 0; i < input1.count(); i++) for(uint i = 0; i < input1.count(); i++)
{ {
if( input1[i].tqcontains(pkgName) ) if( input1[i].contains(pkgName) )
{ {
TQStringList input2 = TQStringList::split( "\n", input1[i] ); TQStringList input2 = TQStringList::split( "\n", input1[i] );
TQString name = TQStringList::split( " ", input2.grep("Package:")[0] )[1]; TQString name = TQStringList::split( " ", input2.grep("Package:")[0] )[1];
TQString cVersion = input2.grep("Conflicts:")[0].mid(11); // conflictVersion TQString cVersion = input2.grep("Conflicts:")[0].mid(11); // conflictVersion
cVersion = TQStringList::split( ",", cVersion ).grep(pkgName)[0]; cVersion = TQStringList::split( ",", cVersion ).grep(pkgName)[0];
cVersion = TQStringList::split( "(", cVersion )[1]; cVersion = TQStringList::split( "(", cVersion )[1];
cVersion = cVersion.tqreplace(")", ""); cVersion = cVersion.replace(")", "");
TQString op = TQStringList::split( " ", cVersion )[0]; TQString op = TQStringList::split( " ", cVersion )[0];
cVersion = TQStringList::split( " ", cVersion )[1]; cVersion = TQStringList::split( " ", cVersion )[1];
@ -370,12 +370,12 @@ void install::showDependencies()
// show packages which will be removed // show packages which will be removed
TQString conflicts = fields.grep( "Conflicts" )[0].mid(11); TQString conflicts = fields.grep( "Conflicts" )[0].mid(11);
conflicts = conflicts.tqreplace( ",", "" ); conflicts = conflicts.replace( ",", "" );
conflicts = conflicts+" "+rconflicts; conflicts = conflicts+" "+rconflicts;
while (conflicts.tqfind("(") != -1) { while (conflicts.find("(") != -1) {
start_index = conflicts.tqfind("("); start_index = conflicts.find("(");
stop_index = conflicts.tqfind(")", start_index); stop_index = conflicts.find(")", start_index);
conflicts.tqreplace(start_index, stop_index-start_index+1, ""); conflicts.replace(start_index, stop_index-start_index+1, "");
} }
this->shell->setCommand("apt-get -s remove "+conflicts); this->shell->setCommand("apt-get -s remove "+conflicts);
@ -386,7 +386,7 @@ void install::showDependencies()
for(uint i = 0; i < removeList.count(); i++) for(uint i = 0; i < removeList.count(); i++)
{ {
TQString name = TQStringList::split( " ", removeList[i] )[1]; TQString name = TQStringList::split( " ", removeList[i] )[1];
TQString sysVersion = TQStringList::split( " [", removeList[i] )[1].tqreplace("]", ""); TQString sysVersion = TQStringList::split( " [", removeList[i] )[1].replace("]", "");
TQListViewItem * item = new TQListViewItem( dependenciesListView, 0 ); TQListViewItem * item = new TQListViewItem( dependenciesListView, 0 );
item->setPixmap( 0, TQPixmap( m_kdePrefix + "/share/kdpkg/icons/remove.png") ); item->setPixmap( 0, TQPixmap( m_kdePrefix + "/share/kdpkg/icons/remove.png") );
@ -404,16 +404,16 @@ void install::showDependencies()
bool install::isInstalled(TQString input) bool install::isInstalled(TQString input)
{ {
TQString package = TQStringList::split( " ", input )[0]; TQString package = TQStringList::split( " ", input )[0];
TQString version = TQStringList::split( " (", input )[1].tqreplace(")", ""); TQString version = TQStringList::split( " (", input )[1].replace(")", "");
this->shell->setCommand("apt-cache policy "+package); this->shell->setCommand("apt-cache policy "+package);
this->shell->start(true); this->shell->start(true);
TQString sysVersion = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() )[1]; TQString sysVersion = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() )[1];
sysVersion = TQStringList::split( ":", sysVersion)[1].tqreplace(" ",""); sysVersion = TQStringList::split( ":", sysVersion)[1].replace(" ","");
if( sysVersion.tqcontains("(") || sysVersion == "" ) if( sysVersion.contains("(") || sysVersion == "" )
return FALSE; return FALSE;
else if( version != "" ) else if( version != "" )
{ {
@ -468,7 +468,7 @@ bool install::isLocked()
{ {
this->shell->setCommand("apt-get install -s" ); this->shell->setCommand("apt-get install -s" );
this->shell->start(true); this->shell->start(true);
if( this->shell->getBuffer().stripWhiteSpace().tqcontains("...") ) if( this->shell->getBuffer().stripWhiteSpace().contains("...") )
return FALSE; return FALSE;
else else
return TRUE; return TRUE;

@ -173,16 +173,16 @@ TQStringList kdpkg::getVersions(TQString package)
TQStringList input = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() ); TQStringList input = TQStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() );
TQString sysVersion = input[1]; TQString sysVersion = input[1];
sysVersion = TQStringList::split( ":", sysVersion)[1].tqreplace(" ",""); sysVersion = TQStringList::split( ":", sysVersion)[1].replace(" ","");
if( sysVersion.tqcontains("(") || sysVersion == "" ) if( sysVersion.contains("(") || sysVersion == "" )
sysVersion = i18n("not installed"); sysVersion = i18n("not installed");
TQString repVersion = input[2]; TQString repVersion = input[2];
repVersion = TQStringList::split( ":", repVersion)[1].tqreplace(" ",""); repVersion = TQStringList::split( ":", repVersion)[1].replace(" ","");
if( repVersion.tqcontains("(") || repVersion == "" ) if( repVersion.contains("(") || repVersion == "" )
repVersion = i18n("not available"); repVersion = i18n("not available");

Loading…
Cancel
Save