Beispiel #1
0
void PlayListModel::appendUrls(QList<QUrl> urls)
{
    QProgressDialog progress("Adding files to playlist...", "Cancel", 0, urls.count());
    progress.setWindowModality(Qt::ApplicationModal);
    progress.show();

    QList<PlayListItem *> new_items;
    QListIterator<QUrl> urls_iterator(urls);
    while (urls_iterator.hasNext()) {
        QUrl url = urls_iterator.next();
        if (url.isLocalFile()) {
            QString extension = url.fileName().split(".").last().toLower();
            if (extension == "m3u") {
                new_items += urlsToItems(m3uToUrls(url));
            } else {
                new_items += urlToItems(url);
            }
        }

        progress.setValue(progress.value() + 1);
        if (progress.wasCanceled())
            break;
    }

    progress.setValue(urls.count());
    appendItems(new_items);
}
		TITANIUM_FUNCTION(ListSection, appendItems)
		{
			const auto js_context = this_object.get_context();
			if (arguments.size() >= 1) {
				JSObject animation = js_context.CreateObject();
				const auto _0 = arguments.at(0);
				TITANIUM_ASSERT(_0.IsObject());
				const auto dataItems = js_to_ListDataItem_array(static_cast<JSObject>(_0));

				if (arguments.size() >= 2) {
					const auto _1 = arguments.at(1);
					if (_1.IsObject()) {
						animation = listviewAnimationProperties_ctor__.CallAsConstructor({ _1 });
					}
				}
				appendItems(dataItems, animation.GetPrivate<ListViewAnimationProperties>());
			}
			return get_context().CreateUndefined();
		}
Beispiel #3
0
void PlayListModel::appendUrls(QList<QUrl> urls)
{
    QProgressDialog progress("Adding files to playlist...", "Cancel", 0, urls.count());
    progress.setWindowModality(Qt::ApplicationModal);
    progress.show();

    QList<PlayListItem *> new_items;
    QListIterator<QUrl> urls_iterator(urls);
    while (urls_iterator.hasNext()) {
        QUrl url = urls_iterator.next();
        if (url.isLocalFile()) {
            new_items += urlToItems(url);
        }

        progress.setValue(progress.value() + 1);
        if (progress.wasCanceled())
            break;
    }

    progress.setValue(urls.count());
    appendItems(new_items);
}
Beispiel #4
0
	void ItemListWidget::setItems(const QStringList &items)
	{
		mModel->setRowCount(0);

		appendItems(items);
	}