diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2010-04-01 12:54:05 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2010-04-01 12:54:05 +0200 |
commit | 230b6ae3e375b6ff554d402e661d15647e253e14 (patch) | |
tree | 21808e225dd2ff8d733ea52b5510eef714eb3cda /src/mpdpp.cpp | |
parent | d02713789ba4740bf2dd56ced4858487be5cd06b (diff) |
make MPD::Connection::Version() return integer instead of float
full version is always 0.xx.0, where xx is current
version of protocol, so why bother with zeros...
Diffstat (limited to 'src/mpdpp.cpp')
-rw-r--r-- | src/mpdpp.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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) |