replaced obsolete QXmlDefaultHandler by QXmlStreamReader in PChangeDefaultPathsDialog.

This commit is contained in:
2020-06-18 20:44:08 +02:00
parent 35760525bb
commit 8ecac5fd57
2 changed files with 86 additions and 94 deletions

View File

@@ -32,36 +32,36 @@
#include <QDialog>
#include <QMessageBox>
#include <QtXml>
#include <QXmlStreamReader>
#include <QIODevice>
#include "ui_PChangeDefaultPathsDialog.h"
class PDefaultPaths;
//---------------------------------------------------------------------------
class PDefaultPathsXMLParser : public QXmlDefaultHandler
class PDefaultPathsXMLParser
{
public:
PDefaultPathsXMLParser(PDefaultPaths *defaultPaths);
PDefaultPathsXMLParser(const QString &fln, PDefaultPaths *defaultPaths);
virtual ~PDefaultPathsXMLParser() {}
virtual bool isValid() { return fValid; }
private:
enum EAdminKeyWords {eEmpty, eDataPath};
bool parse(QIODevice *device);
bool startDocument();
bool startElement( const QString&, const QString&, const QString& ,
const QXmlAttributes& );
bool endElement( const QString&, const QString&, const QString& );
bool characters(const QString&);
bool startElement();
bool endElement();
bool characters();
bool endDocument();
bool warning( const QXmlParseException & exception );
bool error( const QXmlParseException & exception );
bool fatalError( const QXmlParseException & exception );
EAdminKeyWords fKeyWord; ///< key word tag to know how to handle the content
PDefaultPaths *fDefaultPaths; ///< keeps the default search paths for the data files
QXmlStreamReader fXml; ///< xml stream reader object
bool fValid; ///< flag showing if XML read has been successful
EAdminKeyWords fKeyWord; ///< key word tag to know how to handle the content
PDefaultPaths *fDefaultPaths; ///< keeps the default search paths for the data files
};
//---------------------------------------------------------------------------