Fix long response time on large IMAP folders

This closes Bug 1009
Thanks to Francois Andriot for the patch!
(cherry picked from commit b0c92b30a6)
v3.5.13-sru
Slávek Banko 13 years ago
parent b60e74f6ad
commit ead8cb696e

@ -436,49 +436,26 @@ TQCString LFtoCRLF(const TQCString &s)
void removeQuots(TQCString &str)
{
bool inQuote=false;
for (int i=0; i < (int)str.length(); i++) {
if (str[i] == '"') {
str.remove(i,1);
i--;
inQuote = !inQuote;
} else {
if (inQuote && (str[i] == '\\'))
str.remove(i,1);
}
}
str.replace(TQRegExp("\\\""), "\"");
str.replace(TQRegExp("\\\\"), "\\");
}
void removeQuots(TQString &str)
{
bool inQuote=false;
for (int i=0; i < (int)str.length(); i++) {
if (str[i] == '"') {
str.remove(i,1);
i--;
inQuote = !inQuote;
} else {
if (inQuote && (str[i] == '\\'))
str.remove(i,1);
}
}
str.replace(TQRegExp("\\\""), "\"");
str.replace(TQRegExp("\\\\"), "\\");
}
void addQuotes(TQCString &str, bool forceQuotes)
{
bool needsQuotes=false;
for (unsigned int i=0; i < str.length(); i++) {
if (strchr("()<>@,.;:[]=\\\"",str[i])!=0)
if ( TQString( str ) .contains( TQRegExp( TQString( "\"|\\\\|=|\\]|\\[|:|;|,|\\.|,|@|<|>|\\)|\\(" ) ) ) )
needsQuotes = true;
if (str[i]=='\\' || str[i]=='\"') {
str.insert(i, '\\');
i++;
}
}
str.replace(TQRegExp("\\"), "\\\\");
str.replace(TQRegExp("\""), "\\\"");
if (needsQuotes || forceQuotes) {
str.insert(0,'\"');

Loading…
Cancel
Save