Skip to content

Commit

Permalink
Merge pull request #781 from QuasarApp/task_780
Browse files Browse the repository at this point in the history
Qt 6.6
  • Loading branch information
EndrII authored Nov 5, 2023
2 parents 097d82b + 51b9d75 commit dd027b2
Show file tree
Hide file tree
Showing 28 changed files with 193 additions and 49 deletions.
4 changes: 2 additions & 2 deletions src/Deploy/src/Distributions/deb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ QProcessEnvironment Deb::processEnvirement() const {

QList<SystemCommandData> Deb::runCmd() {
QList<SystemCommandData> res;
for (const auto& inout: qAsConst(inouts)) {
for (const auto& inout: std::as_const(inouts)) {
res.push_back({"dpkg-deb", QStringList{"--build", "--verbose"} << inout.input << inout.output});
}

Expand All @@ -125,7 +125,7 @@ QList<SystemCommandData> Deb::runCmd() {

QStringList Deb::outPutFiles() const {
QStringList result;
for (const auto& inout: qAsConst(inouts)) {
for (const auto& inout: std::as_const(inouts)) {
result.push_back(inout.output);
}
return result;
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/configparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ bool ConfigParser::setTargetsInDir(const QString &dir, bool recursive) {
}

bool result = false;
for (const auto &file : qAsConst(list)) {
for (const auto &file : std::as_const(list)) {

if (file.isDir()) {
result |= setTargetsInDir(file.absoluteFilePath(), recursive);
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/dependenciesscanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res, QSet<QS

libStack.insert(lib.fullPath());

for (const auto &i : qAsConst(lib._dependncies)) {
for (const auto &i : std::as_const(lib._dependncies)) {

auto libs = getLibsFromEnvirement(i);

Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/deploycore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ QFileInfo DeployCore::findItem(const QString &bin) {
auto prefixes = QuasarAppUtils::Params::getArg("binPrefix").
split(DeployCore::getSeparator(0), splitbehavior);

for (const QString& prefix :qAsConst(prefixes)) {
for (const QString& prefix :std::as_const(prefixes)) {
QFileInfo info(prefix + "/" + bin);

if (info.exists()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/elf_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ELF::ELF()
QByteArrayList ELF::getDynamicString(ElfReader& reader) const {
auto headers = reader.readHeaders();

for (const auto &sectionHeader : qAsConst(headers.sectionHeaders)) {
for (const auto &sectionHeader : std::as_const(headers.sectionHeaders)) {
if (sectionHeader.name == ".dynstr") {
auto arr = reader.readSection(sectionHeader.name).split(0);
return arr;
Expand Down
12 changes: 6 additions & 6 deletions src/Deploy/src/extracter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void Extracter::copyExtraPlugins(const QString& package) {
QuasarAppUtils::Warning);
}

for (const auto& plugin : qAsConst(plugins)) {
for (const auto& plugin : std::as_const(plugins)) {
extractPluginLib(plugin, package);
}
}
Expand All @@ -198,7 +198,7 @@ void Extracter::extractPlugins() {
_fileManager->copyFiles(plugins, targetPath + distro.getPluginsOutDir(), 1,
DeployCore::debugExtensions(), &listItems);

for (const auto &item : qAsConst(listItems)) {
for (const auto &item : std::as_const(listItems)) {
extractPluginLib(item, i.key());
}

Expand Down Expand Up @@ -281,7 +281,7 @@ bool Extracter::copyTr() {
if (info.isDir()) {
QDir dir(info.absoluteFilePath());
auto availableQm = dir.entryInfoList({"*.qm"}, QDir::Files);
for (const auto & trFile : qAsConst(availableQm)) {
for (const auto & trFile : std::as_const(availableQm)) {
if (!_fileManager->copyFile(trFile.absoluteFilePath(),
cnf->getPackageTargetDir(i.key()) + i->getTrOutDir())) {
return false;
Expand Down Expand Up @@ -415,7 +415,7 @@ void Extracter::extractLib(const QString &file,
allDependencies = _scaner->scan(file).getAllDep();
}

for (const auto &line : qAsConst(allDependencies)) {
for (const auto &line : std::as_const(allDependencies)) {

if (mask.size() && !line.getName().contains(mask, DeployCore::getCaseSensitivity())) {
continue;
Expand Down Expand Up @@ -500,7 +500,7 @@ bool Extracter::extractQml() {
return false;
}
} else {
for (const auto& plugin: qAsConst(plugins)) {
for (const auto& plugin: std::as_const(plugins)) {
const auto qmlFiles = QDir(plugin).entryInfoList(QDir::Files);
for (const auto& qmlFile: qmlFiles) {
toCopyQmlFiles.push_back(qmlFile.absoluteFilePath());
Expand All @@ -520,7 +520,7 @@ bool Extracter::extractQml() {
}


for (const auto &item : qAsConst(listItems)) {
for (const auto &item : std::as_const(listItems)) {
extractPluginLib(item, i.key());
}

Expand Down
4 changes: 2 additions & 2 deletions src/Deploy/src/filemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ bool FileManager::fileActionPrivate(const QString &file, const QString &target,

bool copy = !masks;
if (masks) {
for (const auto &mask : qAsConst(*masks)) {
for (const auto &mask : std::as_const(*masks)) {
if (info.absoluteFilePath().contains(mask, DeployCore::getCaseSensitivity())) {
copy = true;
break;
Expand Down Expand Up @@ -432,7 +432,7 @@ void FileManager::clear(const QString& targetDir, bool force) {
}

QMultiMap<int, QFileInfo> sortedOldData;
for (const auto& i : qAsConst(_deployedFiles)) {
for (const auto& i : std::as_const(_deployedFiles)) {
sortedOldData.insert(i.size(), QFileInfo(i));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/ignorerule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <quasarapp.h>

bool IgnoreRule::checkOnlytext(const QString &lib) {
for (const auto &ignore : qAsConst(_data)) {
for (const auto &ignore : std::as_const(_data)) {
if (lib.contains(ignore.label)) {
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Deploy/src/packing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bool Packing::create() {
return false;
}

for (auto package : qAsConst(_pakages)) {
for (auto package : std::as_const(_pakages)) {

if (!package) {
internalError();
Expand Down Expand Up @@ -207,7 +207,7 @@ bool Packing::extractTemplates() {
return false;
}

for (auto package : qAsConst(_pakages)) {
for (auto package : std::as_const(_pakages)) {

if (!package)
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/pluginsparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void PluginsParser::addPlugins(const QStringList& list, const QString& package,
QHash<QString, QSet<QString>>& container) {
const DeployConfig* cnf = DeployCore::_config;

for (const auto &plugin: qAsConst(list)) {
for (const auto &plugin: std::as_const(list)) {
if (QFileInfo(cnf->qtDir.getPlugins() + "/" + plugin).isDir()) {
auto listPlugins = QDir(cnf->qtDir.getPlugins() + "/" + plugin).entryInfoList(QDir::Files | QDir::NoDotAndDotDot);

Expand Down
10 changes: 5 additions & 5 deletions src/Deploy/src/qmlqt5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ bool QMLQt5::extractImportsFromDir(const QString &path, bool recursive) {

for (const auto &info: files) {
auto imports = extractImportsFromFile(info.absoluteFilePath());
for (const auto &import : qAsConst(imports)) {
for (const auto &import : std::as_const(imports)) {
if (!_imports.contains(import)) {
_imports.insert(import);
extractImportsFromDir(getPathFromImport(import), recursive);
}
}
}

for (const auto& module: qAsConst(qmlmodule)) {
for (const auto& module: std::as_const(qmlmodule)) {
QStringList imports = extractImportsFromQmlModule(module.absoluteFilePath());

for (const auto &import : qAsConst(imports)) {
for (const auto &import : std::as_const(imports)) {
if (!_imports.contains(import)) {
_imports.insert(import);
extractImportsFromDir(getPathFromImport(import), recursive);
Expand Down Expand Up @@ -155,7 +155,7 @@ bool QMLQt5::deployPath(const QString &path, QStringList &res) {
QDir dir(path);
auto infoList = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs);

for (const auto &info : qAsConst(infoList)) {
for (const auto &info : std::as_const(infoList)) {
if (DeployCore::isDebugFile(info.fileName())) {
QuasarAppUtils::Params::log("Skip debug library " +
info.absoluteFilePath());
Expand Down Expand Up @@ -222,7 +222,7 @@ bool QMLQt5::scan(QStringList &res, const QString& _qmlProjectDir) {
return false;
}

for (const auto &import : qAsConst(_imports)) {
for (const auto &import : std::as_const(_imports)) {
res.push_back(getPathFromImport(import));
}

Expand Down
10 changes: 5 additions & 5 deletions src/Deploy/src/qmlqt6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ bool QMLQt6::extractImportsFromDir(const QString &path, bool recursive) {

for (const auto &info: files) {
auto imports = extractImportsFromFile(info.absoluteFilePath());
for (const auto &import : qAsConst(imports)) {
for (const auto &import : std::as_const(imports)) {
if (!_imports.contains(import)) {
_imports.insert(import);
extractImportsFromDir(getPathFromImport(import), false);
}
}
}

for (const auto& module: qAsConst(qmlmodule)) {
for (const auto& module: std::as_const(qmlmodule)) {
QStringList imports = extractImportsFromQmlModule(module.absoluteFilePath());
imports += extractImportsFromFile(module.absoluteFilePath());

for (const auto &import : qAsConst(imports)) {
for (const auto &import : std::as_const(imports)) {
if (!_imports.contains(import)) {
_imports.insert(import);
extractImportsFromDir(getPathFromImport(import), false);
Expand Down Expand Up @@ -153,7 +153,7 @@ bool QMLQt6::deployPath(const QString &path, QStringList &res) {
QDir dir(path);
auto infoList = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs);

for (const auto &info : qAsConst(infoList)) {
for (const auto &info : std::as_const(infoList)) {
if (DeployCore::isDebugFile(info.fileName())) {
QuasarAppUtils::Params::log("Skip debug library " +
info.absoluteFilePath());
Expand Down Expand Up @@ -218,7 +218,7 @@ bool QMLQt6::scan(QStringList &res, const QString& _qmlProjectDir) {
return false;
}

for (const auto &import : qAsConst(_imports)) {
for (const auto &import : std::as_const(_imports)) {
res.push_back(getPathFromImport(import));
}

Expand Down
2 changes: 1 addition & 1 deletion submodules/QuasarAppLib
Submodule QuasarAppLib updated 5 files
+5 −0 CMakeLists.txt
+101 −25 locales.cpp
+33 −4 locales.h
+18 −16 params.cpp
+4 −1 params.h
2 changes: 1 addition & 1 deletion testcases/quicknanobrowser/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static QUrl startupUrl()
QUrl ret;
QStringList args(qApp->arguments());
args.takeFirst();
for (const QString &arg : qAsConst(args)) {
for (const QString &arg : std::as_const(args)) {
if (arg.startsWith(QLatin1Char('-')))
continue;
ret = Utils::fromUserInput(arg);
Expand Down
92 changes: 92 additions & 0 deletions tests/modules/modulesqt6_6.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright (C) 2023-2023 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/

#include "modulesqt6_6.h"

ModulesQt6_6::ModulesQt6_6()
{

}

QSet<QString> ModulesQt6_6::qmlLibs(const QString &distDir) const {
TestUtils utils;
auto Tree = ModulesQt6_5::qmlLibs(distDir);

#ifdef Q_OS_WIN

#else

#endif

return Tree;
}

QSet<QString> ModulesQt6_6::qmlVirtualKeyBoadrLibs(const QString &distDir) const {

TestUtils utils;

auto Tree = ModulesQt6_5::qmlVirtualKeyBoadrLibs(distDir);
return Tree;
}

QSet<QString> ModulesQt6_6::qtWebEngine(const QString &distDir) const
{
TestUtils utils;

auto Tree = ModulesQt6_5::qtWebEngine(distDir);

#ifdef Q_OS_WIN
Tree += utils.createTree(
{
"./" + distDir + "/resources/v8_context_snapshot.bin"

}
);
#else
Tree += utils.createTree(
{
"./" + distDir + "/resources/v8_context_snapshot.bin",
"./" + distDir + "/lib/libQt6WebChannelQuick.so",
"./" + distDir + "/qml/QtWebChannel/libwebchannelplugin.so",
"./" + distDir + "/qml/QtWebChannel/libwebchannelquickplugin.so",

}
);
#endif

return Tree;
}

QSet<QString> ModulesQt6_6::qtLibs(const QString &distDir) const {
auto Tree = ModulesQt6_5::qtLibs(distDir);
TestUtils utils;


return Tree;
}

QSet<QString> ModulesQt6_6::qtWebEngineWidgets(const QString &distDir) const
{
TestUtils utils;

auto Tree = ModulesQt6_5::qtWebEngineWidgets(distDir);
#ifdef Q_OS_WIN
Tree += utils.createTree(
{
"./" + distDir + "/resources/v8_context_snapshot.bin"

}
);
#else
Tree += utils.createTree(
{
"./" + distDir + "/resources/v8_context_snapshot.bin"
}
);
#endif
return Tree;
}
24 changes: 24 additions & 0 deletions tests/modules/modulesqt6_6.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (C) 2023-2023 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/

#ifndef MODULESQT6_6_H
#define MODULESQT6_6_H

#include "modulesqt6_5.h"

class ModulesQt6_6: public ModulesQt6_5
{
public:
ModulesQt6_6();
QSet<QString> qmlLibs(const QString &distDir = DISTRO_DIR) const override;
QSet<QString> qmlVirtualKeyBoadrLibs(const QString &distDir = DISTRO_DIR) const override;
QSet<QString> qtWebEngine(const QString &distDir = DISTRO_DIR) const override;
QSet<QString> qtWebEngineWidgets(const QString &distDir = DISTRO_DIR) const override;
QSet<QString> qtLibs(const QString &distDir = DISTRO_DIR) const override;
};

#endif // MODULESQT6_5_H
Loading

0 comments on commit dd027b2

Please sign in to comment.