+TaskList::TaskList(QString listName)
+{
+ QDomDocument doc;
+ QDomElement root = doc.createElement("todolist");
+ doc.appendChild(root);
+ root.setAttribute("name", listName);
+
+ QFile file("./tests/" + listName + ".xml");
+ if(!file.open(QIODevice::WriteOnly | QFile::Truncate)) {
+ QMessageBox::critical(0, tr("Unable to create Todo List"),
+ tr("An error happened while creating the list file : ") + file.errorString());
+ return;
+ }
+
+ QTextStream stream(&file);
+ doc.save(stream, 4);
+ stream.flush();
+}
+