Browse Source

fix undo history getting cleared when deleting tracks

Fixes https://todo.sr.ht/~alextee/zrythm-bug/870.
audio_region_bpm_change_fix
Alexandros Theodotou 10 months ago
parent
commit
4fa6e7d86f
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 20
      inc/audio/automation_point.h
  2. 20
      inc/utils/stack.h
  3. 16
      src/actions/actions.c
  4. 1
      src/gui/widgets/automation_point.c
  5. 12
      tests/actions/tracklist_selections.c

20
inc/audio/automation_point.h

@ -1,21 +1,5 @@ @@ -1,21 +1,5 @@
/*
* Copyright (C) 2018-2022 Alexandros Theodotou <alex at zrythm dot org>
*
* This file is part of Zrythm
*
* Zrythm is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Zrythm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: © 2018-2022 Alexandros Theodotou <alex@zrythm.org>
// SPDX-License-Identifier: LicenseRef-ZrythmLicense
/**
* \file

20
inc/utils/stack.h

@ -1,21 +1,5 @@ @@ -1,21 +1,5 @@
/*
* Copyright (C) 2019-2021 Alexandros Theodotou <alex at zrythm dot org>
*
* This file is part of Zrythm
*
* Zrythm is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Zrythm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
*/
// SPDX-FileCopyrightText: © 2019-2021 Alexandros Theodotou <alex@zrythm.org>
// SPDX-License-Identifier: LicenseRef-ZrythmLicense
/**
* \file

16
src/actions/actions.c

@ -1860,8 +1860,20 @@ activate_delete_selected_tracks ( @@ -1860,8 +1860,20 @@ activate_delete_selected_tracks (
return;
}
on_delete_tracks_response (
NULL, GTK_RESPONSE_YES, NULL);
GError * err = NULL;
bool ret =
tracklist_selections_action_perform_delete (
TRACKLIST_SELECTIONS, PORT_CONNECTIONS_MGR,
&err);
if (ret)
{
EVENTS_PUSH (ET_UNDO_REDO_ACTION_DONE, NULL);
}
else
{
HANDLE_ERROR (
err, "%s", _ ("Failed to delete tracks"));
}
}
DEFINE_SIMPLE (activate_hide_selected_tracks)

1
src/gui/widgets/automation_point.c

@ -133,7 +133,6 @@ automation_point_draw ( @@ -133,7 +133,6 @@ automation_point_draw (
int upslope =
next_ap && ap->fvalue < next_ap->fvalue;
(void) upslope;
(void) next_obj;
if (next_ap)

12
tests/actions/tracklist_selections.c

@ -1039,6 +1039,10 @@ test_no_visible_tracks_after_track_deletion (void) @@ -1039,6 +1039,10 @@ test_no_visible_tracks_after_track_deletion (void)
g_assert_cmpint (
TRACKLIST_SELECTIONS->num_tracks, >, 0);
/* assert undo history is not empty */
g_assert_false (undo_stack_is_empty (
UNDO_MANAGER->undo_stack));
test_helper_zrythm_cleanup ();
}
@ -3189,15 +3193,15 @@ main (int argc, char * argv[]) @@ -3189,15 +3193,15 @@ main (int argc, char * argv[])
#define TEST_PREFIX \
"/actions/tracklist_selections/"
g_test_add_func (
TEST_PREFIX
"test track deletion with lv2 worker",
(GTestFunc) test_track_deletion_with_lv2_worker);
g_test_add_func (
TEST_PREFIX
"test no visible tracks after track deletion",
(GTestFunc)
test_no_visible_tracks_after_track_deletion);
g_test_add_func (
TEST_PREFIX
"test track deletion with lv2 worker",
(GTestFunc) test_track_deletion_with_lv2_worker);
g_test_add_func (
TEST_PREFIX
"test track deletion w mixer selections",

Loading…
Cancel
Save