Skip to content

Commit

Permalink
Fixed compile error - conflicts between global/types/version and glob…
Browse files Browse the repository at this point in the history
…al/version

Renamed one of them to MUVersion as in master
  • Loading branch information
Eism committed Mar 13, 2023
1 parent dbe7c6d commit b65559e
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 39 deletions.
6 changes: 3 additions & 3 deletions src/appshell/appshell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include "modularity/ioc.h"
#include "ui/internal/uiengine.h"
#include "version.h"
#include "muversion.h"

#include "commandlinecontroller.h"

Expand Down Expand Up @@ -75,7 +75,7 @@ int AppShell::run(int argc, char** argv)
#endif

const char* appName;
if (framework::Version::unstable()) {
if (framework::MUVersion::unstable()) {
appName = "MuseScore4Development";
} else {
appName = "MuseScore4";
Expand Down Expand Up @@ -108,7 +108,7 @@ int AppShell::run(int argc, char** argv)
QCoreApplication::setApplicationName(appName);
QCoreApplication::setOrganizationName("MuseScore");
QCoreApplication::setOrganizationDomain("musescore.org");
QCoreApplication::setApplicationVersion(QString::fromStdString(framework::Version::fullVersion()));
QCoreApplication::setApplicationVersion(QString::fromStdString(framework::MUVersion::fullVersion()));

#if !defined(Q_OS_WIN) && !defined(Q_OS_DARWIN) && !defined(Q_OS_WASM)
// Any OS that uses Freedesktop.org Desktop Entry Specification (e.g. Linux, BSD)
Expand Down
8 changes: 4 additions & 4 deletions src/appshell/commandlinecontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "commandlinecontroller.h"

#include "log.h"
#include "global/version.h"
#include "global/muversion.h"
#include "config.h"

using namespace mu::appshell;
Expand Down Expand Up @@ -386,11 +386,11 @@ CommandLineController::ConverterTask CommandLineController::converterTask() cons

void CommandLineController::printLongVersion() const
{
if (Version::unstable()) {
if (MUVersion::unstable()) {
printf("MuseScore: Music Score Editor\nUnstable Prerelease for Version %s; Build %s\n",
Version::version().c_str(), Version::revision().c_str());
MUVersion::version().c_str(), MUVersion::revision().c_str());
} else {
printf("MuseScore: Music Score Editor; Version %s; Build %s\n",
Version::version().c_str(), Version::revision().c_str());
MUVersion::version().c_str(), MUVersion::revision().c_str());
}
}
4 changes: 2 additions & 2 deletions src/appshell/view/aboutmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "aboutmodel.h"

#include "translation.h"
#include "version.h"
#include "muversion.h"
#include "config.h"

#include <QApplication>
Expand All @@ -39,7 +39,7 @@ AboutModel::AboutModel(QObject* parent)
QString AboutModel::museScoreVersion() const
{
QString version = QString::fromStdString(configuration()->museScoreVersion());
return mu::framework::Version::unstable()
return mu::framework::MUVersion::unstable()
? qtrc("appshell/about", "Unstable prerelease for %1").arg(version)
: version;
}
Expand Down
4 changes: 2 additions & 2 deletions src/appshell/view/internal/splashscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <QSvgRenderer>

#include "translation.h"
#include "version.h"
#include "muversion.h"

using namespace mu::appshell;

Expand Down Expand Up @@ -109,7 +109,7 @@ void SplashScreen::draw(QPainter* painter)

painter->drawText(websiteRect.translated(0.0, -websiteBoundingRect.height() - versionNumberSpacing),
Qt::AlignBottom | Qt::AlignRight | Qt::TextDontClip,
qtrc("appshell", "Version %1").arg(QString::fromStdString(framework::Version::fullVersion())));
qtrc("appshell", "Version %1").arg(QString::fromStdString(framework::MUVersion::fullVersion())));
}

void SplashScreen::setSize(const QSize& size)
Expand Down
4 changes: 2 additions & 2 deletions src/converter/internal/compat/backendapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "backendjsonwriter.h"
#include "notationmeta.h"

#include "version.h"
#include "muversion.h"
#include "log.h"

