Menu

#23 Make Project File use XML file format

Done
None
Medium
Enhancement
2021-10-20
2015-02-09
Anonymous
No

Originally created by: david.villalobos.c
Originally owned by: david.villalobos.c

Make Project File user XML file format

Discussion

  • Anonymous

    Anonymous - 2015-03-04

    Originally posted by: david.villalobos.c

    //  QFile files(fileName + ".xml");
    //  if(files.open(QIODevice::WriteOnly | QIODevice::Text)) {
    //    QXmlStreamWriter xmlStreamWriter(&files);
    //    xmlStreamWriter.setAutoFormatting(true);
    //    xmlStreamWriter.writeStartDocument();

    //    xmlStreamWriter.writeStartElement("Project");

    //    xmlStreamWriter.writeStartElement("Information");
    //    xmlStreamWriter.writeTextElement("Name", name());
    //    xmlStreamWriter.writeTextElement("Path", getProjectPath());
    //    xmlStreamWriter.writeEndElement(); // Information

    //    xmlStreamWriter.writeStartElement("Files");
    //    foreach (QString fileName, getProjectFileList())
    //      xmlStreamWriter.writeTextElement("File", fileName);
    //    xmlStreamWriter.writeEndElement(); // Files

    //    xmlStreamWriter.writeStartElement("DockMarks");
    //    foreach (QString projectFile, getProjectFileList()) {
    //      QString dockMarks(getFileSettings(projectFile)->join(","));
    //      if (!dockMarks.isEmpty()) {
    //        xmlStreamWriter.writeStartElement("DockMark");
    //        xmlStreamWriter.writeAttribute("FileName", projectFile);
    //        foreach (QString mark, dockMarks.split(","))
    //          xmlStreamWriter.writeTextElement("Value", mark);
    //        xmlStreamWriter.writeEndElement(); // Files
    //      }
    //    }
    //    xmlStreamWriter.writeEndElement(); // DockMarks

    //    xmlStreamWriter.writeEndElement(); // Project
    //    xmlStreamWriter.writeEndDocument();
    //    files.close();
    //  } else {
    //    emit statusBarMessage(tr("Cannot write file %1:\n%2.").arg(fileName).arg(files.errorString()));
    //  }

    //  QFile files(fileName + ".xml");
    //  if(files.open(QIODevice::ReadOnly | QIODevice::Text)) {
    //    QXmlStreamReader xmlStreamReader(&files);
    //    while (!xmlStreamReader.atEnd()) {
    //      xmlStreamReader.readNext();
    //      if (xmlStreamReader.error())
    //        emit statusBarMessage(tr("Cannot read file %1:\n%2.").arg(fileName).arg(xmlStreamReader.errorString()));
    //      else
    //        if (!xmlStreamReader.text().toString().trimmed().isEmpty())
    //          qDebug() << xmlStreamReader.name() << xmlStreamReader.text().toString().trimmed();
    //    }
    //    files.close();
    //  } else {
    //    emit statusBarMessage(tr("Cannot read file %1:\n%2.").arg(fileName).arg(files.errorString()));
    //  }

     
  • Anonymous

    Anonymous - 2015-03-04

    Originally posted by: david.villalobos.c

    Got a problem reading a saved file.

     
  • David Villalobos Cambronero

    • Description has changed:

    Diff:

    
    
    • assigned_to: David Villalobos Cambronero
     
  • David Villalobos Cambronero

    • summary: Make Project File user XML file format --> Make Project File use XML file format
     
  • David Villalobos Cambronero

    • status: Accepted --> Done
     

Log in to post a comment.