mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:27:35 +00:00
LibGUI: Make ModelSelection non-copyable and non-movable
These are meant to be attached to an AbstractView at all times.
This commit is contained in:
parent
9bdd8ec3f3
commit
b97e42dcaa
2 changed files with 5 additions and 1 deletions
|
@ -775,7 +775,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
||||||
|
|
||||||
directory_view.on_selection_change = [&](GUI::AbstractView& view) {
|
directory_view.on_selection_change = [&](GUI::AbstractView& view) {
|
||||||
// FIXME: Figure out how we can enable/disable the paste action, based on clipboard contents.
|
// FIXME: Figure out how we can enable/disable the paste action, based on clipboard contents.
|
||||||
auto selection = view.selection();
|
auto& selection = view.selection();
|
||||||
|
|
||||||
delete_action->set_enabled(!selection.is_empty() && access(directory_view.path().characters(), W_OK) == 0);
|
delete_action->set_enabled(!selection.is_empty() && access(directory_view.path().characters(), W_OK) == 0);
|
||||||
copy_action->set_enabled(!selection.is_empty());
|
copy_action->set_enabled(!selection.is_empty());
|
||||||
|
|
|
@ -31,10 +31,14 @@
|
||||||
#include <AK/TemporaryChange.h>
|
#include <AK/TemporaryChange.h>
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
#include <LibGUI/ModelIndex.h>
|
#include <LibGUI/ModelIndex.h>
|
||||||
|
#include <AK/Noncopyable.h>
|
||||||
|
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
class ModelSelection {
|
class ModelSelection {
|
||||||
|
AK_MAKE_NONCOPYABLE(ModelSelection);
|
||||||
|
AK_MAKE_NONMOVABLE(ModelSelection);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ModelSelection(AbstractView& view)
|
ModelSelection(AbstractView& view)
|
||||||
: m_view(view)
|
: m_view(view)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue