Skip to content

Commit

Permalink
Current version of Psi+ is 1.5.1988
Browse files Browse the repository at this point in the history
It is based on:
* psi: 8efb20f3
* plugins: 7a65467
* psimedia: 478567e
* resources: e32ef4b
  • Loading branch information
tehnick committed Jun 20, 2024
1 parent 295a98f commit a3c9f83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
19 changes: 5 additions & 14 deletions src/vcardfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,11 @@ void VCardFactory::saveVCard(const Jid &j, const VCard4::VCard &vcard, Flags fla
if (!v.exists())
p.mkdir("vcard");

QFile file(ApplicationInfo::vCardDir() + '/' + JIDUtil::encode(j.bare()).toLower() + ".xml");
auto filename = ApplicationInfo::vCardDir() + '/' + JIDUtil::encode(j.bare()).toLower() + ".xml";
if (vcard) {
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
out.setEncoding(QStringConverter::Utf8);
#else
out.setCodec("UTF-8");
#endif
QDomDocument doc;
doc.appendChild(vcard.toXmlElement(doc));
out << doc.toString(4);
} else if (file.exists()) {
file.remove();
vcard.save(filename);
} else {
QFile::remove(filename);
}

Jid jid = j;
Expand Down Expand Up @@ -211,11 +202,11 @@ VCard4::VCard VCardFactory::vcard(const Jid &j, Flags flags)
// REVIEW we can cache which files were really missed. or maybe set a flag for the contact
return {};
}
QDomDocument doc;

VCard4::VCard v4 = VCard4::VCard::fromDevice(&file);
if (!v4) {
file.seek(0);
QDomDocument doc;
if (doc.setContent(&file, false)) {
VCard vcard = VCard::fromXml(doc.documentElement());
if (!vcard.isNull()) {
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.1987 (2024-06-20, 257a7e84)
1.5.1988 (2024-06-20, 8efb20f3)

0 comments on commit a3c9f83

Please sign in to comment.