diff --git a/src/mpdpp.cpp b/src/mpdpp.cpp index 5d796ad8..4e1b06c2 100644 --- a/src/mpdpp.cpp +++ b/src/mpdpp.cpp @@ -102,12 +102,9 @@ void MPD::Connection::Disconnect() itsMaxPlaylistLength = -1; } -float MPD::Connection::Version() const +unsigned MPD::Connection::Version() const { - if (!itsConnection) - return 0; - const unsigned *version = mpd_connection_get_server_version(itsConnection); - return version[1] + version[2]*0.1; + return itsConnection ? mpd_connection_get_server_version(itsConnection)[1] : 0; } void MPD::Connection::SetHostname(const std::string &host) diff --git a/src/mpdpp.h b/src/mpdpp.h index a4148e46..dec867e3 100644 --- a/src/mpdpp.h +++ b/src/mpdpp.h @@ -92,7 +92,7 @@ namespace MPD const std::string & GetHostname() { return itsHost; } int GetPort() { return itsPort; } - float Version() const; + unsigned Version() const; void SetIdleEnabled(bool val) { isIdleEnabled = val; } bool SupportsIdle() const { return supportsIdle; }