1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:45:07 +00:00

HackStudio: Move bulk of GUI logic into HackStudioWidget

Previously, the GUI logic of HackStudio was all stuffed into main(),
and it started getting a bit out of hand :)
This commit is contained in:
Itamar 2020-09-19 17:25:05 +03:00 committed by Andreas Kling
parent 606c0e1672
commit e3e5e57fde
11 changed files with 1165 additions and 775 deletions

View file

@ -95,7 +95,7 @@ public:
return {};
}
virtual void update() override { }
virtual void update() override {}
virtual GUI::ModelIndex index(int row, int column = 0, const GUI::ModelIndex& = GUI::ModelIndex()) const override { return create_index(row, column, &m_matches.at(row)); }
private:
@ -105,7 +105,7 @@ private:
static RefPtr<SearchResultsModel> find_in_files(const StringView& text)
{
Vector<Match> matches;
g_project->for_each_text_file([&](auto& file) {
project().for_each_text_file([&](auto& file) {
auto matches_in_file = file.document().find_all(text);
for (auto& range : matches_in_file) {
auto whole_line_range = file.document().range_for_entire_line(range.start().line());