Skip to content

Commit 4fb7cc7

Browse files
Rename UpdateScenario -> AppUpdateScenario
1 parent 3540e38 commit 4fb7cc7

22 files changed

+102
-115
lines changed

src/appshell/internal/startupscenario.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "project/iprojectautosaver.h"
3636
#include "audioplugins/iregisteraudiopluginsscenario.h"
3737

38-
#include "update/iupdatescenario.h"
38+
#include "update/iappupdatescenario.h"
3939
#include "musesounds/imusesoundscheckupdatescenario.h"
4040
#include "musesounds/imusesamplercheckupdatescenario.h"
4141

@@ -50,7 +50,7 @@ class StartupScenario : public IStartupScenario, public muse::Injectable, public
5050
muse::Inject<project::IProjectAutoSaver> projectAutoSaver = { this };
5151
muse::Inject<muse::audioplugins::IRegisterAudioPluginsScenario> registerAudioPluginsScenario = { this };
5252

53-
muse::Inject<muse::update::IUpdateScenario> appUpdateScenario = { this };
53+
muse::Inject<muse::update::IAppUpdateScenario> appUpdateScenario = { this };
5454
muse::Inject<mu::musesounds::IMuseSoundsCheckUpdateScenario> museSoundsUpdateScenario = { this };
5555
muse::Inject<musesounds::IMuseSamplerCheckUpdateScenario> museSamplerCheckForUpdateScenario = { this };
5656

src/framework/stubs/update/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ set(MODULE_SRC
2626
${CMAKE_CURRENT_LIST_DIR}/updatestubmodule.h
2727
${CMAKE_CURRENT_LIST_DIR}/updateconfigurationstub.cpp
2828
${CMAKE_CURRENT_LIST_DIR}/updateconfigurationstub.h
29-
${CMAKE_CURRENT_LIST_DIR}/updatescenariostub.cpp
30-
${CMAKE_CURRENT_LIST_DIR}/updatescenariostub.h
31-
${CMAKE_CURRENT_LIST_DIR}/updateservicestub.cpp
32-
${CMAKE_CURRENT_LIST_DIR}/updateservicestub.h
29+
${CMAKE_CURRENT_LIST_DIR}/appupdatescenariostub.cpp
30+
${CMAKE_CURRENT_LIST_DIR}/appupdatescenariostub.h
31+
${CMAKE_CURRENT_LIST_DIR}/appupdateservicestub.cpp
32+
${CMAKE_CURRENT_LIST_DIR}/appupdateservicestub.h
3333
)
3434

3535
set(MODULE_IS_STUB ON)

src/framework/stubs/update/updatescenariostub.cpp renamed to src/framework/stubs/update/appupdatescenariostub.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* MuseScore
66
* Music Composition & Notation
77
*
8-
* Copyright (C) 2021 MuseScore Limited and others
8+
* Copyright (C) 2025 MuseScore Limited and others
99
*
1010
* This program is free software: you can redistribute it and/or modify
1111
* it under the terms of the GNU General Public License version 3 as
@@ -19,28 +19,28 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
#include "updatescenariostub.h"
22+
#include "appupdatescenariostub.h"
2323

2424
using namespace muse::update;
2525

26-
bool UpdateScenarioStub::needCheckForUpdate() const
26+
bool AppUpdateScenarioStub::needCheckForUpdate() const
2727
{
2828
return false;
2929
}
3030

31-
muse::async::Promise<muse::Ret> UpdateScenarioStub::checkForUpdate(bool)
31+
muse::async::Promise<muse::Ret> AppUpdateScenarioStub::checkForUpdate(bool)
3232
{
3333
return muse::async::Promise<muse::Ret>([](auto /*resolve*/, auto reject) {
3434
return reject(int(muse::Ret::Code::UnknownError), "stub");
3535
});
3636
}
3737

38-
bool UpdateScenarioStub::hasUpdate() const
38+
bool AppUpdateScenarioStub::hasUpdate() const
3939
{
4040
return false;
4141
}
4242

