mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Mod some qWarning add QObject::tr
This commit is contained in:
@@ -245,7 +245,7 @@ void ElementsLocation::setPath(const QString &path)
|
|||||||
("^project(?<project_id>[0-9])\\+(?<collection_path>embed://*.*)$");
|
("^project(?<project_id>[0-9])\\+(?<collection_path>embed://*.*)$");
|
||||||
if (!re.isValid())
|
if (!re.isValid())
|
||||||
{
|
{
|
||||||
qWarning() <<"this is an error in the code"
|
qWarning() <<QObject::tr("this is an error in the code")
|
||||||
<< re.errorString()
|
<< re.errorString()
|
||||||
<< re.patternErrorOffset();
|
<< re.patternErrorOffset();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -344,6 +344,12 @@ void SearchAndReplaceWorker::replaceAdvanced(
|
|||||||
for (IndependentTextItem *text : texts)
|
for (IndependentTextItem *text : texts)
|
||||||
{
|
{
|
||||||
QRegularExpression rx(m_advanced_struct.search);
|
QRegularExpression rx(m_advanced_struct.search);
|
||||||
|
if (!rx.isValid())
|
||||||
|
{
|
||||||
|
qWarning() <<QObject::tr("this is an error in the code")
|
||||||
|
<< rx.errorString()
|
||||||
|
<< rx.patternErrorOffset();
|
||||||
|
}
|
||||||
QString replace = m_advanced_struct.replace;
|
QString replace = m_advanced_struct.replace;
|
||||||
QString after = text->toPlainText();
|
QString after = text->toPlainText();
|
||||||
after = after.replace(rx, replace);
|
after = after.replace(rx, replace);
|
||||||
@@ -461,6 +467,12 @@ TitleBlockProperties SearchAndReplaceWorker::replaceAdvanced(Diagram *diagram)
|
|||||||
if (m_advanced_struct.who == 0)
|
if (m_advanced_struct.who == 0)
|
||||||
{
|
{
|
||||||
QRegularExpression rx(m_advanced_struct.search);
|
QRegularExpression rx(m_advanced_struct.search);
|
||||||
|
if (!rx.isValid())
|
||||||
|
{
|
||||||
|
qWarning() <<QObject::tr("this is an error in the code")
|
||||||
|
<< rx.errorString()
|
||||||
|
<< rx.patternErrorOffset();
|
||||||
|
}
|
||||||
QString replace = m_advanced_struct.replace;
|
QString replace = m_advanced_struct.replace;
|
||||||
QString what = m_advanced_struct.what;
|
QString what = m_advanced_struct.what;
|
||||||
if (what == "title") {p.title = p.title.replace(rx, replace);}
|
if (what == "title") {p.title = p.title.replace(rx, replace);}
|
||||||
@@ -490,6 +502,12 @@ DiagramContext SearchAndReplaceWorker::replaceAdvanced(Element *element)
|
|||||||
if (context.contains(what))
|
if (context.contains(what))
|
||||||
{
|
{
|
||||||
QRegularExpression rx(m_advanced_struct.search);
|
QRegularExpression rx(m_advanced_struct.search);
|
||||||
|
if (!rx.isValid())
|
||||||
|
{
|
||||||
|
qWarning() <<QObject::tr("this is an error in the code")
|
||||||
|
<< rx.errorString()
|
||||||
|
<< rx.patternErrorOffset();
|
||||||
|
}
|
||||||
QString replace = m_advanced_struct.replace;
|
QString replace = m_advanced_struct.replace;
|
||||||
QString value = context[what].toString();
|
QString value = context[what].toString();
|
||||||
context.addValue(what, value.replace(rx, replace));
|
context.addValue(what, value.replace(rx, replace));
|
||||||
@@ -513,6 +531,12 @@ ConductorProperties SearchAndReplaceWorker::replaceAdvanced(
|
|||||||
if (m_advanced_struct.who == 2)
|
if (m_advanced_struct.who == 2)
|
||||||
{
|
{
|
||||||
QRegularExpression rx(m_advanced_struct.search);
|
QRegularExpression rx(m_advanced_struct.search);
|
||||||
|
if (!rx.isValid())
|
||||||
|
{
|
||||||
|
qWarning() <<QObject::tr("this is an error in the code")
|
||||||
|
<< rx.errorString()
|
||||||
|
<< rx.patternErrorOffset();
|
||||||
|
}
|
||||||
QString what = m_advanced_struct.what;
|
QString what = m_advanced_struct.what;
|
||||||
QString replace = m_advanced_struct.replace;
|
QString replace = m_advanced_struct.replace;
|
||||||
|
|
||||||
|
|||||||
@@ -407,6 +407,13 @@ void SearchAndReplaceWidget::search()
|
|||||||
{
|
{
|
||||||
//entire word
|
//entire word
|
||||||
QRegularExpression rx("\\b" + str + "\\b");
|
QRegularExpression rx("\\b" + str + "\\b");
|
||||||
|
if (!rx.isValid())
|
||||||
|
{
|
||||||
|
qWarning() <<QObject::tr("this is an error in the code")
|
||||||
|
<< rx.errorString()
|
||||||
|
<< rx.patternErrorOffset();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!ui->m_case_sensitive_cb->isChecked()) {
|
if (!ui->m_case_sensitive_cb->isChecked()) {
|
||||||
rx.setPatternOptions(
|
rx.setPatternOptions(
|
||||||
QRegularExpression::CaseInsensitiveOption);
|
QRegularExpression::CaseInsensitiveOption);
|
||||||
|
|||||||
@@ -574,7 +574,7 @@ void ElementPictureFactory::setPainterStyle(const QDomElement &dom, QPainter &pa
|
|||||||
QRegularExpression rx("^(?<name>[a-z-]+):(?<value>[a-z-]+)$");
|
QRegularExpression rx("^(?<name>[a-z-]+):(?<value>[a-z-]+)$");
|
||||||
if (!rx.isValid())
|
if (!rx.isValid())
|
||||||
{
|
{
|
||||||
qWarning() <<"this is an error in the code"
|
qWarning() <<QObject::tr("this is an error in the code")
|
||||||
<< rx.errorString()
|
<< rx.errorString()
|
||||||
<< rx.patternErrorOffset();
|
<< rx.patternErrorOffset();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2109,7 +2109,7 @@ int QETApp::projectIdFromString(const QString &url) {
|
|||||||
QRegularExpression::CaseInsensitiveOption);
|
QRegularExpression::CaseInsensitiveOption);
|
||||||
if (!embedded.isValid())
|
if (!embedded.isValid())
|
||||||
{
|
{
|
||||||
qWarning() <<"this is an error in the code"
|
qWarning() <<QObject::tr("this is an error in the code")
|
||||||
<< embedded.errorString()
|
<< embedded.errorString()
|
||||||
<< embedded.patternErrorOffset();
|
<< embedded.patternErrorOffset();
|
||||||
return(-1);
|
return(-1);
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ void TitleBlockTemplateLocation::fromString(const QString &loc_str)
|
|||||||
QRegularExpression name_from_url("//*(?<name>.*)");
|
QRegularExpression name_from_url("//*(?<name>.*)");
|
||||||
if (!name_from_url.isValid())
|
if (!name_from_url.isValid())
|
||||||
{
|
{
|
||||||
qWarning() <<"this is an error in the code"
|
qWarning() <<QObject::tr("this is an error in the code")
|
||||||
<< name_from_url.errorString()
|
<< name_from_url.errorString()
|
||||||
<< name_from_url.patternErrorOffset();
|
<< name_from_url.patternErrorOffset();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user