[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [amarok/spotify] src/core-impl/collections/spotifycollection: spotify: use QSysInfo instead of uname
From:       Edward Hades <edward.hades () gmail ! com>
Date:       2012-10-29 12:29:34
Message-ID: 20121029122934.AEFE5A60C4 () git ! kde ! org
[Download RAW message or body]

Git commit 865566a6069883fa4384b0e7561488237becf021 by Edward Hades.
Committed on 29/10/2012 at 13:21.
Pushed by hades into branch 'spotify'.

spotify: use QSysInfo instead of uname

M  +16   -8    src/core-impl/collections/spotifycollection/SpotifyConfig.cpp
M  +1    -0    src/core-impl/collections/spotifycollection/SpotifyConfig.h

http://commits.kde.org/amarok/865566a6069883fa4384b0e7561488237becf021

diff --git a/src/core-impl/collections/spotifycollection/SpotifyConfig.cpp \
b/src/core-impl/collections/spotifycollection/SpotifyConfig.cpp index \
                3a4b81f..f87e604 100644
--- a/src/core-impl/collections/spotifycollection/SpotifyConfig.cpp
+++ b/src/core-impl/collections/spotifycollection/SpotifyConfig.cpp
@@ -25,7 +25,7 @@
 #include <KStandardDirs>
 #include <KWallet/Wallet>
 
-#include <sys/utsname.h>
+#include <QSysInfo>
 
 const QString SpotifyConfig::m_resolverDownloadUrl = "http://ofan.me/";
 
@@ -164,15 +164,23 @@ SpotifyConfig::reset()
 }
 
 const QString
-SpotifyConfig::defaultResolverName()
+SpotifyConfig::supportedPlatformName()
 {
-    utsname buf;
-    int res = uname( &buf );
-    QString name = "spotify_resolver_";
-    if( !res )
-        name.append( buf.machine );
+#ifdef Q_OS_WIN32
+    return "win32";
+#else
+#ifdef Q_OS_LINUX
+    return QString("linux%1").arg(QSysInfo::WordSize);
+#else
+    return QString();
+#endif
+#endif
+}
 
-    return name;
+const QString
+SpotifyConfig::defaultResolverName()
+{
+    return QString("spotify_resolver_%1").arg(supportedPlatformName());
 }
 
 #include "SpotifyConfig.moc"
diff --git a/src/core-impl/collections/spotifycollection/SpotifyConfig.h \
b/src/core-impl/collections/spotifycollection/SpotifyConfig.h index 62a3b81..298a811 \
                100644
--- a/src/core-impl/collections/spotifycollection/SpotifyConfig.h
+++ b/src/core-impl/collections/spotifycollection/SpotifyConfig.h
@@ -31,6 +31,7 @@ public:
     ~SpotifyConfig();
 
     static const char *configSectionName() { return "Collection_Spotify"; }
+    static const QString supportedPlatformName();
     static const QString defaultResolverName();
 
     const QString username() const { return m_username; }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic