| 5496 | } |
| 5497 | |
| 5498 | void EventBrowser::ExportAction(QTextStream &writer, int maxNameLength, int indent, bool firstchild, |
| 5499 | const QModelIndex &idx) |
| 5500 | { |
| 5501 | QString nameString = GetExportString(indent, firstchild, idx); |
| 5502 | |
| 5503 | QModelIndex eidIdx = idx.model()->sibling(idx.row(), COL_EID, idx); |
| 5504 | QModelIndex actionIdx = idx.model()->sibling(idx.row(), COL_ACTION, idx); |
| 5505 | |
| 5506 | QString line = QFormatStr("%1 | %2 | %3") |
| 5507 | .arg(eidIdx.data(ROLE_SELECTED_EID).toString(), -5) |
| 5508 | .arg(nameString, -maxNameLength) |
| 5509 | .arg(actionIdx.data(Qt::DisplayRole).toString(), -6); |
| 5510 | |
| 5511 | if(m_Model->HasTimes()) |
| 5512 | { |
| 5513 | QVariant duration = idx.model()->sibling(idx.row(), COL_DURATION, idx).data(Qt::DisplayRole); |
| 5514 | |
| 5515 | if(duration != QVariant()) |
| 5516 | { |
| 5517 | line += QFormatStr(" | %1").arg(duration.toString()); |
| 5518 | } |
| 5519 | else |
| 5520 | { |
| 5521 | line += lit(" |"); |
| 5522 | } |
| 5523 | } |
| 5524 | |
| 5525 | writer << line << "\n"; |
| 5526 | |
| 5527 | firstchild = true; |
| 5528 | |
| 5529 | for(int i = 0, rowCount = idx.model()->rowCount(idx); i < rowCount; i++) |
| 5530 | { |
| 5531 | ExportAction(writer, maxNameLength, indent + 1, firstchild, idx.child(i, COL_NAME)); |
| 5532 | firstchild = false; |
| 5533 | } |
| 5534 | } |
| 5535 | |
| 5536 | QVariant EventBrowser::persistData() |
| 5537 | { |