1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 01:47:34 +00:00

Everywhere: Move AppFile from LibGUI to LibDesktop

This was mentioned in #4574, and the more I think about it the more it
feels just right - let's move it there! :^)
Having to link LaunchServer against LibGUI explicitly should've been
telling enough...
This commit is contained in:
Linus Groh 2020-12-28 01:06:38 +01:00 committed by Andreas Kling
parent 97c42694db
commit 58890e03b6
12 changed files with 20 additions and 20 deletions

View file

@ -28,9 +28,9 @@
#include <AK/Vector.h>
#include <LibCore/ConfigFile.h>
#include <LibCore/DirIterator.h>
#include <LibGUI/AppFile.h>
#include <LibDesktop/AppFile.h>
namespace GUI {
namespace Desktop {
NonnullRefPtr<AppFile> AppFile::get_for_app(const StringView& app_name)
{

View file

@ -30,7 +30,7 @@
#include <LibGUI/FileIconProvider.h>
#include <LibGUI/Icon.h>
namespace GUI {
namespace Desktop {
class AppFile : public RefCounted<AppFile> {
public:
@ -49,7 +49,7 @@ public:
Vector<String> launcher_file_types() const;
Vector<String> launcher_protocols() const;
Icon icon() const { return FileIconProvider::icon_for_path(executable()); };
GUI::Icon icon() const { return GUI::FileIconProvider::icon_for_path(executable()); };
private:
explicit AppFile(const StringView& path);

View file

@ -1,4 +1,5 @@
set(SOURCES
AppFile.cpp
Launcher.cpp
)
@ -8,4 +9,4 @@ set(GENERATED_SOURCES
)
serenity_lib(LibDesktop desktop)
target_link_libraries(LibDesktop LibIPC)
target_link_libraries(LibDesktop LibCore LibIPC LibGUI)

View file

@ -5,7 +5,6 @@ set(SOURCES
AbstractView.cpp
Action.cpp
ActionGroup.cpp
AppFile.cpp
Application.cpp
BoxLayout.cpp
Button.cpp

View file

@ -34,9 +34,9 @@
#include <AK/Utf8View.h>
#include <LibCore/ConfigFile.h>
#include <LibCore/MimeData.h>
#include <LibDesktop/AppFile.h>
#include <LibDesktop/Launcher.h>
#include <LibGUI/Action.h>
#include <LibGUI/AppFile.h>
#include <LibGUI/Application.h>
#include <LibGUI/Clipboard.h>
#include <LibGUI/DragOperation.h>
@ -858,7 +858,7 @@ void TerminalWidget::context_menu_event(GUI::ContextMenuEvent& event)
// Then add them to the context menu.
// FIXME: Adapt this code when we actually support calling LaunchServer with a specific handler in mind.
for (auto& handler : handlers) {
auto af = GUI::AppFile::get_for_app(LexicalPath(handler).basename());
auto af = Desktop::AppFile::get_for_app(LexicalPath(handler).basename());
if (!af->is_valid())
continue;
auto action = GUI::Action::create(String::formatted("Open in {}", af->name()), af->icon().bitmap_for_size(16), [this, handler](auto&) {