Skip to content

Commit b454a76

Browse files
committed
Properly clear loaded item if it's removed from the file list
1 parent 2b89248 commit b454a76

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ff-utils-winforms/Forms/MainForm.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ public void RefreshFileListUi()
298298

299299
fileCountLabel.Text = $"{count} file{(count != 1 ? "s" : "")} loaded. " +
300300
$"{(count > 1 && RunTask.currentFileListMode == RunTask.FileListMode.Mux ? "Double click any of them or use the Load Tracks button to load their tracks." : "")}";
301+
302+
if (TrackList.current != null && !fileList.Items.Cast<ListViewItem>().Select(x => ((FileListEntry)x.Tag)).Any(x => x.File.Equals(TrackList.current.File)))
303+
TrackList.ClearCurrentFile();
301304
}
302305

303306
private async void fileListMode_SelectedIndexChanged(object sender, EventArgs e)

ff-utils-winforms/UI/TrackList.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ public static void Refresh ()
135135
i = 0; // Reset loop index, otherwise removing will result in skipped entries
136136
}
137137
}
138+
139+
Program.mainForm.RefreshFileListUi();
138140
}
139141

140142
public static string GetStreamDetails(Stream stream, MediaFile mediaFile = null)

0 commit comments

Comments
 (0)