43-
muse::async::Promise<muse::Ret> UpdateScenarioStub::showUpdate()
43+
muse::async::Promise<muse::Ret> AppUpdateScenarioStub::showUpdate()
4444
{
4545
return muse::async::Promise<muse::Ret>([](auto /*resolve*/, auto reject) {
4646
return reject(int(muse::Ret::Code::UnknownError), "stub");

src/framework/stubs/update/updatescenariostub.h renamed to src/framework/stubs/update/appupdatescenariostub.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* MuseScore
66
* Music Composition & Notation
77
*
8-
* Copyright (C) 2021 MuseScore Limited and others
8+
* Copyright (C) 2025 MuseScore Limited and others
99
*
1010
* This program is free software: you can redistribute it and/or modify
1111
* it under the terms of the GNU General Public License version 3 as
@@ -19,13 +19,13 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
#ifndef MU_APPSHELL_UPDATESCENARIOSTUB_H
23-
#define MU_APPSHELL_UPDATESCENARIOSTUB_H
2422

25-
#include "update/iupdatescenario.h"
23+
#pragma once
24+
25+
#include "update/iappupdatescenario.h"
2626

2727
namespace muse::update {
28-
class UpdateScenarioStub : public IUpdateScenario
28+
class AppUpdateScenarioStub : public IAppUpdateScenario
2929
{
3030
public:
3131
bool needCheckForUpdate() const override;
@@ -35,5 +35,3 @@ class UpdateScenarioStub : public IUpdateScenario
3535
muse::async::Promise<Ret> showUpdate() override;
3636
};
3737
}
38-
39-
#endif // MU_APPSHELL_UPDATESCENARIOSTUB_H

src/framework/stubs/update/updateservicestub.cpp renamed to src/framework/stubs/update/appupdateservicestub.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
#include "updateservicestub.h"
22+
#include "appupdateservicestub.h"
2323

2424
using namespace muse;
2525
using namespace muse::update;
2626
using namespace muse::async;
2727

28-
Promise<RetVal<ReleaseInfo> > UpdateServiceStub::checkForUpdate()
28+
Promise<RetVal<ReleaseInfo> > AppUpdateServiceStub::checkForUpdate()
2929
{
3030
return Promise<RetVal<ReleaseInfo> >([this](auto resolve, auto) {
3131
return resolve(make_ret(Ret::Code::NotSupported));
3232
});
3333
}
3434

35-
const RetVal<ReleaseInfo>& UpdateServiceStub::lastCheckResult() const
35+
const RetVal<ReleaseInfo>& AppUpdateServiceStub::lastCheckResult() const
3636
{
3737
static const auto dummyInfo = RetVal<ReleaseInfo>::make_ret(Ret::Code::NotSupported);
3838
return dummyInfo;
3939
}
4040

41-
RetVal<Progress> UpdateServiceStub::downloadRelease()
41+
RetVal<Progress> AppUpdateServiceStub::downloadRelease()
4242
{
4343
return RetVal<Progress>::make_ret(Ret::Code::NotSupported);
4444
}

src/framework/stubs/update/updateservicestub.h renamed to src/framework/stubs/update/appupdateservicestub.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "update/iappupdateservice.h"
2626

2727
namespace muse::update {
28-
class UpdateServiceStub : public IAppUpdateService
28+
class AppUpdateServiceStub : public IAppUpdateService
2929
{
3030
public:
3131
async::Promise<muse::RetVal<ReleaseInfo> > checkForUpdate() override;

src/framework/stubs/update/updatestubmodule.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* MuseScore
66
* Music Composition & Notation
77
*
8-
* Copyright (C) 2021 MuseScore Limited and others
8+
* Copyright (C) 2025 MuseScore Limited and others
99
*
1010
* This program is free software: you can redistribute it and/or modify
1111
* it under the terms of the GNU General Public License version 3 as
@@ -23,25 +23,22 @@
2323

2424
#include "modularity/ioc.h"
2525

26+
#include "appupdatescenariostub.h"
27+
#include "appupdateservicestub.h"
28+
2629
#include "updateconfigurationstub.h"
27-
#include "updatescenariostub.h"
28-
#include "updateservicestub.h"
2930

3031
using namespace muse::update;
3132
using namespace muse::modularity;
3233

33-
static std::shared_ptr<UpdateScenarioStub> s_scenario = std::make_shared<UpdateScenarioStub>();
34-
static std::shared_ptr<UpdateServiceStub> s_service = std::make_shared<UpdateServiceStub>();
35-
static std::shared_ptr<UpdateConfigurationStub> s_configuration = std::make_shared<UpdateConfigurationStub>();
36-
3734
std::string UpdateModule::moduleName() const
3835
{
3936
return "update_stub";
4037
}
4138

4239
void UpdateModule::registerExports()
4340
{
44-
ioc()->registerExport<IUpdateScenario>(moduleName(), s_scenario);
45-
ioc()->registerExport<IAppUpdateService>(moduleName(), s_service);
46-
ioc()->registerExport<IUpdateConfiguration>(moduleName(), s_configuration);
41+
ioc()->registerExport<IAppUpdateService>(moduleName(), std::make_shared<AppUpdateServiceStub>());
42+
ioc()->registerExport<IAppUpdateScenario>(moduleName(), std::make_shared<AppUpdateScenarioStub>());
43+
ioc()->registerExport<IUpdateConfiguration>(moduleName(), std::make_shared<UpdateConfigurationStub>());
4744
}

src/framework/stubs/update/updatestubmodule.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* MuseScore
66
* Music Composition & Notation
77
*
8-
* Copyright (C) 2021 MuseScore Limited and others
8+
* Copyright (C) 2025 MuseScore Limited and others
99
*
1010
* This program is free software: you can redistribute it and/or modify
1111
* it under the terms of the GNU General Public License version 3 as
@@ -19,8 +19,8 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
#ifndef MUSE_UPDATE_UPDATESTUBMODULE_H
23-
#define MUSE_UPDATE_UPDATESTUBMODULE_H
22+
23+
#pragma once
2424

2525
#include "modularity/imodulesetup.h"
2626

@@ -32,5 +32,3 @@ class UpdateModule : public modularity::IModuleSetup
3232
void registerExports() override;
3333
};
3434
}
35-
36-
#endif // MUSE_UPDATE_UPDATESTUBMODULE_H

src/framework/update/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ set(MODULE_SRC
3131
${CMAKE_CURRENT_LIST_DIR}/updatetypes.h
3232
${CMAKE_CURRENT_LIST_DIR}/updateerrors.h
3333
${CMAKE_CURRENT_LIST_DIR}/iupdateconfiguration.h
34-
${CMAKE_CURRENT_LIST_DIR}/iupdatescenario.h
34+
${CMAKE_CURRENT_LIST_DIR}/iappupdatescenario.h
3535
${CMAKE_CURRENT_LIST_DIR}/iappupdateservice.h
3636

3737
${CMAKE_CURRENT_LIST_DIR}/internal/updateconfiguration.cpp
3838
${CMAKE_CURRENT_LIST_DIR}/internal/updateconfiguration.h
39-
${CMAKE_CURRENT_LIST_DIR}/internal/updatescenario.cpp
40-
${CMAKE_CURRENT_LIST_DIR}/internal/updatescenario.h
4139
${CMAKE_CURRENT_LIST_DIR}/internal/updateuiactions.cpp
4240
${CMAKE_CURRENT_LIST_DIR}/internal/updateuiactions.h
4341
${CMAKE_CURRENT_LIST_DIR}/internal/updateactioncontroller.cpp
4442
${CMAKE_CURRENT_LIST_DIR}/internal/updateactioncontroller.h
43+
${CMAKE_CURRENT_LIST_DIR}/internal/appupdatescenario.cpp
44+
${CMAKE_CURRENT_LIST_DIR}/internal/appupdatescenario.h
4545
${CMAKE_CURRENT_LIST_DIR}/internal/appupdateservice.cpp
4646
${CMAKE_CURRENT_LIST_DIR}/internal/appupdateservice.h
4747

48-
${CMAKE_CURRENT_LIST_DIR}/view/updatemodel.cpp
49-
${CMAKE_CURRENT_LIST_DIR}/view/updatemodel.h
48+
${CMAKE_CURRENT_LIST_DIR}/view/appupdatemodel.cpp
49+
${CMAKE_CURRENT_LIST_DIR}/view/appupdatemodel.h
5050
)
5151

5252
if (QT_SUPPORT)

src/framework/update/iupdatescenario.h renamed to src/framework/update/iappupdatescenario.h

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* MuseScore
66
* Music Composition & Notation
77
*
8-
* Copyright (C) 2021 MuseScore Limited and others
8+
* Copyright (C) 2025 MuseScore Limited and others
99
*
1010
* This program is free software: you can redistribute it and/or modify
1111
* it under the terms of the GNU General Public License version 3 as
@@ -19,29 +19,26 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
#ifndef MUSE_UPDATE_IUPDATESCENARIO_H
23-
#define MUSE_UPDATE_IUPDATESCENARIO_H
22+
23+
#pragma once
2424

2525
#include "types/ret.h"
2626
#include "async/promise.h"
2727

2828
#include "modularity/imoduleinterface.h"
2929

3030
namespace muse::update {
31-
class IUpdateScenario : MODULE_EXPORT_INTERFACE
31+
class IAppUpdateScenario : MODULE_EXPORT_INTERFACE
3232
{
33-
INTERFACE_ID(IUpdateScenario)
33+
INTERFACE_ID(IAppUpdateScenario)
3434

3535
public:
36-
using CheckForUpdateCompleteCallback = std::function<void ()>;
36+
virtual ~IAppUpdateScenario() = default;
3737

38-
virtual ~IUpdateScenario() = default;
3938
virtual bool needCheckForUpdate() const = 0;
40-
virtual muse::async::Promise<Ret> checkForUpdate(bool manual) = 0;
39+
virtual async::Promise<Ret> checkForUpdate(bool manual) = 0;
4140

4241
virtual bool hasUpdate() const = 0;
43-
virtual muse::async::Promise<Ret> showUpdate() = 0;
42+
virtual async::Promise<Ret> showUpdate() = 0;
4443
};
4544
}
46-
47-
#endif // MUSE_UPDATE_IUPDATESCENARIO_H

0 commit comments

Comments
 (0)