Assistant: Fix minor const-correctness issues
This commit is contained in:
parent
70d7fb6a03
commit
87e26d2fa4
Notes:
sideshowbarker
2024-07-18 02:13:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/87e26d2fa4 Pull-request: https://github.com/SerenityOS/serenity/pull/17557 Reviewed-by: https://github.com/linusg
2 changed files with 8 additions and 8 deletions
|
@ -52,7 +52,7 @@ private:
|
||||||
|
|
||||||
class AppResult final : public Result {
|
class AppResult final : public Result {
|
||||||
public:
|
public:
|
||||||
AppResult(RefPtr<Gfx::Bitmap> bitmap, DeprecatedString title, DeprecatedString tooltip, NonnullRefPtr<Desktop::AppFile> af, DeprecatedString arguments, int score)
|
AppResult(RefPtr<Gfx::Bitmap const> bitmap, DeprecatedString title, DeprecatedString tooltip, NonnullRefPtr<Desktop::AppFile> af, DeprecatedString arguments, int score)
|
||||||
: Result(move(title), move(tooltip), score)
|
: Result(move(title), move(tooltip), score)
|
||||||
, m_app_file(move(af))
|
, m_app_file(move(af))
|
||||||
, m_arguments(move(arguments))
|
, m_arguments(move(arguments))
|
||||||
|
@ -67,7 +67,7 @@ public:
|
||||||
private:
|
private:
|
||||||
NonnullRefPtr<Desktop::AppFile> m_app_file;
|
NonnullRefPtr<Desktop::AppFile> m_app_file;
|
||||||
DeprecatedString m_arguments;
|
DeprecatedString m_arguments;
|
||||||
RefPtr<Gfx::Bitmap> m_bitmap;
|
RefPtr<Gfx::Bitmap const> m_bitmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CalculatorResult final : public Result {
|
class CalculatorResult final : public Result {
|
||||||
|
@ -83,7 +83,7 @@ public:
|
||||||
virtual Gfx::Bitmap const* bitmap() const override { return m_bitmap; }
|
virtual Gfx::Bitmap const* bitmap() const override { return m_bitmap; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RefPtr<Gfx::Bitmap> m_bitmap;
|
RefPtr<Gfx::Bitmap const> m_bitmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FileResult final : public Result {
|
class FileResult final : public Result {
|
||||||
|
@ -111,7 +111,7 @@ public:
|
||||||
virtual Gfx::Bitmap const* bitmap() const override { return m_bitmap; }
|
virtual Gfx::Bitmap const* bitmap() const override { return m_bitmap; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RefPtr<Gfx::Bitmap> m_bitmap;
|
RefPtr<Gfx::Bitmap const> m_bitmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
class URLResult final : public Result {
|
class URLResult final : public Result {
|
||||||
|
@ -127,7 +127,7 @@ public:
|
||||||
virtual Gfx::Bitmap const* bitmap() const override { return m_bitmap; }
|
virtual Gfx::Bitmap const* bitmap() const override { return m_bitmap; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RefPtr<Gfx::Bitmap> m_bitmap;
|
RefPtr<Gfx::Bitmap const> m_bitmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Provider : public RefCounted<Provider> {
|
class Provider : public RefCounted<Provider> {
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace Assistant {
|
||||||
|
|
||||||
struct AppState {
|
struct AppState {
|
||||||
Optional<size_t> selected_index;
|
Optional<size_t> selected_index;
|
||||||
NonnullRefPtrVector<Result> results;
|
NonnullRefPtrVector<Result const> results;
|
||||||
size_t visible_result_count { 0 };
|
size_t visible_result_count { 0 };
|
||||||
|
|
||||||
Threading::Mutex lock;
|
Threading::Mutex lock;
|
||||||
|
@ -84,7 +84,7 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Function<void(NonnullRefPtrVector<Result>)> on_new_results;
|
Function<void(NonnullRefPtrVector<Result const>)> on_new_results;
|
||||||
|
|
||||||
void search(DeprecatedString const& query)
|
void search(DeprecatedString const& query)
|
||||||
{
|
{
|
||||||
|
@ -121,7 +121,7 @@ private:
|
||||||
// NonnullRefPtrVector will provide dual_pivot_quick_sort references rather than pointers,
|
// NonnullRefPtrVector will provide dual_pivot_quick_sort references rather than pointers,
|
||||||
// and dual_pivot_quick_sort requires being able to construct the underlying type on the
|
// and dual_pivot_quick_sort requires being able to construct the underlying type on the
|
||||||
// stack. Assistant::Result is pure virtual, thus cannot be constructed on the stack.
|
// stack. Assistant::Result is pure virtual, thus cannot be constructed on the stack.
|
||||||
Vector<NonnullRefPtr<Result>> all_results;
|
Vector<NonnullRefPtr<Result const>> all_results;
|
||||||
for (auto const& results_for_provider : new_results->value) {
|
for (auto const& results_for_provider : new_results->value) {
|
||||||
if (results_for_provider == nullptr)
|
if (results_for_provider == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue