mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-05-01 14:47:27 +02:00
fix: Deprecated QString::SkipEmptyParts
This commit is contained in:
parent
a5e14a9664
commit
bc40683f2a
@ -1256,7 +1256,11 @@ QString CompilerDriver::formSingleRuleCompileOutput(const QString &generated_cod
|
|||||||
// compilers we assemble here may consist of a bunch of
|
// compilers we assemble here may consist of a bunch of
|
||||||
// empty lines separated by LF. Need to account for that.
|
// empty lines separated by LF. Need to account for that.
|
||||||
QString res = generated_code;
|
QString res = generated_code;
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
QString res2 = res.split("\n", Qt::SkipEmptyParts).join("").replace(" ", "");
|
||||||
|
#else
|
||||||
QString res2 = res.split("\n", QString::SkipEmptyParts).join("").replace(" ", "");
|
QString res2 = res.split("\n", QString::SkipEmptyParts).join("").replace(" ", "");
|
||||||
|
#endif
|
||||||
if (res2.isEmpty()) res = all_errors.join("\n");
|
if (res2.isEmpty()) res = all_errors.join("\n");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -755,9 +755,11 @@ int main(int argc, char * const *argv)
|
|||||||
usage_import();
|
usage_import();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
QStringList components = QString::fromUtf8(object.c_str())
|
QStringList components = QString::fromUtf8(object.c_str()).split("/", Qt::SkipEmptyParts);
|
||||||
.split("/", QString::SkipEmptyParts);
|
#else
|
||||||
|
QStringList components = QString::fromUtf8(object.c_str()).split("/", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
string fw_name = components.last().toUtf8().constData();
|
string fw_name = components.last().toUtf8().constData();
|
||||||
|
|
||||||
Library *library = nullptr;
|
Library *library = nullptr;
|
||||||
|
|||||||
@ -148,8 +148,11 @@ void PFImporter::run()
|
|||||||
*/
|
*/
|
||||||
QString list_str = list_of_items.cap(1);
|
QString list_str = list_of_items.cap(1);
|
||||||
list_str.replace(",", "");
|
list_str.replace(",", "");
|
||||||
QStringList items = list_str.split(QRegExp("\\s"),
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
QString::SkipEmptyParts);
|
QStringList items = list_str.split(QRegExp("\\s"), Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
|
QStringList items = list_str.split(QRegExp("\\s"), QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
qDebug() << items;
|
qDebug() << items;
|
||||||
|
|
||||||
bool has_address = false;
|
bool has_address = false;
|
||||||
|
|||||||
@ -178,7 +178,11 @@ string NATCompiler_ipt::PrintRule::_printRuleLabel(NATRule *rule)
|
|||||||
/* do not put comment in the script if it is intended for linksys */
|
/* do not put comment in the script if it is intended for linksys */
|
||||||
if (!nocomm || compiler->inSingleRuleCompileMode())
|
if (!nocomm || compiler->inSingleRuleCompileMode())
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
QStringList comm = QString(rule->getComment().c_str()).split("\n", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
QStringList comm = QString(rule->getComment().c_str()).split("\n", QString::SkipEmptyParts);
|
QStringList comm = QString(rule->getComment().c_str()).split("\n", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
foreach(QString line, comm)
|
foreach(QString line, comm)
|
||||||
{
|
{
|
||||||
res << "# " << line.toStdString() << endl;
|
res << "# " << line.toStdString() << endl;
|
||||||
|
|||||||
@ -483,7 +483,11 @@ QString OSConfigurator_linux24::addressTableWrapper(FWObject *rule,
|
|||||||
int pos = address_table_re.indexIn(command);
|
int pos = address_table_re.indexIn(command);
|
||||||
if (pos > -1)
|
if (pos > -1)
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
QStringList command_lines = QString(command).split("\n", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
QStringList command_lines = QString(command).split("\n", QString::SkipEmptyParts);
|
QStringList command_lines = QString(command).split("\n", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
if (command_lines.size() > 1)
|
if (command_lines.size() > 1)
|
||||||
{
|
{
|
||||||
command_lines.push_front("{");
|
command_lines.push_front("{");
|
||||||
@ -570,8 +574,11 @@ string OSConfigurator_linux24::printRunTimeWrappers(FWObject *rule,
|
|||||||
|
|
||||||
if (!no_wrapper)
|
if (!no_wrapper)
|
||||||
{
|
{
|
||||||
QStringList command_lines =
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
QString(combined_command).split("\n", QString::SkipEmptyParts);
|
QStringList command_lines = QString(combined_command).split("\n", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
|
QStringList command_lines = QString(combined_command).split("\n", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
if (command_lines.size() > 1)
|
if (command_lines.size() > 1)
|
||||||
{
|
{
|
||||||
command_lines.push_front("{");
|
command_lines.push_front("{");
|
||||||
|
|||||||
@ -203,7 +203,11 @@ string PolicyCompiler_ipt::PrintRule::_printRuleLabel(PolicyRule *rule)
|
|||||||
/* do not put comment in the script if it is intended for linksys */
|
/* do not put comment in the script if it is intended for linksys */
|
||||||
if (!nocomm || compiler->inSingleRuleCompileMode())
|
if (!nocomm || compiler->inSingleRuleCompileMode())
|
||||||
{
|
{
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
QStringList comm = QString(rule->getComment().c_str()).split("\n", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
QStringList comm = QString(rule->getComment().c_str()).split("\n", QString::SkipEmptyParts);
|
QStringList comm = QString(rule->getComment().c_str()).split("\n", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
foreach(QString line, comm)
|
foreach(QString line, comm)
|
||||||
{
|
{
|
||||||
res << "# " << line.toStdString() << endl;
|
res << "# " << line.toStdString() << endl;
|
||||||
|
|||||||
@ -361,8 +361,13 @@ void FirewallInstaller::packSSHArgs(QStringList &args)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!cnf->sshArgs.isEmpty())
|
if (!cnf->sshArgs.isEmpty()) {
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
args += cnf->sshArgs.split(" ", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
args += cnf->sshArgs.split(" ", QString::SkipEmptyParts);
|
args += cnf->sshArgs.split(" ", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (cnf->verbose) args.push_back("-v");
|
if (cnf->verbose) args.push_back("-v");
|
||||||
|
|
||||||
@ -469,8 +474,13 @@ void FirewallInstaller::packSCPArgs(const QString &local_name,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!cnf->scpArgs.isEmpty())
|
if (!cnf->scpArgs.isEmpty()) {
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
args += cnf->scpArgs.split(" ", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
args += cnf->scpArgs.split(" ", QString::SkipEmptyParts);
|
args += cnf->scpArgs.split(" ", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
args.push_back("-q");
|
args.push_back("-q");
|
||||||
|
|
||||||
@ -604,7 +614,11 @@ void FirewallInstaller::executeExternalInstallScript(const QString &command,
|
|||||||
args.push_back(wdir);
|
args.push_back(wdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
args += script_args.trimmed().split(" ", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
args += script_args.trimmed().split(" ", QString::SkipEmptyParts);
|
args += script_args.trimmed().split(" ", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
|
|
||||||
args.push_back(cnf->fwobj->getName().c_str());
|
args.push_back(cnf->fwobj->getName().c_str());
|
||||||
|
|
||||||
|
|||||||
@ -248,11 +248,14 @@ void FirewallInstallerCisco::activatePolicy(const QString&, const QString&)
|
|||||||
|
|
||||||
replaceMacrosInCommand(&post_config);
|
replaceMacrosInCommand(&post_config);
|
||||||
|
|
||||||
ssh_object->loadPreConfigCommands(
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
pre_config.expand().split("\n", QString::SkipEmptyParts) );
|
ssh_object->loadPreConfigCommands( pre_config.expand().split("\n", Qt::SkipEmptyParts) );
|
||||||
|
ssh_object->loadPostConfigCommands( post_config.expand().split("\n", Qt::SkipEmptyParts) );
|
||||||
|
#else
|
||||||
|
ssh_object->loadPreConfigCommands( pre_config.expand().split("\n", QString::SkipEmptyParts) );
|
||||||
|
ssh_object->loadPostConfigCommands( post_config.expand().split("\n", QString::SkipEmptyParts) );
|
||||||
|
#endif
|
||||||
|
|
||||||
ssh_object->loadPostConfigCommands(
|
|
||||||
post_config.expand().split("\n", QString::SkipEmptyParts) );
|
|
||||||
|
|
||||||
Configlet activation(host_os, os_family, "installer_commands_reg_user");
|
Configlet activation(host_os, os_family, "installer_commands_reg_user");
|
||||||
activation.removeComments();
|
activation.removeComments();
|
||||||
@ -271,8 +274,11 @@ void FirewallInstallerCisco::activatePolicy(const QString&, const QString&)
|
|||||||
config_lines.join("\n"));
|
config_lines.join("\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_object->loadActivationCommands(
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
activation.expand().split("\n", QString::SkipEmptyParts) );
|
ssh_object->loadActivationCommands( activation.expand().split("\n", Qt::SkipEmptyParts) );
|
||||||
|
#else
|
||||||
|
ssh_object->loadActivationCommands( activation.expand().split("\n", QString::SkipEmptyParts) );
|
||||||
|
#endif
|
||||||
|
|
||||||
runSSHSession(ssh_object);
|
runSSHSession(ssh_object);
|
||||||
|
|
||||||
|
|||||||
@ -207,11 +207,13 @@ void FirewallInstallerJuniper::activatePolicy(const QString&, const QString&)
|
|||||||
|
|
||||||
replaceMacrosInCommand(&post_config);
|
replaceMacrosInCommand(&post_config);
|
||||||
|
|
||||||
ssh_object->loadPreConfigCommands(
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
pre_config.expand().split("\n", QString::SkipEmptyParts) );
|
ssh_object->loadPreConfigCommands( pre_config.expand().split("\n", Qt::SkipEmptyParts) );
|
||||||
|
ssh_object->loadPostConfigCommands( post_config.expand().split("\n", Qt::SkipEmptyParts) );
|
||||||
ssh_object->loadPostConfigCommands(
|
#else
|
||||||
post_config.expand().split("\n", QString::SkipEmptyParts) );
|
ssh_object->loadPreConfigCommands( pre_config.expand().split("\n", QString::SkipEmptyParts) );
|
||||||
|
ssh_object->loadPostConfigCommands( post_config.expand().split("\n", QString::SkipEmptyParts) );
|
||||||
|
#endif
|
||||||
|
|
||||||
Configlet activation(host_os, os_family, "installer_commands_reg_user");
|
Configlet activation(host_os, os_family, "installer_commands_reg_user");
|
||||||
activation.removeComments();
|
activation.removeComments();
|
||||||
@ -227,8 +229,11 @@ void FirewallInstallerJuniper::activatePolicy(const QString&, const QString&)
|
|||||||
config_lines.join("\n"));
|
config_lines.join("\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_object->loadActivationCommands(
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
activation.expand().split("\n", QString::SkipEmptyParts) );
|
ssh_object->loadActivationCommands( activation.expand().split("\n", Qt::SkipEmptyParts) );
|
||||||
|
#else
|
||||||
|
ssh_object->loadActivationCommands( activation.expand().split("\n", QString::SkipEmptyParts) );
|
||||||
|
#endif
|
||||||
|
|
||||||
runSSHSession(ssh_object);
|
runSSHSession(ssh_object);
|
||||||
|
|
||||||
|
|||||||
@ -206,11 +206,13 @@ void FirewallInstallerProcurve::activatePolicy(const QString&, const QString&)
|
|||||||
|
|
||||||
replaceMacrosInCommand(&post_config);
|
replaceMacrosInCommand(&post_config);
|
||||||
|
|
||||||
ssh_object->loadPreConfigCommands(
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
pre_config.expand().split("\n", QString::SkipEmptyParts) );
|
ssh_object->loadPreConfigCommands( pre_config.expand().split("\n", Qt::SkipEmptyParts) );
|
||||||
|
ssh_object->loadPostConfigCommands( post_config.expand().split("\n", Qt::SkipEmptyParts) );
|
||||||
ssh_object->loadPostConfigCommands(
|
#else
|
||||||
post_config.expand().split("\n", QString::SkipEmptyParts) );
|
ssh_object->loadPreConfigCommands( pre_config.expand().split("\n", QString::SkipEmptyParts) );
|
||||||
|
ssh_object->loadPostConfigCommands( post_config.expand().split("\n", QString::SkipEmptyParts) );
|
||||||
|
#endif
|
||||||
|
|
||||||
Configlet activation(host_os, os_family, "installer_commands_reg_user");
|
Configlet activation(host_os, os_family, "installer_commands_reg_user");
|
||||||
activation.removeComments();
|
activation.removeComments();
|
||||||
@ -226,8 +228,13 @@ void FirewallInstallerProcurve::activatePolicy(const QString&, const QString&)
|
|||||||
config_lines.join("\n"));
|
config_lines.join("\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
ssh_object->loadActivationCommands(
|
||||||
|
activation.expand().split("\n", Qt::SkipEmptyParts) );
|
||||||
|
#else
|
||||||
ssh_object->loadActivationCommands(
|
ssh_object->loadActivationCommands(
|
||||||
activation.expand().split("\n", QString::SkipEmptyParts) );
|
activation.expand().split("\n", QString::SkipEmptyParts) );
|
||||||
|
#endif
|
||||||
|
|
||||||
runSSHSession(ssh_object);
|
runSSHSession(ssh_object);
|
||||||
|
|
||||||
|
|||||||
@ -996,7 +996,11 @@ static bool filterMatchesCommand(const QString &text,
|
|||||||
QRegExp rx("(?:(port)|(ip)):(.*)", Qt::CaseInsensitive);
|
QRegExp rx("(?:(port)|(ip)):(.*)", Qt::CaseInsensitive);
|
||||||
if (!rx.exactMatch(text)) return false;
|
if (!rx.exactMatch(text)) return false;
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
QStringList args = rx.cap(3).split(",", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
QStringList args = rx.cap(3).split(",", QString::SkipEmptyParts);
|
QStringList args = rx.cap(3).split(",", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (rx.pos(1) != -1)
|
if (rx.pos(1) != -1)
|
||||||
return (filterMatchesPortRange(args, item->getFWObject()));
|
return (filterMatchesPortRange(args, item->getFWObject()));
|
||||||
|
|||||||
@ -565,7 +565,11 @@ void SSHSession::readFromStdout()
|
|||||||
QString lastLine = "";
|
QString lastLine = "";
|
||||||
|
|
||||||
// split on LF
|
// split on LF
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
QStringList bufLines = buf.split("\n", Qt::KeepEmptyParts);
|
||||||
|
#else
|
||||||
QStringList bufLines = buf.split("\n", QString::KeepEmptyParts);
|
QStringList bufLines = buf.split("\n", QString::KeepEmptyParts);
|
||||||
|
#endif
|
||||||
|
|
||||||
// if buf ends with a LF character, the last element in the list is
|
// if buf ends with a LF character, the last element in the list is
|
||||||
// an empty string
|
// an empty string
|
||||||
|
|||||||
@ -210,7 +210,12 @@ Can't compile firewall policy."),
|
|||||||
args.push_back(compiler.c_str());
|
args.push_back(compiler.c_str());
|
||||||
|
|
||||||
QString qs = fwopt->getStr("cmdline").c_str();
|
QString qs = fwopt->getStr("cmdline").c_str();
|
||||||
|
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
|
args += qs.split(" ", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
args += qs.split(" ", QString::SkipEmptyParts);
|
args += qs.split(" ", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
|
|
||||||
args.push_back("-v");
|
args.push_back("-v");
|
||||||
args.push_back("-f");
|
args.push_back("-f");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user