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

« back to all changes in this revision

Viewing changes to src/vcardfactory.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
{
97
97
        VCard *vcard = new VCard;
98
98
        *vcard = _vcard;
99
 
        checkLimit(j.userHost(), vcard);
 
99
        checkLimit(j.bare(), vcard);
100
100
 
101
101
        // save vCard to disk
102
102
 
106
106
        if(!v.exists())
107
107
                p.mkdir("vcard");
108
108
 
109
 
        QFile file ( ApplicationInfo::vCardDir() + "/" + JIDUtil::encode(j.userHost()).lower() + ".xml" );
 
109
        QFile file ( ApplicationInfo::vCardDir() + '/' + JIDUtil::encode(j.bare()).lower() + ".xml" );
110
110
        file.open ( QIODevice::WriteOnly );
111
111
        QTextStream out ( &file );
112
112
        out.setEncoding ( QTextStream::UnicodeUTF8 );
124
124
const VCard* VCardFactory::vcard(const Jid &j)
125
125
{
126
126
        // first, try to get vCard from runtime cache
127
 
        if (vcardDict_.contains(j.userHost())) {
128
 
                return vcardDict_[j.userHost()];
 
127
        if (vcardDict_.contains(j.bare())) {
 
128
                return vcardDict_[j.bare()];
129
129
        }
130
130
        
131
131
        // then try to load from cache on disk
132
 
        QFile file ( ApplicationInfo::vCardDir() + "/" + JIDUtil::encode(j.userHost()).lower() + ".xml" );
 
132
        QFile file ( ApplicationInfo::vCardDir() + '/' + JIDUtil::encode(j.bare()).lower() + ".xml" );
133
133
        file.open (QIODevice::ReadOnly);
134
134
        QDomDocument doc;
135
135
        VCard *vcard = new VCard;
136
136
        if ( doc.setContent(&file, false) ) {
137
137
                vcard->fromXml( doc.documentElement() );
138
 
                checkLimit(j.userHost(), vcard);
 
138
                checkLimit(j.bare(), vcard);
139
139
                return vcard;
140
140
        }
141
141