QList<QTreeWidgetItem*> BtBookmarkLoader::loadTree(QString fileName)
{
	qDebug() << "BtBookmarkLoader::loadTree";
	QList<QTreeWidgetItem*> itemList;
	
	QDomDocument doc;
	doc.setContent(loadXmlFromFile(fileName));
	
	//bookmarkfolder::loadBookmarksFromXML()
	
	QDomElement document = doc.documentElement();
	if( document.tagName() != "SwordBookmarks" ) {
		qWarning("Not a BibleTime Bookmark XML file");
		return QList<QTreeWidgetItem*>();
	}

	QDomElement child = document.firstChild().toElement();

	while ( !child.isNull() && child.parentNode() == document) {
		qDebug() << "BtBookmarkLoader::loadTree while start";
		QTreeWidgetItem* i = handleXmlElement(child, 0);
		itemList.append(i);
		if (!child.nextSibling().isNull()) {
			child = child.nextSibling().toElement();
		} else {
			child = QDomElement(); //null
		}
		
	}

	return itemList;
}
Esempio n. 2
0
bool loadPluginXml(QDomDocument* xmlDoc, QString filename)
{
	QString sFile = PluginHosts::appInfoHost->appHomeDir(ApplicationInfoAccessingHost::DataLocation) + QDir::separator() + "sof_game" + QDir::separator() + filename;
	return loadXmlFromFile(xmlDoc, sFile);
}