~ubuntu-branches/ubuntu/wily/psi/wily

« back to all changes in this revision

Viewing changes to iris/xmpp-im/xmpp_vcard.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <QImageWriter>
30
30
#include <QtCrypto>
31
31
 
32
 
// Justin's XML helper functions
33
 
 
34
 
static QDomElement textTag(QDomDocument *doc, const QString &name, const QString &content)
35
 
{
36
 
        QDomElement tag = doc->createElement(name);
37
 
        QDomText text = doc->createTextNode(content);
38
 
        tag.appendChild(text);
39
 
 
40
 
        return tag;
41
 
}
42
 
 
43
 
static QDomElement findSubTag(const QDomElement &e, const QString &name, bool *found)
44
 
{
45
 
        if(found)
46
 
                *found = FALSE;
47
 
 
48
 
        for(QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) {
49
 
                QDomElement i = n.toElement();
50
 
                if(i.isNull())
51
 
                        continue;
52
 
                if(i.tagName().upper() == name.upper()) { // mblsha: ignore case when searching
53
 
                        if(found)
54
 
                                *found = TRUE;
55
 
                        return i;
56
 
                }
57
 
        }
58
 
 
59
 
        QDomElement tmp;
60
 
        return tmp;
61
 
}
62
 
 
63
 
// mblsha's own functions
64
 
 
65
 
static QDomElement emptyTag(QDomDocument *doc, const QString &name)
66
 
{
67
 
        QDomElement tag = doc->createElement(name);
68
 
 
69
 
        return tag;
70
 
}
71
 
 
72
 
static bool hasSubTag(const QDomElement &e, const QString &name)
73
 
{
74
 
        bool found;
75
 
        findSubTag(e, name, &found);
76
 
        return found;
77
 
}
78
 
 
79
 
static QString subTagText(const QDomElement &e, const QString &name)
80
 
{
81
 
        bool found;
82
 
        QDomElement i = findSubTag(e, name, &found);
83
 
        if ( found )
84
 
                return i.text().stripWhiteSpace();
85
 
        return QString::null;
86
 
}
 
32
#include "xmpp_xmlcommon.h"
87
33
 
88
34
using namespace XMPP;
 
35
using namespace XMLHelper;
89
36
 
90
37
//----------------------------------------------------------------------------
91
38
// VCard