Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Mar 16, 2024
1 parent b1d08ae commit cb14602
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion iris
4 changes: 4 additions & 0 deletions src/applicationinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ QString ApplicationInfo::currentProfileDir(ApplicationInfo::HomedirType type)
return pathToProfile(activeProfile, type);
}

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QString ApplicationInfo::desktopFileBaseName() { return QLatin1String(xstr(APP_BIN_NAME) ".desktop"); }
#else
QString ApplicationInfo::desktopFileBaseName() { return QLatin1String(xstr(APP_BIN_NAME)); }
#endif

QString ApplicationInfo::desktopFile()
{
Expand Down
7 changes: 5 additions & 2 deletions src/vcardfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ VCard VCardFactory::vcard(const Jid &j)

// then try to load from cache on disk
QFile file(ApplicationInfo::vCardDir() + '/' + JIDUtil::encode(j.bare()).toLower() + ".xml");
file.open(QIODevice::ReadOnly);
if (!file.open(QIODevice::ReadOnly)) {
// REVIEW we can cache which files were really missed. or maybe set a flag for the contact
return {};
}
QDomDocument doc;

if (doc.setContent(&file, false)) {
Expand All @@ -180,7 +183,7 @@ VCard VCardFactory::vcard(const Jid &j)
}
}

return VCard();
return {};
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/whiteboarding/wbmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void WbManager::openWhiteboard(const Jid &target, const Jid &ownJid, bool groupC

QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) {
doc.setContent(file.readAll(), true);
doc.setContent(&file, true);
file.close();
}
}
Expand Down

0 comments on commit cb14602

Please sign in to comment.