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:
Ben Wiederhake 2020-08-10 22:28:38 +02:00 committed by Andreas Kling
parent 42b057b0c9
commit 7893871d5a
Notes: sideshowbarker 2024-07-19 03:43:14 +09:00
7 changed files with 53 additions and 18 deletions

View file

@ -25,6 +25,7 @@
*/
#include "Project.h"
#include "HackStudio.h"
#include <AK/LexicalPath.h>
#include <AK/QuickSort.h>
#include <AK/StringBuilder.h>
@ -117,7 +118,6 @@ public:
return m_project.m_file_icon;
}
if (role == Role::Font) {
extern String g_currently_open_file;
if (node->name == g_currently_open_file)
return Gfx::Font::default_bold_font();
return {};