From 7ee008e150bc5bcf76082d726f719ee0fdfda982 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Wed, 11 Feb 2026 02:37:39 -0600 Subject: Fluorine Manager: full Linux port of Mod Organizer 2 Complete native Linux port with FUSE-based virtual filesystem, Proton/umu-run integration, and Flatpak packaging. Key features: - FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak) - Proton/GE-Proton/umu-run launcher with env var forwarding - Flatpak support (sandbox-aware VFS, NXM handler, umu-run) - Wine prefix management UI - Case-insensitive path resolution for Linux filesystems - QSettings-safe INI handling (avoids Bethesda INI corruption) - Portable instance support with auto-generated launcher scripts Co-Authored-By: Claude Opus 4.6 --- libs/installer_fomod/src/xmlreader.cpp | 83 ++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 libs/installer_fomod/src/xmlreader.cpp (limited to 'libs/installer_fomod/src/xmlreader.cpp') diff --git a/libs/installer_fomod/src/xmlreader.cpp b/libs/installer_fomod/src/xmlreader.cpp new file mode 100644 index 0000000..7f53710 --- /dev/null +++ b/libs/installer_fomod/src/xmlreader.cpp @@ -0,0 +1,83 @@ +#include "xmlreader.h" + +#include + +#include + +using MOBase::Exception; + +bool XmlReader::getNextElement(QString const& start) +{ + while (!atEnd()) { + switch (readNext()) { + case EndElement: + if (name() != start) { + qWarning() << "Got end of " << name() << ", expected " << start << " at " + << lineNumber(); + continue; + } + return false; + + case StartElement: + return true; + + case Invalid: + throw Exception("bad xml"); + + default: + qWarning() << "Unexpected token type " << tokenString() << " at " << lineNumber(); + } + } + return false; +} + +void XmlReader::unexpected() +{ + qWarning() << "Unexpected element " << name() << " near line " << lineNumber(); + // Eat the contents + QString s = readElementText(IncludeChildElements); + // Print them out if in debugging mode + qDebug() << " contains " << s; +} + +void XmlReader::finishedElement() +{ + QString const self = name().toString(); + while (!atEnd()) { + switch (readNext()) { + case EndElement: + if (name() != self) { + qWarning() << "Got end element for " << name() << ", expected " << self + << " at " << lineNumber(); + continue; + } + return; + + case Invalid: + throw Exception("bad xml"); + return; + + case StartElement: + unexpected(); + break; + + default: + qWarning() << "Unexpected token type " << tokenString() << " at " << lineNumber(); + } + } +} + +QString XmlReader::getText() +{ + // This reads the text in an element, leaving you at the next element. + QString result; + while (QXmlStreamReader::readNext() == Comment || tokenType() == Characters) { + if (tokenType() == Characters) { + result += text(); + } + } + if (tokenType() != EndElement) { + qWarning() << "Unexpected token type " << tokenString() << " at " << lineNumber(); + } + return result; +} -- cgit v1.3.1