getting rid of some unneeded QRegExps

svn path=/trunk/kdepim/; revision=207583
wilder-work
Daniel Molkentin 23 years ago
parent 28628324cc
commit 3111ae92b4
  1. 4
      accountdialog.cpp
  2. 4
      kmcommands.cpp
  3. 8
      kmcomposewin.cpp
  4. 2
      kmfilteraction.cpp
  5. 2
      kmfolderdia.cpp
  6. 2
      kmfoldermbox.cpp
  7. 2
      kmfoldertree.cpp
  8. 2
      kmmainwidget.cpp
  9. 6
      kmmainwin.cpp
  10. 2
      kmmsgbase.cpp
  11. 2
      objecttreeparser.cpp
  12. 2
      syntaxhighlighter.cpp

@ -220,9 +220,7 @@ ProcmailRCParser::expandVars(const QString &s)
QAsciiDictIterator<QString> it( mVars ); // iterator for dict
while ( it.current() ) {
QString var = "\\$"; var += it.currentKey();
expS.replace(QRegExp(var), *it.current());
expS.replace(QString::fromLatin1("$")+it.currentKey(), *it.current());
++it;
}

@ -517,7 +517,7 @@ KMSaveMsgCommand::KMSaveMsgCommand( QWidget *parent,
QString subject = msgBase->subject();
while (subject.find(':') != -1)
subject = subject.mid(subject.find(':') + 1).stripWhiteSpace();
subject.replace(QRegExp(QChar(QDir::separator())), "_");
subject.replace(QChar(QDir::separator()), "_");
mUrl = KFileDialog::getSaveURL(subject, QString::null);
}
@ -1021,7 +1021,7 @@ QPopupMenu* KMMenuCommand::makeFolderMenu(KMFolderNode* node, bool move,
continue;
KMFolder *child = static_cast<KMFolder*>(it);
QString label = child->label();
label.replace(QRegExp("&"),QString("&&"));
label.replace("&","&&");
if (child->child() && child->child()->first()) {
// descend
QPopupMenu *subMenu = makeFolderMenu(child, move, receiver,

@ -2812,7 +2812,7 @@ QByteArray KMComposeWin::pgpSignedMsg( QCString cText,
dialog.resize( 700, 200 );
QCString signer = from().utf8();
signer.replace(QRegExp("\\x0001"), " ");
signer.replace("\x0001", " ");
kdDebug(5006) << "\n\nRetrieving keys for: " << from() << endl;
char* certificatePtr = 0;
@ -3292,7 +3292,7 @@ KMComposeWin::getEncryptionCertificate( const QString& recipient )
bool bEncrypt = true;
QCString addressee = recipient.utf8();
addressee.replace(QRegExp("\\x0001"), " ");
addressee.replace("\x0001", " ");
kdDebug(5006) << "\n\n1st try: Retrieving keys for: " << recipient << endl;
@ -5345,8 +5345,8 @@ void KMLineEdit::smartInsert( const QString &str, int pos /* = -1 */ )
else if (-1 != newText.find(" at "))
{
// Anti-spam stuff
newText.replace( QRegExp(" at "), "@" );
newText.replace( QRegExp(" dot "), "." );
newText.replace( " at ", "@" );
newText.replace( " dot ", "." );
}
else if (newText.contains("(at)"))
{

@ -410,7 +410,7 @@ QString KMFilterActionWithCommand::substituteCommandLineArgsFor( KMMessage *aMsg
// QString( "%0 and %1 and %1" ).arg( 0 ).arg( 1 )
// returns "0 and 1 and %1", so we must call .arg as
// many times as there are %n's, regardless of their multiplicity.
if ((*it) == -1) result.replace( QRegExp("%-1"), tempFileName );
if ((*it) == -1) result.replace( "%-1", tempFileName );
else result = result.arg( tempFileName );
}

@ -489,7 +489,7 @@ void KMFolderDialog::slotOk()
if (folder) oldFldName = folder->name();
if (!nameEdit->text().isEmpty()) fldName = nameEdit->text();
else fldName = oldFldName;
fldName.replace(QRegExp("/"), "");
fldName.replace("/", "");
fldName.replace(QRegExp("^\\.*"), "");
if (fldName.isEmpty()) fldName = i18n("unnamed");

@ -847,7 +847,7 @@ if( fileD1.open( IO_WriteOnly ) ) {
aMsg->removeHeaderField("Content-Type"); // the line above
}
msgText = aMsg->asString();
msgText.replace(QRegExp("\nFrom "),"\n>From ");
msgText.replace("\nFrom ", "\n>From ");
size_t len = msgText.length();
assert(mStream != 0);

@ -1418,7 +1418,7 @@ void KMFolderTree::slotRenameFolder(QListViewItem *item, int col,
else
fldName = oldFldName;
fldName.replace(QRegExp("/"), "");
fldName.replace("/", "");
fldName.replace(QRegExp("^\\."), "");
if (fldName.isEmpty())

@ -1856,7 +1856,7 @@ void KMMainWidget::getAccountMenu()
QStringList::Iterator it;
int id = 0;
for(it = actList.begin(); it != actList.end() ; ++it, id++)
actMenu->insertItem((*it).replace(QRegExp("&"),"&&"), id);
actMenu->insertItem((*it).replace("&", "&&"), id);
}
// little helper function

@ -92,9 +92,9 @@ void KMMainWin::displayStatusMsg(const QString& aText)
// ### FIXME: We should disable richtext/HTML (to avoid possible denial of service attacks),
// but this code would double the size of the satus bar if the user hovers
// over an <foo@bar.com>-style email address :-(
// text.replace(QRegExp("&"), "&amp;");
// text.replace(QRegExp("<"), "&lt;");
// text.replace(QRegExp(">"), "&gt;");
// text.replace("&", "&amp;");
// text.replace("<", "&lt;");
// text.replace(">", "&gt;");
statusBar()->changeItem(text, mMessageStatusId);
}

@ -472,7 +472,7 @@ const QString dontQuote = "\"()<>,@";
QCString KMMsgBase::encodeRFC2047Quoted(const QCString& aStr, bool base64)
{
if (base64)
return encodeBase64(aStr).replace(QRegExp("\n"),"");
return encodeBase64(aStr).replace("\n","");
QCString result;
unsigned char ch, hex;
for (unsigned int i = 0; i < aStr.length(); i++)

@ -1579,7 +1579,7 @@ QString ObjectTreeParser::byteArrayToTempFile( KMReaderWin* reader,
DwHeaders& headers( curNode->dwPart()->Headers() );
QCString ctypStr( headers.ContentType().AsString().c_str() );
ctypStr.replace( QRegExp("\""), "" );
ctypStr.replace( "\"", "" );
bool isSigned = 0 <= ctypStr.find("smime-type=signed-data", 0, false);
bool isEncrypted = 0 <= ctypStr.find("smime-type=enveloped-data", 0, false);

@ -61,7 +61,7 @@ MessageHighlighter::~MessageHighlighter()
int MessageHighlighter::highlightParagraph( const QString &text, int )
{
QString simplified = text;
simplified = simplified.replace( QRegExp( "\\s" ), "" ).replace( QRegExp( "\\|" ), ">" );
simplified = simplified.replace( "\s", QString::null ).replace( "|", ">" );
while ( simplified.startsWith( ">>>>" ) )
simplified = simplified.mid(3);
if ( simplified.startsWith( ">>>" ) || simplified.startsWith( "> > >" ) )

Loading…
Cancel
Save