void Note::restore(const QStringList& data) { QStringList::ConstIterator line = data.begin(); QStringList fields; fields = (*line).split("\t"); if (fields[0] == "AutoExec"){ setAutoexec(fields[1] == "1"); line++; } bool lineNumbers = true; if ((*line).startsWith("<LineNumbers>")){ QString s = *line; lineNumbers = s.remove("<LineNumbers>").remove("</LineNumbers>").toInt(); line++; } if (*line == "<content>") line++; while (line != data.end() && *line != "</content>") te->insertPlainText((*line++)+"\n"); d_line_number->setVisible(lineNumbers); te->moveCursor(QTextCursor::Start); }
void Note::restore(const QStringList& data) { QStringList::ConstIterator line = data.begin(); QStringList fields; fields = (*line).split("\t"); if (fields[0] == "AutoExec"){ setAutoexec(fields[1] == "1"); line++; } if (*line == "<content>") line++; while (line != data.end() && *line != "</content>") te->insertPlainText((*line++)+"\n"); }