aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Elvio Basello2011-02-08 18:45:13 +0000
committerGravatar Elvio Basello2011-02-08 18:45:13 +0000
commit5e07d082aa116015f03c88635b5b1e4af2e501d6 (patch)
treef708fb1323673606f78bba4f8bc7bf61aea09185
parentdisclaimer for minimize in tray (diff)
downloadKVIrc-5e07d082aa116015f03c88635b5b1e4af2e501d6.tar.gz
KVIrc-5e07d082aa116015f03c88635b5b1e4af2e501d6.tar.bz2
KVIrc-5e07d082aa116015f03c88635b5b1e4af2e501d6.zip
removed old helper functions
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5436 17fca916-40b9-46aa-a4ea-0a15b648b75c
-rw-r--r--doc/TODO-docs36
-rw-r--r--src/kvilib/core/KviQString.h162
-rw-r--r--src/kvilib/ext/KviStringConversion.cpp175
-rw-r--r--src/kvilib/file/KviPackageReader.cpp2
-rw-r--r--src/kvilib/irc/KviIrcServerDataBase.cpp4
-rw-r--r--src/modules/mircimport/libkvimircimport.cpp13
6 files changed, 145 insertions, 247 deletions
diff --git a/doc/TODO-docs b/doc/TODO-docs
index 95f683b3e..2a2941b19 100644
--- a/doc/TODO-docs
+++ b/doc/TODO-docs
@@ -41,7 +41,7 @@
KviCString.cpp
KviCString.h
-+ KviError.cpp
+++KviError.cpp
+ KviError.h
KviHeapObject.cpp
KviHeapObject.h
@@ -70,7 +70,7 @@
KviCryptEngine.cpp
KviCryptEngine.h
+ KviCryptEngineDescription.h
-+ KviCryptEngineManager.cpp
+++KviCryptEngineManager.cpp
+ KviCryptEngineManager.h
KviDataBuffer.cpp
KviDataBuffer.h
@@ -105,7 +105,7 @@
KviProxy.h
KviProxyDataBase.cpp
KviProxyDataBase.h
-+ KviRegisteredChannel.cpp
+++KviRegisteredChannel.cpp
+ KviRegisteredChannel.h
KviRegisteredChannelDataBase.cpp
+ KviRegisteredChannelDataBase.h
@@ -113,15 +113,15 @@
+ KviRegisteredUser.h
KviRegisteredUserDataBase.cpp
KviRegisteredUserDataBase.h
-+ KviRegisteredUserGroup.cpp
+++KviRegisteredUserGroup.cpp
+ KviRegisteredUserGroup.h
-+ KviRegisteredUserMask.cpp
+++KviRegisteredUserMask.cpp
+ KviRegisteredUserMask.h
-+ KviSharedFile.cpp
+++KviSharedFile.cpp
+ KviSharedFile.h
KviSharedFilesManager.cpp
KviSharedFilesManager.h
- KviStringConversion.cpp
+++KviStringConversion.cpp
KviStringConversion.h
KviXlib.h
@@ -130,16 +130,16 @@
# kvilib/ext/avdevice #
#######################
-bayer.cpp
-bayer.h
-sonix_compress.cpp
-sonix_compress.h
-videodevice.cpp
-videodevice.h
-videodevicepool.cpp
-videodevicepool.h
-videoinput.cpp
-videoinput.h
+ bayer.cpp
+ bayer.h
+ sonix_compress.cpp
+ sonix_compress.h
+ videodevice.cpp
+ videodevice.h
+ videodevicepool.cpp
+ videodevicepool.h
+ videoinput.cpp
+ videoinput.h
###############
@@ -1380,6 +1380,8 @@ videoinput.h
BlowFish.h
Rijndael.cpp
Rijndael.h
+ UglyBase64.cpp
+ UglyBase64.h
libkvirijndael.cpp
libkvirijndael.h
libkvirijndael_cryptopp.cpp
diff --git a/src/kvilib/core/KviQString.h b/src/kvilib/core/KviQString.h
index ae965dceb..01cea9d0b 100644
--- a/src/kvilib/core/KviQString.h
+++ b/src/kvilib/core/KviQString.h
@@ -46,13 +46,17 @@
*/
namespace KviQString
{
- enum EscapeKvsFlags
+ /**
+ * \enum EscapeKVSFlags
+ * \brief Holds the flags to escape KVS
+ */
+ enum EscapeKVSFlags
{
- EscapeSpace = 1,
- PermitVariables = 2,
- PermitFunctions = 4,
- PermitMultiLine = 8,
- EscapeParenthesis = 16,
+ EscapeSpace = 1, /**< escapes spaces */
+ PermitVariables = 2, /**< escapes '%' character to permit variables */
+ PermitFunctions = 4, /**< escapes '$' character to permit functions */
+ PermitMultiLine = 8, /**< escapes '\r' and '\n' characters */
+ EscapeParenthesis = 16, /**< escapes parenthesis */
};
/**
@@ -414,8 +418,9 @@ namespace KviQString
* \param szSrc The source string
* \param c The char to search for
* \param bIncluded Wheter to include the given char in the returned string
- * \param bReturnFullStringIfNotFound True if we want the function to return the whole string if the char isn't found and
- * false if we want the function to return an empty string in this case.
+ * \param bReturnFullStringIfNotFound True if we want the function to return the whole
+ * string if the char isn't found and false if we want the function to return an empty
+ * string in this case.
* \return void
*/
extern KVILIB_API QString leftToFirst(QString & szSrc, const QChar & c, bool bIncluded = true, bool bReturnFullStringIfNotFound = true);
@@ -427,8 +432,9 @@ namespace KviQString
* \param szSrc The source string
* \param szFind The string to search for
* \param bIncluded Wheter to include the given string in the returned string
- * \param bReturnFullStringIfNotFound True if we want the function to return the whole string if the string isn't found and
- * false if we want the function to return an empty string in this case.
+ * \param bReturnFullStringIfNotFound True if we want the function to return the whole
+ * string if the string isn't found and false if we want the function to return an empty
+ * string in this case.
* \return void
*/
extern KVILIB_API QString leftToFirst(QString & szSrc, const QString & szFind, bool bIncluded = true, bool bReturnFullStringIfNotFound = true);
@@ -440,8 +446,9 @@ namespace KviQString
* \param szSrc The source string
* \param c The char to search for
* \param bIncluded Wheter to include the given char in the returned string
- * \param bReturnFullStringIfNotFound True if we want the function to return the whole string if the char isn't found and
- * false if we want the function to return an empty string in this case.
+ * \param bReturnFullStringIfNotFound True if we want the function to return the whole
+ * string if the char isn't found and false if we want the function to return an empty
+ * string in this case.
* \return void
*/
extern KVILIB_API QString leftToLast(QString & szSrc, const QChar & c, bool bIncluded = true, bool bReturnFullStringIfNotFound = true);
@@ -453,8 +460,9 @@ namespace KviQString
* \param szSrc The source string
* \param szFind The string to search for
* \param bIncluded Wheter to include the given string in the returned string
- * \param bReturnFullStringIfNotFound True if we want the function to return the whole string if the string isn't found and
- * false if we want the function to return an empty string in this case.
+ * \param bReturnFullStringIfNotFound True if we want the function to return the whole
+ * string if the string isn't found and false if we want the function to return an empty
+ * string in this case.
* \return void
*/
extern KVILIB_API QString leftToLast(QString & szSrc, const QString & szFind, bool bIncluded = true, bool bReturnFullStringIfNotFound = true);
@@ -499,130 +507,6 @@ namespace KviQString
extern KVILIB_API void bufferToHex(QString & szRetBuffer, const unsigned char * pcBuffer, unsigned int uLen);
/**
- * \brief Returns the index position of the last occurrence of the character
- *
- * The search is made forward starting from index.
- * \param szSrc The source string
- * \param c The character to find
- * \param iIndex The index to start from
- * \param bCs Case sensitive search
- * \return int
- */
- inline int find(const QString & szSrc, QChar c, int iIndex = 0, bool bCs = true)
- {
- return szSrc.indexOf(c,iIndex,bCs ? Qt::CaseSensitive : Qt::CaseInsensitive);
- }
-
- /**
- * \brief Returns the index position of the last occurrence of the character
- *
- * The search is made forward starting from index.
- * \param szSrc The source string
- * \param c The character to find
- * \param iIndex The index to start from
- * \param bCs Case sensitive search
- * \return int
- */
- inline int find(const QString & szSrc, char c, int iIndex = 0, bool bCs = true)
- {
- return szSrc.indexOf(c,iIndex,bCs ? Qt::CaseSensitive : Qt::CaseInsensitive);
- }
-
- /**
- * \brief Returns the index position of the last occurrence of the string
- *
- * The search is made forward starting from index.
- * \param szSrc The source string
- * \param szStr The string to find
- * \param iIndex The index to start from
- * \param bCs Case sensitive search
- * \return int
- */
- inline int find(const QString & szSrc, const QString & szStr, int iIndex = 0, bool bCs = true)
- {
- return szSrc.indexOf(szStr,iIndex,bCs ? Qt::CaseSensitive : Qt::CaseInsensitive);
- }
-
- /**
- * \brief Returns the index position of the last occurrence of the string
- *
- * The search is made forward starting from index.
- * \param szSrc The source string
- * \param pcStr The string to find
- * \param iIndex The index to start from
- * \param bCs Case sensitive search
- * \return int
- */
- inline int find(const QString & szSrc, const char * pcStr, int iIndex = 0, bool bCs = true)
- {
- return szSrc.indexOf(QString(pcStr),iIndex,bCs ? Qt::CaseSensitive : Qt::CaseInsensitive);
- }
-
- /**
- * \brief Returns the index position of the last occurrence of the character
- *
- * The search is made backward.
- * If index is -1 the search starts at the last character.
- * \param szSrc The source string
- * \param c The character to find
- * \param iIndex The index to start from
- * \param bCs Case sensitive search
- * \return int
- */
- inline int findRev(const QString & szSrc, QChar c, int iIndex = -1, bool bCs = true)
- {
- return szSrc.lastIndexOf(c,iIndex,bCs ? Qt::CaseSensitive : Qt::CaseInsensitive);
- }
-
- /**
- * \brief Returns the index position of the last occurrence of the character
- *
- * The search is made backward.
- * If index is -1 the search starts at the last character.
- * \param szSrc The source string
- * \param c The character to find
- * \param iIndex The index to start from
- * \param bCs Case sensitive search
- * \return int
- */
- inline int findRev(const QString & szSrc, char c, int iIndex = -1, bool bCs = true)
- {
- return szSrc.lastIndexOf(c,iIndex,bCs ? Qt::CaseSensitive : Qt::CaseInsensitive);
- }
-
- /**
- * \brief Returns the index position of the last occurrence of the given string
- *
- * The search is made backward.
- * If index is -1 the search starts at the last character.
- * \param szSrc The source string
- * \param szStr The string to find
- * \param iIndex The index to start from
- * \param bCs Case sensitive search
- * \return int
- */
- inline int findRev(const QString & szSrc, const QString & szStr, int iIndex = -1, bool bCs = true)
- {
- return szSrc.lastIndexOf(szStr,iIndex,bCs ? Qt::CaseSensitive : Qt::CaseInsensitive);
- }
-
- /**
- * \brief Returns the index position of the last occurrence of the given string
- *
- * The search is made backward.
- * If index is -1 the search starts at the last character.
- * \param szSrc The source string
- * \param pcStr The string to find
- * \param iIndex The index to start from
- * \param bCs Case sensitive search
- * \return int
- */
- inline int findRev(const QString & szSrc, const char * pcStr, int iIndex = -1, bool bCs = true)
- {
- return szSrc.lastIndexOf(QString(pcStr),iIndex,bCs ? Qt::CaseSensitive : Qt::CaseInsensitive);
- }
-
- /**
* \brief Return the string converted to a long
* \param szNumber The source number
* \param bOk The conversion error handling
@@ -655,7 +539,7 @@ namespace KviQString
/**
* \brief Escapes any kvs special character from a string
* \param szData The string to escape
- * \param uFlags
+ * \param uFlags The flag which correspond to the characters to escape
* \return void
*/
extern KVILIB_API void escapeKvs(QString * szData, uint uFlags = 0);
diff --git a/src/kvilib/ext/KviStringConversion.cpp b/src/kvilib/ext/KviStringConversion.cpp
index e713bd698..a5287b5f6 100644
--- a/src/kvilib/ext/KviStringConversion.cpp
+++ b/src/kvilib/ext/KviStringConversion.cpp
@@ -35,148 +35,148 @@ QString g_szLocalDir;
namespace KviStringConversion
{
- void init(const QString& szGlobalDir,const QString& szLocalDir)
+ void init(const QString & szGlobalDir, const QString & szLocalDir)
{
- g_szGlobalDir=szGlobalDir;
- g_szLocalDir=szLocalDir;
+ g_szGlobalDir = szGlobalDir;
+ g_szLocalDir = szLocalDir;
}
- void encodePath(QString& buffer)
+ void encodePath(QString & szBuffer)
{
- if(!buffer.isEmpty())
+ if(!szBuffer.isEmpty())
{
if(!g_szLocalDir.isEmpty())
{
- if(KviQString::find(buffer,g_szLocalDir)==0)
+ if(szBuffer.indexOf(g_szLocalDir,0,Qt::CaseSensitive) == 0)
{
- buffer.remove(0,g_szLocalDir.length());
- buffer.prepend("local://");
+ szBuffer.remove(0,g_szLocalDir.length());
+ szBuffer.prepend("local://");
}
}
if(!g_szGlobalDir.isEmpty())
{
- if(KviQString::find(buffer,g_szGlobalDir)==0)
+ if(szBuffer.indexOf(g_szGlobalDir,0,Qt::CaseSensitive) == 0)
{
- buffer.remove(0,g_szGlobalDir.length());
- buffer.prepend("global://");
+ szBuffer.remove(0,g_szGlobalDir.length());
+ szBuffer.prepend("global://");
}
}
}
}
- void decodePath(QString& buffer)
+ void decodePath(QString & szBuffer)
{
- if(!buffer.isEmpty())
+ if(!szBuffer.isEmpty())
{
if(!g_szLocalDir.isEmpty())
{
- if(KviQString::find(buffer,"local://")==0)
+ if(szBuffer.indexOf("local://",0,Qt::CaseSensitive) == 0)
{
- buffer.remove(0,8);
- buffer.prepend(g_szLocalDir);
+ szBuffer.remove(0,8);
+ szBuffer.prepend(g_szLocalDir);
}
}
if(!g_szGlobalDir.isEmpty())
{
- if(KviQString::find(buffer,"global://")==0)
+ if(szBuffer.indexOf("global://",0,Qt::CaseSensitive) == 0)
{
- buffer.remove(0,9);
- buffer.prepend(g_szGlobalDir);
+ szBuffer.remove(0,9);
+ szBuffer.prepend(g_szGlobalDir);
}
}
}
}
- void encodePath(QStringList& buffer)
+ void encodePath(QStringList & buffer)
{
- for ( QStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it )
- {
+ for(QStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it)
encodePath(*it);
- }
}
- void decodePath(QStringList& buffer)
+ void decodePath(QStringList & buffer)
{
- for ( QStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it )
- {
+ for(QStringList::Iterator it = buffer.begin(); it != buffer.end(); ++it)
decodePath(*it);
- }
}
- void toString(const bool bValue,QString &buffer)
+ void toString(const bool bValue, QString & szBuffer)
{
- buffer = bValue ? '1' : '0';
+ szBuffer = bValue ? '1' : '0';
}
- bool fromString(const QString & szValue,bool &buffer)
+ bool fromString(const QString & szValue, bool & bBuffer)
{
- if(szValue.isEmpty())buffer = false;
- else buffer = !((KviQString::equalCS(szValue,"0")) || (KviQString::equalCI(szValue,"false")));
+ if(szValue.isEmpty())
+ bBuffer = false;
+ else bBuffer = !((KviQString::equalCS(szValue,"0")) || (KviQString::equalCI(szValue,"false")));
return true;
}
- void toString(const int iValue,QString &buffer)
+ void toString(const int iValue, QString & szBuffer)
{
- buffer.setNum(iValue);
+ szBuffer.setNum(iValue);
}
- bool fromString(const QString &szValue,int &buffer)
+ bool fromString(const QString & szValue, int & iBuffer)
{
bool bOk;
- buffer = szValue.toInt(&bOk);
+ iBuffer = szValue.toInt(&bOk);
return bOk;
}
- void toString(const unsigned int uValue,QString &buffer)
+ void toString(const unsigned int uValue, QString & szBuffer)
{
- buffer.setNum(uValue);
+ szBuffer.setNum(uValue);
}
- bool fromString(const QString & szValue,unsigned int &buffer)
+ bool fromString(const QString & szValue,unsigned int & uBuffer)
{
bool bOk;
- buffer= szValue.toUInt(&bOk);
+ uBuffer = szValue.toUInt(&bOk);
return bOk;
}
- void toString(const QRect &rValue,QString &buffer)
+ void toString(const QRect & rValue, QString & szBuffer)
{
- buffer.sprintf("%d,%d,%d,%d",rValue.x(),rValue.y(),rValue.width(),rValue.height());
+ szBuffer.sprintf("%d,%d,%d,%d",rValue.x(),rValue.y(),rValue.width(),rValue.height());
}
- bool fromString(const QString & szValue,QRect &buffer)
+ bool fromString(const QString & szValue, QRect & buffer)
{
QByteArray tmp = szValue.toUtf8();
const char * c = tmp.data();
- if(!c)return false;
+ if(!c)
+ return false;
int l,t,w,h;
- if(sscanf(c,"%d,%d,%d,%d",&l,&t,&w,&h) != 4)return false;
+ if(sscanf(c,"%d,%d,%d,%d",&l,&t,&w,&h) != 4)
+ return false;
buffer.setRect(l,t,w,h);
return true;
}
- void toString(const QString &szValue,QString &buffer)
+ void toString(const QString & szValue, QString & szBuffer)
{
- buffer = szValue;
+ szBuffer = szValue;
}
- bool fromString(const QString & szValue,QString &buffer)
+ bool fromString(const QString & szValue, QString & szBuffer)
{
- buffer = szValue;
+ szBuffer = szValue;
return true;
}
- void toString(const KviPixmap &pValue,QString &buffer)
+ void toString(const KviPixmap & pixmap, QString & szBuffer)
{
- buffer=pValue.path();
- encodePath(buffer);
+ szBuffer = pixmap.path();
+ encodePath(szBuffer);
}
- bool fromString(const QString & szValue,KviPixmap &buffer)
+ bool fromString(const QString & szValue, KviPixmap & buffer)
{
QString szPath(szValue);
decodePath(szPath);
- if(szPath.isEmpty()) {
+ if(szPath.isEmpty())
+ {
buffer.setNull();
return true;
} else {
@@ -184,52 +184,59 @@ namespace KviStringConversion
}
}
- void toString(const KviMessageTypeSettings &mValue,QString &buffer)
+ void toString(const KviMessageTypeSettings & mValue, QString & szBuffer)
{
- buffer.sprintf("%d,%u,%u,%d,%d",mValue.m_iPixId,mValue.m_cForeColor,mValue.m_cBackColor,mValue.m_bLogEnabled,mValue.m_iLevel);
+ szBuffer.sprintf("%d,%u,%u,%d,%d",mValue.m_iPixId,mValue.m_cForeColor,mValue.m_cBackColor,mValue.m_bLogEnabled,mValue.m_iLevel);
}
- bool fromString(const QString & szValue,KviMessageTypeSettings &buffer)
+ bool fromString(const QString & szValue, KviMessageTypeSettings & buffer)
{
int iId,iLog,iLevel;
unsigned int uFore,uBack;
QByteArray tmp = szValue.toUtf8();
char * cx = tmp.data();
- if(!cx)return false;
- if(sscanf(cx,"%d,%u,%u,%d,%d",&iId,&uFore,&uBack,&iLog,&iLevel) != 5)return false;
+ if(!cx)
+ return false;
+ if(sscanf(cx,"%d,%u,%u,%d,%d",&iId,&uFore,&uBack,&iLog,&iLevel) != 5)
+ return false;
buffer = KviMessageTypeSettings(buffer.m_szType,iId,uFore,uBack,iLog,iLevel);
return true;
}
- void toString(const QColor &cValue,QString &buffer)
+ void toString(const QColor & value, QString & szBuffer)
{
- buffer = cValue.name();
+ szBuffer = value.name();
}
- bool fromString(const QString & szValue,QColor &buffer)
+ bool fromString(const QString & szValue, QColor & buffer)
{
buffer.setNamedColor(szValue); return true;
}
- void toString(const QFont &fValue,QString &buffer)
+ void toString(const QFont & font, QString & szBuffer)
{
- QString family(fValue.family());
- buffer.sprintf("%s,%d,%d,%d",family.toUtf8().data(),fValue.pointSize(),fValue.styleHint(),fValue.weight());
- QString options;
- if(fValue.bold())options.append('b');
- if(fValue.italic())options.append('i');
- if(fValue.underline())options.append('u');
- if(fValue.strikeOut())options.append('s');
- if(fValue.fixedPitch())options.append('f');
+ QString szFamily(font.family());
+ szBuffer.sprintf("%s,%d,%d,%d",szFamily.toUtf8().data(),font.pointSize(),font.styleHint(),font.weight());
+ QString szOptions;
+ if(font.bold())
+ szOptions.append('b');
+ if(font.italic())
+ szOptions.append('i');
+ if(font.underline())
+ szOptions.append('u');
+ if(font.strikeOut())
+ szOptions.append('s');
+ if(font.fixedPitch())
+ szOptions.append('f');
- if(!options.isEmpty())
+ if(!szOptions.isEmpty())
{
- buffer.append(',');
- buffer.append(options);
+ szBuffer.append(',');
+ szBuffer.append(szOptions);
}
}
- bool fromString(const QString & szValue,QFont &buffer)
+ bool fromString(const QString & szValue, QFont & buffer)
{
KviCString str = szValue;
KviCString family,pointSize,styleHint,weight,options;
@@ -237,15 +244,19 @@ namespace KviStringConversion
str.getToken(pointSize,',');
str.getToken(styleHint,',');
str.getToken(weight,',');
- if(!family.isEmpty())buffer.setFamily(family.ptr());
+ if(!family.isEmpty())
+ buffer.setFamily(family.ptr());
int i;
bool bOk;
i = pointSize.toInt(&bOk);
- if(bOk && (i > 0))buffer.setPointSize(i);
+ if(bOk && (i > 0))
+ buffer.setPointSize(i);
i = styleHint.toInt(&bOk);
- if(bOk && (i >= 0))buffer.setStyleHint((QFont::StyleHint)i);
+ if(bOk && (i >= 0))
+ buffer.setStyleHint((QFont::StyleHint)i);
i = weight.toInt(&bOk);
- if(bOk && (i >= 0))buffer.setWeight(i);
+ if(bOk && (i >= 0))
+ buffer.setWeight(i);
buffer.setBold(str.contains("b"));
buffer.setItalic(str.contains("i"));
@@ -255,12 +266,12 @@ namespace KviStringConversion
return true;
}
- void toString(const QStringList &sValue,QString &buffer)
+ void toString(const QStringList & list,QString & szBuffer)
{
- buffer = sValue.join(",");
+ szBuffer = list.join(",");
}
- bool fromString(const QString & szValue,QStringList &buffer)
+ bool fromString(const QString & szValue, QStringList & buffer)
{
buffer = szValue.split(",");
return true;
diff --git a/src/kvilib/file/KviPackageReader.cpp b/src/kvilib/file/KviPackageReader.cpp
index f5760e6d9..f4845c3c4 100644
--- a/src/kvilib/file/KviPackageReader.cpp
+++ b/src/kvilib/file/KviPackageReader.cpp
@@ -175,7 +175,7 @@ bool KviPackageReader::unpackFile(KviFile * pFile,const QString &szUnpackPath)
KviFileUtils::adjustFilePath(szFileName);
- int idx = KviQString::findRev(szFileName,QChar(KVI_PATH_SEPARATOR_CHAR));
+ int idx = szFileName.lastIndexOf(QChar(KVI_PATH_SEPARATOR_CHAR),0,Qt::CaseSensitive);
if(idx != -1)
{
QString szPrefixPath = szFileName.left(idx);
diff --git a/src/kvilib/irc/KviIrcServerDataBase.cpp b/src/kvilib/irc/KviIrcServerDataBase.cpp
index 654e6733d..2d4a88560 100644
--- a/src/kvilib/irc/KviIrcServerDataBase.cpp
+++ b/src/kvilib/irc/KviIrcServerDataBase.cpp
@@ -325,7 +325,7 @@ void parseMircServerRecord(QString szEntry, QString & szNet,
QString & szDescription, QString & szHost, QString & szPort, bool & bSsl, kvi_u32_t & uPort)
{
bSsl = false;
- int iIdx = KviQString::find(szEntry,"SERVER:");
+ int iIdx = szEntry.indexOf("SERVER:",0,Qt::CaseSensitive);
if(iIdx != -1)
{
szDescription = szEntry.left(iIdx);
@@ -333,7 +333,7 @@ QString & szDescription, QString & szHost, QString & szPort, bool & bSsl, kvi_u3
szDescription = szDescription.section(':',1,1);
szEntry.remove(0,iIdx + 7);
- iIdx = KviQString::find(szEntry,"GROUP:");
+ iIdx = szEntry.indexOf("GROUP:",0,Qt::CaseSensitive);
if(iIdx != -1)
{
szHost = szEntry.left(iIdx);
diff --git a/src/modules/mircimport/libkvimircimport.cpp b/src/modules/mircimport/libkvimircimport.cpp
index 17632b397..824b454a9 100644
--- a/src/modules/mircimport/libkvimircimport.cpp
+++ b/src/modules/mircimport/libkvimircimport.cpp
@@ -31,7 +31,6 @@
#include "KviLocale.h"
#include "KviConfigurationFile.h"
#include "KviApplication.h"
-#include "KviQString.h"
#include "KviTalVBox.h"
#include <QMessageBox>
@@ -73,31 +72,33 @@ int KviMircServersIniImport::doImport(const QString& filename)
QString port;
kvi_u32_t uPort = 0;
// <description>SERVER:<server:port>GROUP:<network>
- int idx = KviQString::find(entry,"SERVER:");
+ int idx = entry.indexOf("SERVER:",0,Qt::CaseSensitive);
if(idx != -1)
{
description = entry.left(idx);
entry.remove(0,idx + 7);
- idx = KviQString::find(entry,"GROUP:");
+ idx = entry.indexOf("GROUP:",0,Qt::CaseSensitive);
if(idx != -1)
{
port = entry.left(idx);
entry.remove(0,idx + 6);
}
- idx = KviQString::find(port,':');
+ idx = port.indexOf(':',0,Qt::CaseSensitive);
if(idx != -1)
{
serv = port.left(idx);
port.remove(0,idx + 1);
bool bOk;
uPort = port.toUInt(&bOk);
- if(!bOk)uPort = 6667;
+ if(!bOk)
+ uPort = 6667;
} else {
serv = port;
uPort = 6667;
}
}
- if(entry.isEmpty())entry = __tr2qs("Standalone Servers");
+ if(entry.isEmpty())
+ entry = __tr2qs("Standalone Servers");
if(!serv.isEmpty())
{
KviIrcServer s;