5.12 compatibility fix

This commit is contained in:
Roy Qu 2022-07-24 03:19:11 +00:00
parent f0d2bf29a5
commit d034089214
9 changed files with 39 additions and 38 deletions

View File

@ -2518,7 +2518,7 @@ void MemoryModel::updateMemory(const QStringList &value)
QList<PMemoryLine> newModel;
for (int i=0;i<value.length();i++) {
QString line = value[i].trimmed();
#if QT_VERSION_CHECK(5, 15, 0)
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
QStringList dataLst = line.split(delimiter,Qt::SkipEmptyParts);
#else
QStringList dataLst = line.split(delimiter,QString::SkipEmptyParts);

View File

@ -208,7 +208,7 @@ void CppPreprocessor::dumpDefinesTo(const QString &fileName) const
stream<<QString("%1 %2 %3 %4 %5\n")
.arg(define->name,define->args,define->value)
.arg(define->hardCoded).arg(define->formatValue)
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
@ -224,69 +224,69 @@ void CppPreprocessor::dumpIncludesListTo(const QString &fileName) const
QTextStream stream(&file);
for (const PFileIncludes& fileIncludes:mIncludesList) {
stream<<fileIncludes->baseFile<<" : "
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
stream<<"\t**includes:**"
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
foreach (const QString& s,fileIncludes->includeFiles.keys()) {
stream<<"\t--"+s
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
}
stream<<"\t**depends on:**"
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
foreach (const QString& s,fileIncludes->dependingFiles) {
stream<<"\t^^"+s
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
}
stream<<"\t**depended by:**"
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
foreach (const QString& s,fileIncludes->dependedFiles) {
stream<<"\t&&"+s
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
}
stream<<"\t**using:**"
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
foreach (const QString& s,fileIncludes->usings) {
stream<<"\t++"+s
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
}
stream<<"\t**statements:**"
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
@ -295,7 +295,7 @@ void CppPreprocessor::dumpIncludesListTo(const QString &fileName) const
if (statement) {
stream<<QString("\t**%1 , %2")
.arg(statement->command,statement->fullName)
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;

View File

@ -68,7 +68,7 @@ void CppTokenizer::dumpTokens(const QString &fileName)
QTextStream stream(&file);
foreach (const PToken& token,mTokenList) {
stream<<QString("%1,%2").arg(token->line).arg(token->text)
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;

View File

@ -147,7 +147,7 @@ void StatementModel::dumpStatementMap(StatementMap &map, QTextStream &out, int l
.arg(statement->definitionFileName)
.arg(statement->definitionLine);
out
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
@ -155,14 +155,14 @@ void StatementModel::dumpStatementMap(StatementMap &map, QTextStream &out, int l
if (statement->children.isEmpty())
continue;
out<<indent<<statement->command<<" {"
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
#endif
dumpStatementMap(statement->children,out,level+1);
out<<indent<<"}"
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;

View File

@ -1301,7 +1301,7 @@ void Project::checkProjectFileForUpdate(SimpleIni &ini)
QFile::copy(mFilename,mFilename+".bak");
QStringList sl;
sl = oldRes.split(';',
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
@ -1542,7 +1542,7 @@ void Project::loadLayout()
//TopRight := layIni.ReadInteger('Editors', 'FocusedRight', -1);
QString temp =layIni.GetValue("Editors","Order", "");
QStringList sl = temp.split(",",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
@ -1589,28 +1589,28 @@ void Project::loadOptions(SimpleIni& ini)
mOptions.cppCompilerCmd = fromByteArray(ini.GetValue("Project", "CppCompiler", ""));
mOptions.linkerCmd = fromByteArray(ini.GetValue("Project", "Linker", ""));
mOptions.objFiles = fromByteArray(ini.GetValue("Project", "ObjFiles", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
mOptions.binDirs = fromByteArray(ini.GetValue("Project", "Bins", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
mOptions.libDirs = fromByteArray(ini.GetValue("Project", "Libs", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
mOptions.includeDirs = fromByteArray(ini.GetValue("Project", "Includes", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
@ -1618,14 +1618,14 @@ void Project::loadOptions(SimpleIni& ini)
);
mOptions.privateResource = fromByteArray(ini.GetValue("Project", "PrivateResource", ""));
mOptions.resourceIncludes = fromByteArray(ini.GetValue("Project", "ResourceIncludes", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
mOptions.makeIncludes = fromByteArray(ini.GetValue("Project", "MakeIncludes", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
@ -1645,7 +1645,7 @@ void Project::loadOptions(SimpleIni& ini)
mOptions.precompiledHeader = fromByteArray(ini.GetValue("Project", "PrecompiledHeader", ""));
mOptions.cmdLineArgs = fromByteArray(ini.GetValue("Project", "CommandLine", ""));
mFolders = fromByteArray(ini.GetValue("Project", "Folders", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
@ -1751,21 +1751,21 @@ void Project::loadOptions(SimpleIni& ini)
mOptions.privateResource = fromByteArray(ini.GetValue("Project", "PrivateResource", ""));
mOptions.resourceIncludes = fromByteArray(ini.GetValue("Project", "ResourceIncludes", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
mOptions.objFiles = fromByteArray(ini.GetValue("Project", "ObjFiles", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
mOptions.includeDirs = fromByteArray(ini.GetValue("Project", "IncludeDirs", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts

View File

@ -130,21 +130,21 @@ void ProjectTemplate::readTemplateFile(const QString &fileName)
mOptions.icon = mIni->GetValue("Project", "Icon", "");
mOptions.type = static_cast<ProjectType>(mIni->GetLongValue("Project", "Type", 0)); // default = gui
mOptions.objFiles = fromByteArray(mIni->GetValue("Project", "ObjFiles", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
mOptions.includeDirs = fromByteArray(mIni->GetValue("Project", "Includes", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
#endif
);
mOptions.binDirs = fromByteArray(mIni->GetValue("Project", "Bins", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
@ -152,7 +152,7 @@ void ProjectTemplate::readTemplateFile(const QString &fileName)
);
mOptions.libDirs = fromByteArray(mIni->GetValue("Project", "Libs", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts
@ -160,7 +160,7 @@ void ProjectTemplate::readTemplateFile(const QString &fileName)
);
mOptions.resourceIncludes = fromByteArray(mIni->GetValue("Project", "ResourceIncludes", "")).split(";",
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
Qt::SkipEmptyParts
#else
QString::SkipEmptyParts

View File

@ -105,7 +105,7 @@ void ProjectGeneralWidget::doSave()
project->options().isCpp = ui->cbDefaultCpp->isChecked();
project->options().supportXPThemes = ui->cbSupportXPTheme->isChecked();
if (mIconPath.isEmpty()
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
|| !ui->lbIcon->pixmap(Qt::ReturnByValue).isNull()) {
#else
|| !ui->lbIcon->pixmap() || ui->lbIcon->pixmap()->isNull()) {
@ -124,7 +124,7 @@ void ProjectGeneralWidget::doSave()
}
}
if (!mIconPath.endsWith(".ico",PATH_SENSITIVITY) && QImageWriter::supportedImageFormats().contains("ico")) {
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
ui->lbIcon->pixmap(Qt::ReturnByValue).save(iconPath,"ico");
#else
ui->lbIcon->pixmap()->save(iconPath,"ico");

View File

@ -610,7 +610,7 @@ void stringsToFile(const QStringList &list, const QString &fileName)
QTextStream stream(&file);
for (QString s:list) {
stream<<s
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;
@ -722,7 +722,7 @@ void logToFile(const QString &s, const QString &filename, bool append)
if (file.open(mode)) {
QTextStream ts(&file);
ts<<s
#if QT_VERSION_CHECK(5,15,0)
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
<<Qt::endl;
#else
<<endl;

View File

@ -5,6 +5,7 @@ Maintainer: royqh1979@gmail.com
Build-Depends: debhelper (>= 12~),
qtbase5-dev,
qtbase5-dev-tools,
qttools5-dev-tools,
libicu-dev,
libqt5svg5-dev
Standards-Version: 4.3.0