From 1780fb2a237af80ddc1f9cfb70cb892b53b91990 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sun, 2 May 2021 17:50:05 +0200 Subject: Minor code refactoring Some methods in ConfigLoaderHandler always returned true, change them to return void instead. Also port them to take a QStringView instead of QStringRef, this doesn't require a lot of changes because a QStringView can be constructed from a QStringRef. QXmlStreamAttribute methods like value() and name() return QStringRef in Qt5 and QStringView in Qt6, "fix" the issue by using auto keyword, which works in both cases. QStringView::toInt() isn't efficient in Qt5 so make the build conditional. NO_CHANGELOG --- src/gui/kconfigloaderhandler_p.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/gui/kconfigloaderhandler_p.h') diff --git a/src/gui/kconfigloaderhandler_p.h b/src/gui/kconfigloaderhandler_p.h index bc199e0e..297e5462 100644 --- a/src/gui/kconfigloaderhandler_p.h +++ b/src/gui/kconfigloaderhandler_p.h @@ -17,9 +17,8 @@ public: bool parse(QIODevice *input); - bool startElement(const QStringRef &localName, const QXmlStreamAttributes &attrs); - bool endElement(const QStringRef &localName); - bool characters(const QStringRef &ch); + void startElement(const QStringView localName, const QXmlStreamAttributes &attrs); + void endElement(const QStringView localName); private: void addItem(); -- cgit v1.2.1