Skip to content

Commit a74ebc8

Browse files
Replace Uri with UriQuery: Uri doesn't support params
1 parent 8ecf8eb commit a74ebc8

14 files changed

+36
-37
lines changed

src/framework/autobot/internal/autobotinteractive.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ Ret AutobotInteractive::isAppExists(const std::string& appIdentifier) const
223223
return m_real->isAppExists(appIdentifier);
224224
}
225225

226-
Ret AutobotInteractive::canOpenApp(const Uri& uri) const
226+
Ret AutobotInteractive::canOpenApp(const UriQuery& uri) const
227227
{
228228
return m_real->canOpenApp(uri);
229229
}
230230

231-
async::Promise<Ret> AutobotInteractive::openApp(const Uri& uri) const
231+
async::Promise<Ret> AutobotInteractive::openApp(const UriQuery& uri) const
232232
{
233233
return m_real->openApp(uri);
234234
}

src/framework/autobot/internal/autobotinteractive.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ class AutobotInteractive : public IInteractive
107107
Ret openUrl(const QUrl& url) const override;
108108

109109
Ret isAppExists(const std::string& appIdentifier) const override;
110-
Ret canOpenApp(const Uri& uri) const override;
111-
async::Promise<Ret> openApp(const Uri& uri) const override;
110+
Ret canOpenApp(const UriQuery& uri) const override;
111+
async::Promise<Ret> openApp(const UriQuery& uri) const override;
112112

113113
Ret revealInFileBrowser(const io::path_t& filePath) const override;
114114

src/framework/global/iinteractive.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ class IInteractive : MODULE_EXPORT_INTERFACE
250250
virtual Ret openUrl(const QUrl& url) const = 0;
251251

252252
virtual Ret isAppExists(const std::string& appIdentifier) const = 0;
253-
virtual Ret canOpenApp(const Uri& uri) const = 0;
254-
virtual async::Promise<Ret> openApp(const Uri& uri) const = 0;
253+
virtual Ret canOpenApp(const UriQuery& uri) const = 0;
254+
virtual async::Promise<Ret> openApp(const UriQuery& uri) const = 0;
255255

256256
/// Opens a file browser at the parent directory of filePath,
257257
/// and selects the file at filePath on OSs that support it

src/framework/global/internal/interactive.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ Ret Interactive::isAppExists(const std::string& appIdentifier) const
504504
#endif
505505
}
506506

507-
Ret Interactive::canOpenApp(const Uri& uri) const
507+
Ret Interactive::canOpenApp(const UriQuery& uri) const
508508
{
509509
#ifdef Q_OS_MACOS
510510
return MacOSInteractiveHelper::canOpenApp(uri);
@@ -515,7 +515,7 @@ Ret Interactive::canOpenApp(const Uri& uri) const
515515
#endif
516516
}
517517

518-
async::Promise<Ret> Interactive::openApp(const Uri& uri) const
518+
async::Promise<Ret> Interactive::openApp(const UriQuery& uri) const
519519
{
520520
#ifdef Q_OS_MACOS
521521
return MacOSInteractiveHelper::openApp(uri);

src/framework/global/internal/interactive.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ class Interactive : public IInteractive, public Injectable, public async::Asynca
114114
Ret openUrl(const QUrl& url) const override;
115115

116116
Ret isAppExists(const std::string& appIdentifier) const override;
117-
Ret canOpenApp(const Uri& uri) const override;
118-
async::Promise<Ret> openApp(const Uri& uri) const override;
117+
Ret canOpenApp(const UriQuery& uri) const override;
118+
async::Promise<Ret> openApp(const UriQuery& uri) const override;
119119

120120
Ret revealInFileBrowser(const io::path_t& filePath) const override;
121121

src/framework/global/internal/platform/macos/macosinteractivehelper.h

Lines changed: 8 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) 2022 MuseScore BVBA and others
8+
* Copyright (C) 2025 MuseScore BVBA 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,26 +19,24 @@
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_FRAMEWORK_MACOSINTERACTIVEHELPER_H
23-
#define MU_FRAMEWORK_MACOSINTERACTIVEHELPER_H
22+
23+
#pragma once
2424

2525
#include "io/path.h"
2626
#include "types/ret.h"
27-
#include "types/uri.h"
2827

29-
#include "async/asyncable.h"
3028
#include "async/promise.h"
3129

