Skip to content

Commit

Permalink
GuiClient: restore Qt4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaine committed Mar 26, 2014
1 parent 1b726fd commit b385036
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/GuiClient/utils.cpp
Expand Up @@ -24,7 +24,11 @@

#include "utils.h"
#include <QDir>
#if QT_VERSION >= 0x050000
#include <QStandardPaths>
#else
#include <QDesktopServices>
#endif

int comparisonWeightsPresenceStatusType(QXmppPresence::AvailableStatusType statusType)
{
Expand Down Expand Up @@ -99,8 +103,12 @@ QString presenceToStatusText(const QXmppPresence& presence)

QString getSettingsDir(const QString& bareJid)
{
#if QT_VERSION >= 0x050000
QStringList dirList = QStandardPaths::standardLocations(QStandardPaths::DataLocation);
QString dir = dirList.size() > 0 ? dirList.at(0) : "";
#else
QString dir = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#endif
if(bareJid.isEmpty())
return dir + "/";
else
Expand Down

0 comments on commit b385036

Please sign in to comment.