1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:58:11 +00:00

HackStudio: Add a factory function for HackStudioWidget

This will allow us to handle errors while creating the HackStudioWidget.

(tip: check next commit :^)
This commit is contained in:
Baitinq 2022-12-16 01:57:49 +01:00 committed by Andreas Kling
parent 61789de11d
commit 55a903911b
3 changed files with 68 additions and 63 deletions

View file

@ -33,9 +33,10 @@
namespace HackStudio {
class HackStudioWidget : public GUI::Widget {
C_OBJECT(HackStudioWidget)
C_OBJECT_ABSTRACT(HackStudioWidget)
public:
static ErrorOr<NonnullRefPtr<HackStudioWidget>> create(DeprecatedString path_to_project);
virtual ~HackStudioWidget() override;
bool open_file(DeprecatedString const& filename, size_t line = 0, size_t column = 0);
@ -89,7 +90,6 @@ private:
DeprecatedString get_absolute_path(DeprecatedString const&) const;
Vector<DeprecatedString> selected_file_paths() const;
HackStudioWidget(DeprecatedString path_to_project);
void open_project(DeprecatedString const& root_path);
enum class EditMode {