Merge commit 'df22a1e51b411329184b3fe33cfc0b665b7b87b6'
This commit is contained in:
2
deps/nostalgia/src/olympic/keel/src/pack.cpp
vendored
2
deps/nostalgia/src/olympic/keel/src/pack.cpp
vendored
@ -29,7 +29,7 @@ static ox::Error pathToInode(
|
||||
return {};
|
||||
}
|
||||
if (beginsWith(path, "uuid://")) {
|
||||
auto const uuid = substr<ox::StringView>(path, 7);
|
||||
auto const uuid = ox::substr(path, 7);
|
||||
oxReturnError(keel::uuidToPath(ctx, uuid).moveTo(path));
|
||||
}
|
||||
oxRequire(s, dest.stat(path));
|
||||
|
@ -13,5 +13,6 @@
|
||||
#include <studio/popup.hpp>
|
||||
#include <studio/project.hpp>
|
||||
#include <studio/task.hpp>
|
||||
#include <studio/undocommand.hpp>
|
||||
#include <studio/undostack.hpp>
|
||||
#include <studio/widget.hpp>
|
||||
|
19
deps/nostalgia/src/olympic/studio/modlib/include/studio/undocommand.hpp
vendored
Normal file
19
deps/nostalgia/src/olympic/studio/modlib/include/studio/undocommand.hpp
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2016 - 2024 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace studio {
|
||||
|
||||
class UndoCommand {
|
||||
public:
|
||||
virtual ~UndoCommand() noexcept = default;
|
||||
virtual void redo() noexcept = 0;
|
||||
virtual void undo() noexcept = 0;
|
||||
[[nodiscard]]
|
||||
virtual int commandId() const noexcept = 0;
|
||||
virtual bool mergeWith(UndoCommand const*cmd) noexcept;
|
||||
};
|
||||
|
||||
}
|
@ -9,17 +9,9 @@
|
||||
#include <ox/std/memory.hpp>
|
||||
#include <ox/std/vector.hpp>
|
||||
|
||||
namespace studio {
|
||||
#include "undocommand.hpp"
|
||||
|
||||
class UndoCommand {
|
||||
public:
|
||||
virtual ~UndoCommand() noexcept = default;
|
||||
virtual void redo() noexcept = 0;
|
||||
virtual void undo() noexcept = 0;
|
||||
[[nodiscard]]
|
||||
virtual int commandId() const noexcept = 0;
|
||||
virtual bool mergeWith(UndoCommand const*cmd) noexcept;
|
||||
};
|
||||
namespace studio {
|
||||
|
||||
class UndoStack {
|
||||
private:
|
||||
|
@ -7,6 +7,7 @@ add_library(
|
||||
popup.cpp
|
||||
project.cpp
|
||||
task.cpp
|
||||
undocommand.cpp
|
||||
undostack.cpp
|
||||
filedialog_nfd.cpp
|
||||
)
|
||||
|
10
deps/nostalgia/src/olympic/studio/modlib/src/undocommand.cpp
vendored
Normal file
10
deps/nostalgia/src/olympic/studio/modlib/src/undocommand.cpp
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
#include <studio/undocommand.hpp>
|
||||
|
||||
namespace studio {
|
||||
|
||||
bool UndoCommand::mergeWith(UndoCommand const*) noexcept {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -6,10 +6,6 @@
|
||||
|
||||
namespace studio {
|
||||
|
||||
bool UndoCommand::mergeWith(UndoCommand const*) noexcept {
|
||||
return false;
|
||||
}
|
||||
|
||||
void UndoStack::push(ox::UPtr<UndoCommand> &&cmd) noexcept {
|
||||
for (auto const i = m_stackIdx; i < m_stack.size();) {
|
||||
std::ignore = m_stack.erase(i);
|
||||
|
Reference in New Issue
Block a user