void HeadingSelector::UpdateHeadingElements() { // We recreate the model to make sure even those // headings marked as "don't include" are in the model. CreateTOCModel(); UpdateOneHeadingElement(m_TableOfContents.invisibleRootItem()); QStringList ids; foreach (Headings::Heading heading, m_Headings) { ids = UpdateOneFile(heading, ids); }
void HeadingSelector::UpdateHeadingElements() { QApplication::setOverrideCursor(Qt::WaitCursor); // We recreate the model to make sure even those // headings marked as "don't include" are in the model. CreateTOCModel(); // Identify any existing hrefs to an id that will indicate we can't change it QStringList used_ids = m_Book->GetIdsInHrefs(); // Iterate through our headings, applying their changes to the underlying resources // if required, setting ids etc. int next_toc_id = 1; UpdateOneHeadingElement(m_TableOfContents.invisibleRootItem(), used_ids, next_toc_id); // Now iterate through the headings one final time, to save the underlying resources // that we have changed. QStringList ids; foreach(Headings::Heading heading, m_Headings) { ids = UpdateOneFile(heading, ids); }