using namespace mu;
Expand Down Expand Up @@ -457,7 +457,7 @@ Ret BackendApi::devInfo(const notation::INotationPtr notation, BackendJsonWriter
TRACEFUNC

QJsonObject infoObj;
infoObj["version"] = QString::fromStdString(framework::Version::fullVersion() + "(" + framework::Version::revision() + ")");
infoObj["version"] = QString::fromStdString(framework::MUVersion::fullVersion() + "(" + framework::MUVersion::revision() + ")");

jsonWriter.addKey(DEV_INFO_NAME.c_str());
jsonWriter.addValue(QJsonDocument(infoObj).toJson(), addSeparator, true);
Expand Down
4 changes: 2 additions & 2 deletions src/diagnostics/internal/crashhandler/crashhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <thirdparty/google_crashpad_client/client/settings.h>

#include "log.h"
#include "global/version.h"
#include "global/muversion.h"

using namespace mu::diagnostics;
using namespace crashpad;
Expand Down Expand Up @@ -62,7 +62,7 @@ bool CrashHandler::start(const io::path_t& handlerFilePath, const io::path_t& du

// Optional annotations passed via --annotations to the handler
std::map<std::string, std::string> annotations = {
{ "sentry[release]", framework::Version::fullVersion() }
{ "sentry[release]", framework::MUVersion::fullVersion() }
};
// Optional arguments to pass to the handler
std::vector<std::string> arguments;
Expand Down
4 changes: 2 additions & 2 deletions src/framework/global/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ set(MODULE_SRC
${CMAKE_CURRENT_LIST_DIR}/logremover.h
${CMAKE_CURRENT_LIST_DIR}/dataformatter.cpp
${CMAKE_CURRENT_LIST_DIR}/dataformatter.h
${CMAKE_CURRENT_LIST_DIR}/version.cpp
${CMAKE_CURRENT_LIST_DIR}/version.h
${CMAKE_CURRENT_LIST_DIR}/muversion.cpp
${CMAKE_CURRENT_LIST_DIR}/muversion.h
${CMAKE_CURRENT_LIST_DIR}/stringutils.cpp
${CMAKE_CURRENT_LIST_DIR}/stringutils.h
${CMAKE_CURRENT_LIST_DIR}/ptrutils.h
Expand Down
4 changes: 2 additions & 2 deletions src/framework/global/globalmodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "log.h"
#include "logremover.h"
#include "thirdparty/haw_logger/logger/logdefdest.h"
#include "version.h"
#include "muversion.h"
#include "config.h"

#include "internal/application.h"
Expand Down Expand Up @@ -110,7 +110,7 @@ void GlobalModule::onPreInit(const IApplication::RunMode& mode)
#endif

LOGI() << "log path: " << logFile->filePath();
LOGI() << "=== Started MuseScore " << framework::Version::fullVersion() << ", build number " << BUILD_NUMBER << " ===";
LOGI() << "=== Started MuseScore " << framework::MUVersion::fullVersion() << ", build number " << BUILD_NUMBER << " ===";

//! --- Setup profiler ---
using namespace haw::profiler;
Expand Down
4 changes: 2 additions & 2 deletions src/framework/global/internal/globalconfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "config.h"
#include "settings.h"
#include "version.h"
#include "muversion.h"
#include "log.h"

using namespace mu;
Expand All @@ -42,7 +42,7 @@ static const std::string MUSESCORE_URL("https://www.musescore.org/");

void GlobalConfiguration::init()
{
settings()->setDefaultValue(DEV_MODE_ENABLED_KEY, Val(Version::unstable()));
settings()->setDefaultValue(DEV_MODE_ENABLED_KEY, Val(MUVersion::unstable()));
}

io::path_t GlobalConfiguration::appBinPath() const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "version.h"
#include "muversion.h"

#include <array>

Expand Down Expand Up @@ -60,7 +60,7 @@ static constexpr version_components_t version_components = parse_result.first;

static_assert(parse_result.second, "Invalid VERSION");

bool Version::unstable()
bool MUVersion::unstable()
{
#ifdef MSCORE_UNSTABLE
return true;
Expand All @@ -69,12 +69,12 @@ bool Version::unstable()
#endif
}

std::string Version::version()
std::string MUVersion::version()
{
return versionString;
}

std::string Version::fullVersion()
std::string MUVersion::fullVersion()
{
std::string version(versionString);
std::string versionLabel(VERSION_LABEL);
Expand All @@ -85,22 +85,22 @@ std::string Version::fullVersion()
return version;
}

std::string Version::revision()
std::string MUVersion::revision()
{
return MUSESCORE_REVISION;
}

int Version::majorVersion()
int MUVersion::majorVersion()
{
return version_components.at(0);
}

int Version::minorVersion()
int MUVersion::minorVersion()
{
return version_components.at(1);
}

int Version::patchVersion()
int MUVersion::patchVersion()
{
return version_components.at(2);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MU_FRAMEWORK_VERSION_H
#define MU_FRAMEWORK_VERSION_H
#ifndef MU_FRAMEWORK_MUVERSION_H
#define MU_FRAMEWORK_MUVERSION_H

#include <string>

namespace mu::framework {
class Version
class MUVersion
{
public:
static bool unstable();
Expand All @@ -39,4 +39,4 @@ class Version
};
}

#endif // MU_FRAMEWORK_VERSION_H
#endif // MU_FRAMEWORK_MUVERSION_H
8 changes: 4 additions & 4 deletions src/plugins/api/qmlplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "qmlplugin.h"

#include "version.h"
#include "muversion.h"

#include "engraving/libmscore/mscore.h"

Expand Down Expand Up @@ -149,17 +149,17 @@ int QmlPlugin::mscoreVersion() const

int QmlPlugin::mscoreMajorVersion() const
{
return framework::Version::majorVersion();
return framework::MUVersion::majorVersion();
}

int QmlPlugin::mscoreMinorVersion() const
{
return framework::Version::minorVersion();
return framework::MUVersion::minorVersion();
}

int QmlPlugin::mscoreUpdateVersion() const
{
return framework::Version::patchVersion();
return framework::MUVersion::patchVersion();
}

qreal QmlPlugin::mscoreDPI() const
Expand Down
4 changes: 2 additions & 2 deletions src/workspace/internal/workspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
#include "workspace.h"

#include "global/version.h"
#include "global/muversion.h"
#include "multiinstances/resourcelockguard.h"

#include "workspacefile.h"
Expand Down Expand Up @@ -107,7 +107,7 @@ Ret Workspace::load()
Ret Workspace::save()
{
mi::WriteResourceLockGuard resource_guard(multiInstancesProvider(), fileResourceName());
m_file.setMeta("app_version", Val(Version::version()));
m_file.setMeta("app_version", Val(MUVersion::version()));
return m_file.save();
}

Expand Down

0 comments on commit b65559e

Please sign in to comment.