feat: support move image file to trash

Resolve: BLumia/pineapple-pictures#42
This commit is contained in:
2024-04-15 01:16:00 +08:00
parent 37cfdad799
commit e0fda8f3b0
23 changed files with 747 additions and 399 deletions

View File

@ -118,6 +118,16 @@ int PlaylistManager::appendFile(const QString &filePath)
return index;
}
// Note: this will only remove file out of the list, this will NOT delete the file
void PlaylistManager::removeFileAt(int index)
{
m_playlist.removeAt(index);
if (m_playlist.count() <= m_currentIndex) {
m_currentIndex--;
}
}
int PlaylistManager::indexOf(const QString &filePath)
{
const QUrl & url = QUrl::fromLocalFile(filePath);