ConversionApply.h header

#include <ew/app/ConversionApply.h>

Namespace ew::app

ConversionApplyOptions struct

struct ew::app::ConversionApplyOptions

Where the apply step reads from and how it routes GM-secret material.

Members

QString ew::app::ConversionApplyOptions::sourceFolder

The absolute path of the converted folder (import files are read from here).

QString ew::app::ConversionApplyOptions::projectDir

The open project's folder (asset imports copy into <projectDir>/assets). When empty, media/asset imports are skipped with a note – nothing else is affected.

QString ew::app::ConversionApplyOptions::gmAudience = QStringLiteral("GM")

The audience GM-secret notes are restricted to (registered on the project if absent).

QString ew::app::ConversionApplyOptions::commandDescription = QStringLiteral("Convert folder with AI")

The undo-menu description of the returned composite. The supervised wizard applies the reviewed proposal as several stage slices, each its own undoable command, and labels each slice through this.

ConversionApplyResult struct

struct ew::app::ConversionApplyResult

What one apply created, plus honest notes for everything it could not (unreadable file, unparseable date, unresolvable reference) – the wizard folds these into the report.

Members

int ew::app::ConversionApplyResult::categoriesAdded = 0

Number of codex categories created.

int ew::app::ConversionApplyResult::entitiesAdded = 0

Number of entities created.

int ew::app::ConversionApplyResult::documentsAdded = 0

Number of documents imported.

int ew::app::ConversionApplyResult::documentsRestricted = 0

Number of imported documents restricted to the GM audience.

int ew::app::ConversionApplyResult::timelinesAdded = 0

Number of timelines created.

int ew::app::ConversionApplyResult::eventsAdded = 0

Number of timeline events created.

int ew::app::ConversionApplyResult::erasAdded = 0

Number of timeline eras created.

int ew::app::ConversionApplyResult::sheetsAdded = 0

Number of spreadsheets created.

int ew::app::ConversionApplyResult::sourcesAdded = 0

Number of research sources created.

int ew::app::ConversionApplyResult::tasksAdded = 0

Number of tasks created.

int ew::app::ConversionApplyResult::plotThreadsAdded = 0

Number of plot threads created.

int ew::app::ConversionApplyResult::languagesAdded = 0

Number of languages created (or merged into a same-named existing one).

int ew::app::ConversionApplyResult::statBlocksAdded = 0

Number of stat blocks created.

int ew::app::ConversionApplyResult::rollTablesAdded = 0

Number of roll tables created.

int ew::app::ConversionApplyResult::mapsAdded = 0

Number of maps created.

int ew::app::ConversionApplyResult::mediaAdded = 0

Number of media assets imported.

QStringList ew::app::ConversionApplyResult::notes

One line per item that was skipped, degraded, or needs the writer's attention.

Functions

std::unique_ptr< ew::core::Command > ew::app::buildApplyConversionCommand(ew::core::Project &project, const ConversionProposal &proposal, const ConversionApplyOptions &options, ConversionApplyResult &result)

Turns proposal into ONE undoable command (docs/AI_FOLDER_CONVERSION.md §1: every apply is undoable; a single Ctrl+Z takes the whole conversion back). It creates categories/entities (fields, aliases, summaries), applies details (references as Reference fields, lifespans, state-over-time – dates parsed against the project calendar, never guessed), imports prose/ PDF-converted/screenplay/note documents (GM-secret files audience-restricted), copies assets (gallery matches with cover-first ordering; map-titled images become Maps with the image as backdrop; referenced PDFs link onto their Source's "file" field), builds spreadsheets (AI sheets and direct CSV/TSV), timeline events + eras (the calendar hint is surfaced in a note, never auto-applied), sources, tasks, plot threads, languages (lexicons merged into a same-named existing Language), stat blocks, and roll tables. Proposals are expected already deduplicated against the project (the orchestrator's job); entities are re-guarded here because later families resolve names through them. May return an empty composite when the proposal is empty; the caller pushes the command onto its stack.