MCPcopy Create free account
hub / github.com/IENT/YUView / savePlaylistToFile

Method savePlaylistToFile

YUViewLib/src/ui/widgets/PlaylistTreeWidget.cpp:827–854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825}
826
827void PlaylistTreeWidget::savePlaylistToFile()
828{
829 // ask user for file location
830 QSettings settings;
831
832 QString filename = QFileDialog::getSaveFileName(this,
833 tr("Save Playlist"),
834 settings.value("LastPlaylistPath").toString(),
835 tr("Playlist Files (*.yuvplaylist)"));
836 if (filename.isEmpty())
837 return;
838 if (!filename.endsWith(".yuvplaylist", Qt::CaseInsensitive))
839 filename += ".yuvplaylist";
840
841 // remember this directory for next time
842 QDir dirName(filename.section('/', 0, -2));
843 settings.setValue("LastPlaylistPath", dirName.path());
844
845 // Write the XML structure to file
846 QFile file(filename);
847 file.open(QIODevice::WriteOnly | QIODevice::Text);
848 QTextStream outStream(&file);
849 outStream << getPlaylistString(dirName);
850 file.close();
851
852 // We saved the playlist
853 isSaved = true;
854}
855
856bool PlaylistTreeWidget::loadPlaylistFile(const QString &filePath)
857{

Callers 1

closeEventMethod · 0.80

Calls 2

toStringMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected