summaryrefslogtreecommitdiffabout
path: root/kabc/vcard/VCardv.cpp
Side-by-side diff
Diffstat (limited to 'kabc/vcard/VCardv.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/VCardv.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp
index bad2ef1..5dd675d 100644
--- a/kabc/vcard/VCardv.cpp
+++ b/kabc/vcard/VCardv.cpp
@@ -18,17 +18,17 @@
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include <qcstring.h>
-#include <qstrlist.h>
+#include <q3cstring.h>
+#include <q3strlist.h>
#include <qstringlist.h>
#include <qstring.h>
-#include <qvaluelist.h>
+#include <q3valuelist.h>
#include <VCardEntity.h>
#include <VCardVCard.h>
#include <VCardContentLine.h>
#include <VCardRToken.h>
@@ -45,44 +45,44 @@ VCard::VCard()
VCard::VCard(const VCard & x)
: Entity(x),
group_(x.group_)
{
contentLineList_.setAutoDelete( TRUE );
- QPtrListIterator<ContentLine> it(x.contentLineList_);
+ Q3PtrListIterator<ContentLine> it(x.contentLineList_);
for (; it.current(); ++it) {
ContentLine * c = new ContentLine(*it.current());
contentLineList_.append(c);
}
}
-VCard::VCard(const QCString & s)
+VCard::VCard(const Q3CString & s)
: Entity(s)
{
contentLineList_.setAutoDelete( TRUE );
}
VCard &
VCard::operator = (VCard & x)
{
if (*this == x) return *this;
group_ = x.group();
- QPtrListIterator<ContentLine> it(x.contentLineList_);
+ Q3PtrListIterator<ContentLine> it(x.contentLineList_);
for (; it.current(); ++it) {
ContentLine * c = new ContentLine(*it.current());
contentLineList_.append(c);
}
Entity::operator = (x);
return *this;
}
VCard &
-VCard::operator = (const QCString & s)
+VCard::operator = (const Q3CString & s)
{
Entity::operator = (s);
return *this;
}
bool
@@ -98,21 +98,22 @@ VCard::~VCard()
void
VCard::_parse()
{
QStringList l;
- QStrList sl;
+ Q3StrList sl;
RTokenise(strRep_, "\r\n", sl);
if (sl.count() < 3) { // Invalid VCARD !
//qDebug("invalid vcard ");
return;
}
- l = QStringList::fromStrList( sl );
+ for(Q3StrList::iterator i=sl.begin();i!=sl.end();++i)
+ l.push_back(*i);
// Get the first line
QString beginLine = l[0].stripWhiteSpace();
// Remove extra blank lines
while (l.last().isEmpty())
l.remove(l.last());
@@ -177,13 +178,13 @@ VCard::_parse()
}
--it;
refolded.append(cur);
}
QStringList::Iterator it2 = refolded.begin();
for (; it2 != refolded.end(); ++it2) {
- ContentLine * cl = new ContentLine(QCString((*it2).latin1()));
+ ContentLine * cl = new ContentLine(Q3CString((*it2).latin1()));
cl->parse();
if (cl->value() == 0)
{
qDebug("Content line could not be parsed. Discarded: %s", (*it2).latin1());
delete cl;
}
@@ -225,13 +226,13 @@ VCard::_parse()
VCard::_assemble()
{
vDebug("Assembling vcard");
strRep_ = "BEGIN:VCARD\r\n";
strRep_ += "VERSION:3.0\r\n";
- QPtrListIterator<ContentLine> it(contentLineList_);
+ Q3PtrListIterator<ContentLine> it(contentLineList_);
for (; it.current(); ++it)
strRep_ += it.current()->asString() + "\r\n";
strRep_ += "END:VCARD\r\n";
}
@@ -241,13 +242,13 @@ VCard::has(EntityType t)
{
parse();
return contentLine(t) == 0 ? false : true;
}
bool
-VCard::has(const QCString & s)
+VCard::has(const Q3CString & s)
{
parse();
return contentLine(s) == 0 ? false : true;
}
void
@@ -256,37 +257,37 @@ VCard::add(const ContentLine & cl)
parse();
ContentLine * c = new ContentLine(cl);
contentLineList_.append(c);
}
void
-VCard::add(const QCString & s)
+VCard::add(const Q3CString & s)
{
parse();
ContentLine * c = new ContentLine(s);
contentLineList_.append(c);
}
ContentLine *
VCard::contentLine(EntityType t)
{
parse();
- QPtrListIterator<ContentLine> it(contentLineList_);
+ Q3PtrListIterator<ContentLine> it(contentLineList_);
for (; it.current(); ++it)
if (it.current()->entityType() == t)
return it.current();
return 0;
}
ContentLine *
-VCard::contentLine(const QCString & s)
+VCard::contentLine(const Q3CString & s)
{
parse();
- QPtrListIterator<ContentLine> it(contentLineList_);
+ Q3PtrListIterator<ContentLine> it(contentLineList_);
for (; it.current(); ++it)
if (it.current()->entityType() == EntityNameToEntityType(s))
return it.current();
return 0;