refactor: Remove most raw accesses into Application (#5104)
This commit is contained in:
@@ -38,16 +38,17 @@ CommandPage::CommandPage()
|
||||
LayoutCreator<CommandPage> layoutCreator(this);
|
||||
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
|
||||
|
||||
EditableModelView *view =
|
||||
layout.emplace<EditableModelView>(app->commands->createModel(nullptr))
|
||||
.getElement();
|
||||
EditableModelView *view = layout
|
||||
.emplace<EditableModelView>(
|
||||
app->getCommands()->createModel(nullptr))
|
||||
.getElement();
|
||||
|
||||
view->setTitles({"Trigger", "Command", "Show In\nMessage Menu"});
|
||||
view->getTableView()->horizontalHeader()->setSectionResizeMode(
|
||||
1, QHeaderView::Stretch);
|
||||
// We can safely ignore this signal connection since we own the view
|
||||
std::ignore = view->addButtonPressed.connect([] {
|
||||
getApp()->commands->items.append(
|
||||
getIApp()->getCommands()->items.append(
|
||||
Command{"/command", "I made a new command HeyGuys"});
|
||||
});
|
||||
|
||||
@@ -66,7 +67,7 @@ CommandPage::CommandPage()
|
||||
{
|
||||
if (int index = line.indexOf(' '); index != -1)
|
||||
{
|
||||
getApp()->commands->items.insert(
|
||||
getIApp()->getCommands()->items.insert(
|
||||
Command(line.mid(0, index), line.mid(index + 1)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user