Пример #1
0
/** Send folders or tracks to a specific position in a playlist. */
void TreeView::appendToPlaylist()
{
	QList<QUrl> tracks;
	if (this->beforeSending(tr("playlist"), &tracks) == QMessageBox::Ok) {
		emit aboutToInsertToPlaylist(-1, tracks);
	}
}
/** Get the folder which is the target of one's double-click. */
void FileSystemTreeView::convertIndex(const QModelIndex &index)
{
	QFileInfo fileInfo = _fileSystemModel->fileInfo(index);
	if (fileInfo.isDir()) {
		emit folderChanged(_fileSystemModel->filePath(index));
	} else {
		QStringList tracks;
		tracks << "file://" + fileInfo.absoluteFilePath();
		emit aboutToInsertToPlaylist(-1, tracks);
	}
}