MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / removeFile

Method removeFile

player/NymphCastPlayer/mainwindow.cpp:859–881  ·  view source on GitHub ↗

--- REMOVE FILE ---

Source from the content-addressed store, hash-verified

857
858// --- REMOVE FILE ---
859void MainWindow::removeFile() {
860 // Remove currently selected filename(s) from the playlist.
861 QListWidgetItem* item = ui->mediaListWidget->currentItem();
862 ui->mediaListWidget->removeItemWidget(item);
863 delete item;
864
865 // TODO: Remove stored file path.
866 // FIXME: Clear and rewrite the file contents for now.
867 QFile playlist;
868 playlist.setFileName(appDataLocation + "/filepaths.conf");
869 playlist.open(QIODevice::ReadWrite | QIODevice::Truncate);
870
871 int size = ui->mediaListWidget->count();
872 QTextStream textStream(&playlist);
873 textStream.setCodec("UTF-8");
874 for (int i = 0; i < size; ++i) {
875 QListWidgetItem* item = ui->mediaListWidget->item(i);
876 QString filename = item->data(Qt::UserRole).toString();
877 textStream << filename << "\n";
878 }
879
880 playlist.close();
881}
882
883
884// --- REMOTE IS CONNECTED ---

Callers

nothing calls this directly

Calls 4

dataMethod · 0.80
openMethod · 0.45
toStringMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected