diff --git a/source/base/version.cc b/source/base/version.cc index ea58f342a8..85d583117c 100644 --- a/source/base/version.cc +++ b/source/base/version.cc @@ -335,23 +335,6 @@ Version Version::fromProto(const proto::Version& proto_version) proto_version.patch(), proto_version.revision()); } -//-------------------------------------------------------------------------------------------------- -// static -const Version& Version::currentShort() -{ - static const Version version(ASPIA_VERSION_MAJOR, ASPIA_VERSION_MINOR, ASPIA_VERSION_PATCH); - return version; -} - -//-------------------------------------------------------------------------------------------------- -// static -const Version& Version::currentFull() -{ - static const Version version( - ASPIA_VERSION_MAJOR, ASPIA_VERSION_MINOR, ASPIA_VERSION_PATCH, GIT_COMMIT_COUNT); - return version; -} - //-------------------------------------------------------------------------------------------------- bool operator==(const Version& v1, const Version& v2) { diff --git a/source/base/version.h b/source/base/version.h index 2896beb424..49738f8dd1 100644 --- a/source/base/version.h +++ b/source/base/version.h @@ -32,8 +32,8 @@ namespace base { class Version { public: - static const Version& kVersion_CurrentFull; - static const Version& kVersion_CurrentShort; + static const Version& kVersion_CurrentFull; // Version of application (with build number). + static const Version& kVersion_CurrentShort; // Version of application (without build number). static const Version& kVersion_2_4_0; static const Version& kVersion_2_6_0; @@ -82,12 +82,6 @@ class Version proto::Version toProto() const; static Version fromProto(const proto::Version& proto_version); - // Returns current version of application (without build number). - static const Version& currentShort(); - - // Returns current version of application (with build number). - static const Version& currentFull(); - private: std::vector components_; }; diff --git a/source/client/client.cc b/source/client/client.cc index 454b19e769..789851965b 100644 --- a/source/client/client.cc +++ b/source/client/client.cc @@ -315,7 +315,7 @@ void Client::startAuthentication() channel_->setChannelIdSupport(true); } - const base::Version& client_version = base::Version::currentFull(); + const base::Version& client_version = base::Version::kVersion_CurrentFull; if (host_version > client_version) { LOG(LS_ERROR) << "Version mismatch (host: " << host_version.toString() diff --git a/source/client/router.cc b/source/client/router.cc index 390be7785f..9a974645a9 100644 --- a/source/client/router.cc +++ b/source/client/router.cc @@ -187,7 +187,7 @@ void Router::onTcpConnected() channel_->setChannelIdSupport(true); } - const base::Version& client_version = base::Version::currentFull(); + const base::Version& client_version = base::Version::kVersion_CurrentFull; if (router_version > client_version) { LOG(LS_ERROR) << "Version mismatch (router: " << router_version.toString() diff --git a/source/client/ui/client_window.cc b/source/client/ui/client_window.cc index f3c5837bc0..246a712249 100644 --- a/source/client/ui/client_window.cc +++ b/source/client/ui/client_window.cc @@ -153,7 +153,7 @@ void ClientWindow::onUpdateCheckedFinished(const base::ByteArray& result) } else { - const base::Version& current_version = base::Version::currentShort(); + const base::Version& current_version = base::Version::kVersion_CurrentShort; const base::Version& update_version = update_info.version(); if (update_version > current_version) diff --git a/source/client/ui/desktop/qt_desktop_window.cc b/source/client/ui/desktop/qt_desktop_window.cc index 27f371cb28..e521bad5ef 100644 --- a/source/client/ui/desktop/qt_desktop_window.cc +++ b/source/client/ui/desktop/qt_desktop_window.cc @@ -351,7 +351,7 @@ void QtDesktopWindow::setCapabilities(const proto::DesktopCapabilities& capabili if (base::contains(extensions_list, common::kRemoteUpdateExtension)) { - if (base::Version::currentFull() > peer_version_) + if (base::Version::kVersion_CurrentFull > peer_version_) toolbar_->enableRemoteUpdate(true); } diff --git a/source/common/ui/update_dialog.cc b/source/common/ui/update_dialog.cc index 15ff4a06b9..61077cc6a7 100644 --- a/source/common/ui/update_dialog.cc +++ b/source/common/ui/update_dialog.cc @@ -123,7 +123,7 @@ void UpdateDialog::onUpdateCheckedFinished(const base::ByteArray& result) } else { - const base::Version& current_version = base::Version::currentShort(); + const base::Version& current_version = base::Version::kVersion_CurrentShort; update_info_ = UpdateInfo::fromXml(result); if (!update_info_.isValid()) @@ -254,7 +254,7 @@ void UpdateDialog::initialize() connect(ui->button_update, &QPushButton::clicked, this, &UpdateDialog::onUpdateNow); connect(ui->button_close, &QPushButton::clicked, this, &UpdateDialog::close); - const base::Version& current_version = base::Version::currentShort(); + const base::Version& current_version = base::Version::kVersion_CurrentShort; ui->label_current->setText(QString::fromStdString(current_version.toString(3))); } diff --git a/source/common/update_checker.cc b/source/common/update_checker.cc index 5f853b79f9..37a1b85814 100644 --- a/source/common/update_checker.cc +++ b/source/common/update_checker.cc @@ -140,7 +140,7 @@ void UpdateChecker::run() #error Unknown architecture #endif - const base::Version& version = base::Version::currentShort(); + const base::Version& version = base::Version::kVersion_CurrentShort; std::string url(update_server_); url += "/update.php?"; diff --git a/source/console/main_window.cc b/source/console/main_window.cc index 1abf7c138f..68a2a4317c 100644 --- a/source/console/main_window.cc +++ b/source/console/main_window.cc @@ -1451,7 +1451,7 @@ void MainWindow::onUpdateCheckedFinished(const base::ByteArray& result) } else { - const base::Version& current_version = base::Version::currentShort(); + const base::Version& current_version = base::Version::kVersion_CurrentShort; const base::Version& update_version = update_info.version(); if (update_version > current_version) diff --git a/source/host/server.cc b/source/host/server.cc index 26ee704582..4642337599 100644 --- a/source/host/server.cc +++ b/source/host/server.cc @@ -202,7 +202,7 @@ void Server::onNewSession(base::ServerAuthenticatorManager::SessionInfo&& sessio LOG(LS_INFO) << "Channel ID supported: " << (channel_id_support ? "YES" : "NO"); - const base::Version& host_version = base::Version::currentFull(); + const base::Version& host_version = base::Version::kVersion_CurrentFull; if (host_version > session_info.version) { LOG(LS_ERROR) << "Version mismatch (host: " << host_version.toString() @@ -285,7 +285,7 @@ void Server::onUpdateCheckedFinished(const base::ByteArray& result) } else { - const base::Version& current_version = base::Version::currentShort(); + const base::Version& current_version = base::Version::kVersion_CurrentShort; const base::Version& update_version = update_info.version(); if (update_version > current_version)