3230
namespace muse {
33-
class MacOSInteractiveHelper : public async::Asyncable
31+
class UriQuery;
32+
33+
class MacOSInteractiveHelper
3434
{
3535
public:
3636
static bool revealInFinder(const io::path_t& filePath);
3737

3838
static Ret isAppExists(const std::string& appIdentifier);
39-
static Ret canOpenApp(const Uri& uri);
40-
static async::Promise<Ret> openApp(const Uri& uri);
39+
static Ret canOpenApp(const UriQuery& uri);
40+
static async::Promise<Ret> openApp(const UriQuery& uri);
4141
};
4242
}
43-
44-
#endif // MU_FRAMEWORK_MACOSINTERACTIVEHELPER_H

src/framework/global/internal/platform/macos/macosinteractivehelper.mm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
#include <Cocoa/Cocoa.h>
2828

29+
#include "types/uri.h"
30+
2931
#include "log.h"
3032

3133
using namespace muse;
@@ -47,7 +49,7 @@
4749
return appURL != nil;
4850
}
4951

50-
Ret MacOSInteractiveHelper::canOpenApp(const Uri& uri)
52+
Ret MacOSInteractiveHelper::canOpenApp(const UriQuery& uri)
5153
{
5254
if (__builtin_available(macOS 10.15, *)) {
5355
NSString* nsUrlString = [NSString stringWithUTF8String:uri.toString().c_str()];
@@ -67,9 +69,9 @@
6769
}
6870
}
6971

70-
async::Promise<Ret> MacOSInteractiveHelper::openApp(const Uri& uri)
72+
async::Promise<Ret> MacOSInteractiveHelper::openApp(const UriQuery& uri)
7173
{
72-
return Promise<Ret>([&uri](auto resolve, auto reject) {
74+
return Promise<Ret>([uri](auto resolve, auto reject) {
7375
if (__builtin_available(macOS 10.15, *)) {
7476
NSString* nsUrlString = [NSString stringWithUTF8String:uri.toString().c_str()];
7577
if (nsUrlString == nil) {

src/framework/global/internal/platform/win/wininteractivehelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* MuseScore
66
* Music Composition & Notation
77
*
8-
* Copyright (C) 2024 MuseScore BVBA and others
8+
* Copyright (C) 2025 MuseScore BVBA 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
@@ -33,7 +33,7 @@ using namespace muse::async;
3333
using namespace winrt;
3434
using namespace Windows::System;
3535

36-
async::Promise<Ret> WinInteractiveHelper::openApp(const Uri& uri)
36+
async::Promise<Ret> WinInteractiveHelper::openApp(const UriQuery& uri)
3737
{
3838
const Windows::Foundation::Uri wUri(winrt::to_hstring(uri.toString()));
3939

src/framework/global/internal/platform/win/wininteractivehelper.h

Lines changed: 4 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) 2024 MuseScore BVBA and others
8+
* Copyright (C) 2025 MuseScore BVBA 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,15 +23,14 @@
2323

2424
#include "types/ret.h"
2525

26-
#include "async/asyncable.h"
2726
#include "async/promise.h"
2827

2928
namespace muse {
30-
class Uri;
29+
class UriQuery;
3130

32-
class WinInteractiveHelper : public async::Asyncable
31+
class WinInteractiveHelper
3332
{
3433
public:
35-
static async::Promise<Ret> openApp(const Uri& uri);
34+
static async::Promise<Ret> openApp(const UriQuery& uri);
3635
};
3736
}

src/framework/global/tests/mocks/interactivemock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class InteractiveMock : public IInteractive
8787
MOCK_METHOD(Ret, openUrl, (const QUrl&), (const, override));
8888

8989
MOCK_METHOD(Ret, isAppExists, (const std::string&), (const, override));
90-
MOCK_METHOD(Ret, canOpenApp, (const Uri&), (const, override));
91-
MOCK_METHOD(async::Promise<Ret>, openApp, (const Uri&), (const, override));
90+
MOCK_METHOD(Ret, canOpenApp, (const UriQuery&), (const, override));
91+
MOCK_METHOD(async::Promise<Ret>, openApp, (const UriQuery&), (const, override));
9292

9393
MOCK_METHOD(Ret, revealInFileBrowser, (const io::path_t&), (const, override));
9494
};

0 commit comments

Comments
 (0)