WSL/SLF GitLab Repository

Commit 8db3655b authored by Mathias Bavay's avatar Mathias Bavay
Browse files

More fixes for Qt6 compatibility

parent eab72a11
...@@ -211,7 +211,7 @@ void SectionTab::setSectionDynamic(const QString &section, const QDomNode &node) ...@@ -211,7 +211,7 @@ void SectionTab::setSectionDynamic(const QString &section, const QDomNode &node)
*/ */
bool SectionTab::isDynamicParent(const QString &section) const bool SectionTab::isDynamicParent(const QString &section) const
{ {
const int dyn_idx = dynamic_sections_.indexOf(QRegExp(section, Qt::CaseInsensitive)); const int dyn_idx = dynamic_sections_.indexOf(QRegularExpression(section, QRegularExpression::CaseInsensitiveOption));
return (dyn_idx != -1); return (dyn_idx != -1);
} }
...@@ -288,7 +288,7 @@ QString SectionTab::getParentOf(const QString &section) ...@@ -288,7 +288,7 @@ QString SectionTab::getParentOf(const QString &section)
void SectionTab::spawnDynamicSection(const QString &section, const QString &new_tab_name) void SectionTab::spawnDynamicSection(const QString &section, const QString &new_tab_name)
{ {
int index = getIndex(section, Qt::CaseInsensitive); int index = getIndex(section, Qt::CaseInsensitive);
const int dyn_idx = dynamic_sections_.indexOf(QRegExp(section, Qt::CaseInsensitive)); const int dyn_idx = dynamic_sections_.indexOf(QRegularExpression(section, QRegularExpression::CaseInsensitiveOption));
bool found = false; bool found = false;
for (int ii = index + 1; ii < this->count(); ++ii) { for (int ii = index + 1; ii < this->count(); ++ii) {
......
...@@ -80,7 +80,7 @@ INISyntaxHighlighter::INISyntaxHighlighter(QTextDocument *textdoc) : QSyntaxHigh ...@@ -80,7 +80,7 @@ INISyntaxHighlighter::INISyntaxHighlighter(QTextDocument *textdoc) : QSyntaxHigh
rule.pattern = QRegularExpression("\\" + Cst::section_open + section + "\\" + rule.pattern = QRegularExpression("\\" + Cst::section_open + section + "\\" +
Cst::section_close, QRegularExpression::CaseInsensitiveOption); //TODO: escape only if needed for the set char Cst::section_close, QRegularExpression::CaseInsensitiveOption); //TODO: escape only if needed for the set char
rule.format = format_known_section; rule.format = format_known_section;
if (added_sections_.indexOf(QRegExp(section, Qt::CaseInsensitive)) == -1) { if (added_sections_.indexOf(QRegularExpression(section, QRegularExpression::CaseInsensitiveOption)) == -1) {
rules_.append(rule); rules_.append(rule);
added_sections_.append(section); added_sections_.append(section);
} }
......
...@@ -231,7 +231,7 @@ bool parseAvailableSections(const QDomElement &current_element, const QString &p ...@@ -231,7 +231,7 @@ bool parseAvailableSections(const QDomElement &current_element, const QString &p
} }
} }
if (!parent_section.isNull()) { //not at top level - the parent is fixed if (!parent_section.isNull()) { //not at top level - the parent is fixed
if (!section_list.isEmpty() && (section_list.indexOf(QRegExp(parent_section, Qt::CaseInsensitive)) == -1)) if (!section_list.isEmpty() && (section_list.indexOf(QRegularExpression(parent_section, QRegularExpression::CaseInsensitiveOption)) == -1))
return false; //sections are given, but they don't match the parent return false; //sections are given, but they don't match the parent
section_list.clear(); //don't build multiple times section_list.clear(); //don't build multiple times
section_list.push_back(parent_section); section_list.push_back(parent_section);
......
...@@ -220,7 +220,7 @@ void Checklist::onPropertySet() ...@@ -220,7 +220,7 @@ void Checklist::onPropertySet()
const QString values( this->property("ini_value").toString() ); const QString values( this->property("ini_value").toString() );
if (ini_value_ == values) if (ini_value_ == values)
return; return;
const QStringList value_list( values.split(QRegExp("\\s+"), Qt::SkipEmptyParts) ); const QStringList value_list( values.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts) );
/* clear the list, overwriting current settings */ /* clear the list, overwriting current settings */
for (int ii = 0; ii < list_->count(); ++ii) { for (int ii = 0; ii < list_->count(); ++ii) {
......
...@@ -212,7 +212,7 @@ void Choice::onPropertySet() ...@@ -212,7 +212,7 @@ void Choice::onPropertySet()
const QString values( this->property("ini_value").toString() ); const QString values( this->property("ini_value").toString() );
if (ini_value_ == values) if (ini_value_ == values)
return; return;
const QStringList value_list( values.split(QRegExp("\\s+"), Qt::SkipEmptyParts) ); const QStringList value_list( values.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts) );
if (checkbox_container_->count() == 1) { if (checkbox_container_->count() == 1) {
topLog(QString(tr(R"(XML error: No checkable options set for Choice panel "%1::%2".)").arg( topLog(QString(tr(R"(XML error: No checkable options set for Choice panel "%1::%2".)").arg(
......
...@@ -342,7 +342,7 @@ void Number::setOptions(const QDomNode &options) ...@@ -342,7 +342,7 @@ void Number::setOptions(const QDomNode &options)
*/ */
int Number::getPrecisionOfNumber(const QString &str_number) const int Number::getPrecisionOfNumber(const QString &str_number) const
{ {
const QStringList dec( str_number.split(QRegExp("[,.]")) ); const QStringList dec( str_number.split(QRegularExpression("[,.]")) );
if (dec.size() > 1) //there's a decimal sign if (dec.size() > 1) //there's a decimal sign
return dec.at(1).length(); return dec.at(1).length();
return 0; //integer return 0; //integer
......
...@@ -104,10 +104,10 @@ bool Replicator::canSpawnPanel(const QString &key) ...@@ -104,10 +104,10 @@ bool Replicator::canSpawnPanel(const QString &key)
//freely replicate child items (which do not have to be tied to a Replicator's key). //freely replicate child items (which do not have to be tied to a Replicator's key).
//In this case of a Replicator that is not tied to any INI structure (like a frame), //In this case of a Replicator that is not tied to any INI structure (like a frame),
//we check the list of potential child panels for a matching entry: //we check the list of potential child panels for a matching entry:
ok = child_panel_keys_.indexOf(QRegExp(key_sub, Qt::CaseInsensitive)) != -1; ok = child_panel_keys_.indexOf(QRegularExpression(key_sub, QRegularExpression::CaseInsensitiveOption)) != -1;
if (!ok) { if (!ok) {
const QString key_sub_multi = getRepName(key, false); //TA::FILTER1::ARG1 --> TA::FILTER1::ARG# const QString key_sub_multi = getRepName(key, false); //TA::FILTER1::ARG1 --> TA::FILTER1::ARG#
ok = child_panel_keys_.indexOf(QRegExp(key_sub_multi, Qt::CaseInsensitive)) != -1; ok = child_panel_keys_.indexOf(QRegularExpression(key_sub_multi, QRegularExpression::CaseInsensitiveOption)) != -1;
} }
} }
return ok; //otherwise, the Replicator for sure can not create this panel return ok; //otherwise, the Replicator for sure can not create this panel
......
...@@ -219,8 +219,8 @@ void Textfield::onValidButtonClicked() //for now this button only pops up for co ...@@ -219,8 +219,8 @@ void Textfield::onValidButtonClicked() //for now this button only pops up for co
QString lon( coord_match.captured(idx_lon_dms) ); QString lon( coord_match.captured(idx_lon_dms) );
const QChar latchar = lat.section('d',1,1).toDouble() < 0? 'S' : 'N'; const QChar latchar = lat.section('d',1,1).toDouble() < 0? 'S' : 'N';
const QChar lonchar = lon.section('d',1,1).toDouble() < 0? 'W' : 'E'; const QChar lonchar = lon.section('d',1,1).toDouble() < 0? 'W' : 'E';
lat.remove(QRegExp(" |\"")); lat.replace(QRegExp("d|'"), "_"); lat.remove(QRegularExpression(" |\"")); lat.replace(QRegularExpression("d|'"), "_");
lon.remove(QRegExp(" |\"")); lon.replace(QRegExp("d|'"), "_"); lon.remove(QRegularExpression(" |\"")); lon.replace(QRegularExpression("d|'"), "_");
url += lat + "_" + latchar + "_"; url += lat + "_" + latchar + "_";
url += lon + "_" + lonchar; url += lon + "_" + lonchar;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment