aboutsummaryrefslogtreecommitdiff
path: root/examples/GuiClient
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2014-03-26 18:30:11 +0100
committerJeremy Lainé <jeremy.laine@m4x.org>2014-03-26 18:30:11 +0100
commitb385036ceea623a1feded664026e5c6450508d8e (patch)
tree816f69ae6a4bf94f12570055c4433e309edde9e7 /examples/GuiClient
parent1b726fdb5cc99de4acf2fc2e0e28cc60aac38668 (diff)
downloadqxmpp-b385036ceea623a1feded664026e5c6450508d8e.tar.gz
GuiClient: restore Qt4 compatibility
Diffstat (limited to 'examples/GuiClient')
-rw-r--r--examples/GuiClient/utils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/GuiClient/utils.cpp b/examples/GuiClient/utils.cpp
index 03255b4d..620d772a 100644
--- a/examples/GuiClient/utils.cpp
+++ b/examples/GuiClient/utils.cpp
@@ -24,7 +24,11 @@
#include "utils.h"
#include <QDir>
+#if QT_VERSION >= 0x050000
#include <QStandardPaths>
+#else
+#include <QDesktopServices>
+#endif
int comparisonWeightsPresenceStatusType(QXmppPresence::AvailableStatusType statusType)
{
@@ -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