mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-25 11:42:11 +00:00
HackStudio: Mark compilation-unit-only functions as static
This also resolves some typing issues that only 'accidentally' worked, like declaring a function to return type A, and the definition actually returning type B (which works if type B is a subtype of type A). I like to call these "ninja imports". To prevent problems like this in the future, I put all globals in a HackStudio.h. I'm not sure about the name, but main.h and common.h felt wrong.
This commit is contained in:
parent
42b057b0c9
commit
7893871d5a
Notes:
sideshowbarker
2024-07-19 03:43:14 +09:00
Author: https://github.com/BenWiederhake
Commit: 7893871d5a
Pull-request: https://github.com/SerenityOS/serenity/pull/3096
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/stelar7
7 changed files with 53 additions and 18 deletions
|
@ -26,15 +26,13 @@
|
|||
|
||||
#include "EditorWrapper.h"
|
||||
#include "Editor.h"
|
||||
#include "HackStudio.h"
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGfx/Font.h>
|
||||
|
||||
extern RefPtr<EditorWrapper> g_current_editor_wrapper;
|
||||
extern Function<void(String)> g_open_file;
|
||||
|
||||
EditorWrapper::EditorWrapper(BreakpointChangeCallback breakpoint_change_callback)
|
||||
{
|
||||
set_layout<GUI::VerticalBoxLayout>();
|
||||
|
@ -69,7 +67,7 @@ EditorWrapper::EditorWrapper(BreakpointChangeCallback breakpoint_change_callback
|
|||
g_current_editor_wrapper = this;
|
||||
};
|
||||
|
||||
m_editor->on_open = [this](String path) {
|
||||
m_editor->on_open = [](String path) {
|
||||
g_open_file(path);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue