Skip to content

Commit 5725118

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

20 files changed

+75
-78
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/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/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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
#include "modularity/imoduleinterface.h"
2929

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

3535
public:
3636
using CheckForUpdateCompleteCallback = std::function<void ()>;
3737

38-
virtual ~IUpdateScenario() = default;
38+
virtual ~IAppUpdateScenario() = default;
3939
virtual bool needCheckForUpdate() const = 0;
4040
virtual muse::async::Promise<Ret> checkForUpdate(bool manual) = 0;
4141

src/framework/update/internal/updatescenario.cpp renamed to src/framework/update/internal/appupdatescenario.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
2222

23-
#include "updatescenario.h"
23+
#include "appupdatescenario.h"
2424

2525
#include "updateerrors.h"
2626

@@ -34,12 +34,12 @@ using namespace muse::update;
3434
using namespace muse::actions;
3535
using namespace muse::async;
3636

37-
bool UpdateScenario::needCheckForUpdate() const
37+
bool AppUpdateScenario::needCheckForUpdate() const
3838
{
3939
return configuration()->needCheckForUpdate();
4040
}
4141

42-
Promise<Ret> UpdateScenario::checkForUpdate(bool manual)
42+
Promise<Ret> AppUpdateScenario::checkForUpdate(bool manual)
4343
{
4444
return async::make_promise<Ret>([this, manual](auto resolve, auto) {
4545
if (m_checkInProgress) {
@@ -76,7 +76,7 @@ Promise<Ret> UpdateScenario::checkForUpdate(bool manual)
7676
});
7777
}
7878

79-
bool UpdateScenario::hasUpdate() const
79+
bool AppUpdateScenario::hasUpdate() const
8080
{
8181
if (m_checkInProgress) {
8282
return false;
@@ -94,7 +94,7 @@ bool UpdateScenario::hasUpdate() const
9494
return !shouldIgnoreUpdate(lastCheckResult.val);
9595
}
9696

97-
Promise<Ret> UpdateScenario::showUpdate()
97+
Promise<Ret> AppUpdateScenario::showUpdate()
9898
{
9999
const RetVal<ReleaseInfo>& lastCheckResult = service()->lastCheckResult();
100100
if (lastCheckResult.ret) {
@@ -105,7 +105,7 @@ Promise<Ret> UpdateScenario::showUpdate()
105105
});
106106
}
107107

108-
Promise<Ret> UpdateScenario::processUpdateError(int errorCode)
108+
Promise<Ret> AppUpdateScenario::processUpdateError(int errorCode)
109109
{
110110
const auto unknownError = async::make_promise<Ret>([](auto resolve, auto) {
111111
return resolve(muse::make_ret(Ret::Code::UnknownError));
@@ -128,7 +128,7 @@ Promise<Ret> UpdateScenario::processUpdateError(int errorCode)
128128
});
129129
}
130130

131-
Promise<IInteractive::Result> UpdateScenario::showNoUpdateMsg()
131+
Promise<IInteractive::Result> AppUpdateScenario::showNoUpdateMsg()
132132
{
133133
const QString str = muse::qtrc("update", "You already have the latest version of MuseScore Studio. "
134134
"Please visit <a href=\"%1\">MuseScore.org</a> for news on what’s coming next.")
@@ -141,7 +141,7 @@ Promise<IInteractive::Result> UpdateScenario::showNoUpdateMsg()
141141
IInteractive::Option::WithIcon);
142142
}
143143

144-
Promise<Ret> UpdateScenario::showReleaseInfo(const ReleaseInfo& info)
144+
Promise<Ret> AppUpdateScenario::showReleaseInfo(const ReleaseInfo& info)
145145
{
146146
UriQuery query("muse://update/appreleaseinfo");
147147
query.addParam("notes", Val(info.notes));
@@ -169,22 +169,22 @@ Promise<Ret> UpdateScenario::showReleaseInfo(const ReleaseInfo& info)
169169
});
170170
}
171171

172-
Promise<IInteractive::Result> UpdateScenario::showServerErrorMsg()
172+
Promise<IInteractive::Result> AppUpdateScenario::showServerErrorMsg()
173173
{
174174
return interactive()->error(muse::trc("update", "Cannot connect to server"),
175175
muse::trc("update", "Sorry - please try again later"));
176176
}
177177

178-
Promise<Ret> UpdateScenario::downloadRelease()
178+
Promise<Ret> AppUpdateScenario::downloadRelease()
179179
{
180-
RetVal<Val> rv = interactive()->openSync("muse://update?mode=download");
180+
RetVal<Val> rv = interactive()->openSync("muse://update/app?mode=download");
181181
if (!rv.ret) {
182182
return processUpdateError(rv.ret.code());
183183
}
184184
return askToCloseAppAndCompleteInstall(rv.val.toString());
185185
}
186186

187-
Promise<Ret> UpdateScenario::askToCloseAppAndCompleteInstall(const io::path_t& installerPath)
187+
Promise<Ret> AppUpdateScenario::askToCloseAppAndCompleteInstall(const io::path_t& installerPath)
188188
{
189189
const std::string info = muse::trc("update", "MuseScore Studio needs to close to complete the installation. "
190190
"If you have any unsaved changes, you will be prompted to save them before MuseScore Studio closes.");
@@ -209,7 +209,7 @@ Promise<Ret> UpdateScenario::askToCloseAppAndCompleteInstall(const io::path_t& i
209209
});
210210
}
211211

212-
bool UpdateScenario::shouldIgnoreUpdate(const ReleaseInfo& info) const
212+
bool AppUpdateScenario::shouldIgnoreUpdate(const ReleaseInfo& info) const
213213
{
214214
return info.version == configuration()->skippedReleaseVersion() && !configuration()->checkForUpdateTestMode();
215215
}

src/framework/update/internal/updatescenario.h renamed to src/framework/update/internal/appupdatescenario.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#pragma once
2424

25-
#include "update/iupdatescenario.h"
25+
#include "update/iappupdatescenario.h"
2626
#include "async/asyncable.h"
2727
#include "modularity/ioc.h"
2828

@@ -35,7 +35,7 @@
3535
#include "progress.h"
3636

3737
namespace muse::update {
38-
class UpdateScenario : public IUpdateScenario, public Injectable, public async::Asyncable
38+
class AppUpdateScenario : public IAppUpdateScenario, public Injectable, public async::Asyncable
3939
{
4040
Inject<IInteractive> interactive = { this };
4141
Inject<actions::IActionsDispatcher> dispatcher = { this };
@@ -44,7 +44,7 @@ class UpdateScenario : public IUpdateScenario, public Injectable, public async::
4444
Inject<IAppUpdateService> service = { this };
4545

4646
public:
47-
UpdateScenario(const modularity::ContextPtr& iocCtx)
47+
AppUpdateScenario(const modularity::ContextPtr& iocCtx)
4848
: Injectable(iocCtx) {}
4949

5050
bool needCheckForUpdate() const override;

0 commit comments

Comments
 (0)