+ if (chapters.isEmpty() == false)
+ item->setData(1, Qt::UserRole + 1, chapters);
+ else if (QFile::exists(url.path() + ".dvdchapter")) {
+ // insert chapters as children
+ QFile file(url.path() + ".dvdchapter");
+ if (file.open(QIODevice::ReadOnly)) {
+ QDomDocument doc;
+ doc.setContent(&file);
+ file.close();
+ QDomNodeList chapters = doc.elementsByTagName("chapter");
+ QStringList chaptersList;
+ for (int j = 0; j < chapters.count(); j++) {
+ chaptersList.append(QString::number(chapters.at(j).toElement().attribute("time").toInt()));
+ }
+ item->setData(1, Qt::UserRole + 1, chaptersList.join(";"));
+ }
+ } else // Explicitly add a chapter at 00:00:00:00
+ item->setData(1, Qt::UserRole + 1, "0");
+