Reduce usage of app_version header

Most information is available via Q(Core|Gui)Application.
Add an AppInfo structure for the things that are not.

This avoids that the information ends up duplicated and
hardcoded in the plugins, which is not needed or desired.

Change-Id: I4d565e75c42a7b8facafa90c27096ea49359215d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Eike Ziller
2023-06-21 15:12:46 +02:00
parent 27302694ab
commit dff9e1463b
96 changed files with 375 additions and 384 deletions

View File

@@ -13,8 +13,6 @@
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <app/app_version.h>
using namespace ScxmlEditor::PluginInterface;
ScxmlDocument::ScxmlDocument(const QString &fileName, QObject *parent)
@@ -62,7 +60,7 @@ void ScxmlDocument::clear(bool createRoot)
if (createRoot) {
pushRootTag(createScxmlTag());
rootTag()->setAttribute("qt:editorversion", QLatin1String(Core::Constants::IDE_VERSION_LONG));
rootTag()->setAttribute("qt:editorversion", QCoreApplication::applicationVersion());
auto ns = new ScxmlNamespace("qt", "http://www.qt.io/2015/02/scxml-ext");
ns->setTagVisibility("editorInfo", false);
@@ -207,7 +205,7 @@ bool ScxmlDocument::load(QIODevice *io)
// Check editorversion
m_hasLayouted = rootTag()->hasAttribute("qt:editorversion");
rootTag()->setAttribute("qt:editorversion", QLatin1String(Core::Constants::IDE_VERSION_LONG));
rootTag()->setAttribute("qt:editorversion", QCoreApplication::applicationVersion());
}
}
@@ -363,7 +361,7 @@ void ScxmlDocument::load(const QString &fileName)
// If loading doesn't work, create root tag here
if (m_rootTags.isEmpty()) {
pushRootTag(createScxmlTag());
rootTag()->setAttribute("qt:editorversion", QLatin1String(Core::Constants::IDE_VERSION_LONG));
rootTag()->setAttribute("qt:editorversion", QCoreApplication::applicationVersion());
}
auto ns = new ScxmlNamespace("qt", "http://www.qt.io/2015/02/scxml-ext");