Skip to content
Browse files

Cutlist editor: more undo stack fixes.

  • Loading branch information...
1 parent 02bfbc9 commit befae78dd66cc5e4c6c528931f446ddfa9d31f2c @stichnot stichnot committed Jan 3, 2013
Showing with 11 additions and 6 deletions.
  1. +10 −5 mythtv/libs/libmythtv/deletemap.cpp
  2. +1 −1 mythtv/libs/libmythtv/deletemap.h
View
15 mythtv/libs/libmythtv/deletemap.cpp
@@ -98,14 +98,18 @@ bool DeleteMap::HandleAction(QString &action, uint64_t frame, uint64_t played)
else if (action == "MOVENEXT")
MoveRelative(frame, true);
else if (action == "CUTTOBEGINNING")
- Add(frame, MARK_CUT_END, tr("Cut to Beginning"));
+ {
+ Push(tr("Cut to Beginning"));
+ AddMark(frame, MARK_CUT_END);
+ }
else if (action == "CUTTOEND")
{
- Add(frame, MARK_CUT_START, tr("Cut to End"));
+ Push(tr("Cut to End"));
+ AddMark(frame, MARK_CUT_START);
// If the recording is still in progress, add an explicit end
// mark at the end.
if (m_ctx->player && m_ctx->player->IsWatchingInprogress())
- Add(m_ctx->player->GetTotalFrameCount() - 1, MARK_CUT_END, "");
+ AddMark(m_ctx->player->GetTotalFrameCount() - 1, MARK_CUT_END);
}
else if (action == "NEWCUT")
NewCut(frame);
@@ -278,7 +282,7 @@ void DeleteMap::ReverseAll(void)
* existing redundant mark of that type is removed. This simplifies
* the cleanup code.
*/
-void DeleteMap::Add(uint64_t frame, MarkTypes type, QString undoMessage)
+void DeleteMap::AddMark(uint64_t frame, MarkTypes type)
{
EDIT_CHECK;
if ((MARK_CUT_START != type) && (MARK_CUT_END != type) &&
@@ -525,6 +529,7 @@ void DeleteMap::MoveRelative(uint64_t frame, bool right)
void DeleteMap::Move(uint64_t frame, uint64_t to)
{
EDIT_CHECK;
+ Push(tr("Move Mark"));
MarkTypes type = Delete(frame);
if (MARK_UNSET == type)
{
@@ -533,7 +538,7 @@ void DeleteMap::Move(uint64_t frame, uint64_t to)
else if (frame == m_ctx->player->GetTotalFrameCount())
type = MARK_CUT_END;
}
- Add(to, type, tr("Move Mark"));
+ AddMark(to, type);
}
/// Private addition to the deleteMap.
View
2 mythtv/libs/libmythtv/deletemap.h
@@ -54,7 +54,6 @@ class MTV_PUBLIC DeleteMap
void Clear(QString undoMessage = "");
void ReverseAll(void);
- void Add(uint64_t frame, MarkTypes type, QString undoMessage);
void NewCut(uint64_t frame);
void Delete(uint64_t frame, QString undoMessage);
void MoveRelative(uint64_t frame, bool right);
@@ -90,6 +89,7 @@ class MTV_PUBLIC DeleteMap
QString GetRedoMessage(void) const;
private:
+ void AddMark(uint64_t frame, MarkTypes type);
void Add(uint64_t frame, MarkTypes type);
MarkTypes Delete(uint64_t frame);

0 comments on commit befae78

Please sign in to comment.
Something went wrong with that request. Please try again.