mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +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://*.*)$");
|
||||
if (!re.isValid())
|
||||
{
|
||||
qWarning() <<"this is an error in the code"
|
||||
qWarning() <<QObject::tr("this is an error in the code")
|
||||
<< re.errorString()
|
||||
<< re.patternErrorOffset();
|
||||
return;
|
||||
|
||||
@@ -344,6 +344,12 @@ void SearchAndReplaceWorker::replaceAdvanced(
|
||||
for (IndependentTextItem *text : texts)
|
||||
{
|
||||
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 after = text->toPlainText();
|
||||
after = after.replace(rx, replace);
|
||||
@@ -461,6 +467,12 @@ TitleBlockProperties SearchAndReplaceWorker::replaceAdvanced(Diagram *diagram)
|
||||
if (m_advanced_struct.who == 0)
|
||||
{
|
||||
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 what = m_advanced_struct.what;
|
||||
if (what == "title") {p.title = p.title.replace(rx, replace);}
|
||||
@@ -490,6 +502,12 @@ DiagramContext SearchAndReplaceWorker::replaceAdvanced(Element *element)
|
||||
if (context.contains(what))
|
||||
{
|
||||
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 value = context[what].toString();
|
||||
context.addValue(what, value.replace(rx, replace));
|
||||
@@ -513,6 +531,12 @@ ConductorProperties SearchAndReplaceWorker::replaceAdvanced(
|
||||
if (m_advanced_struct.who == 2)
|
||||
{
|
||||
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 replace = m_advanced_struct.replace;
|
||||
|
||||
|
||||
@@ -407,6 +407,13 @@ void SearchAndReplaceWidget::search()
|
||||
{
|
||||
//entire word
|
||||
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()) {
|
||||
rx.setPatternOptions(
|
||||
QRegularExpression::CaseInsensitiveOption);
|
||||
|
||||
@@ -574,7 +574,7 @@ void ElementPictureFactory::setPainterStyle(const QDomElement &dom, QPainter &pa
|
||||
QRegularExpression rx("^(?<name>[a-z-]+):(?<value>[a-z-]+)$");
|
||||
if (!rx.isValid())
|
||||
{
|
||||
qWarning() <<"this is an error in the code"
|
||||
qWarning() <<QObject::tr("this is an error in the code")
|
||||
<< rx.errorString()
|
||||
<< rx.patternErrorOffset();
|
||||
return;
|
||||
|
||||
@@ -2109,7 +2109,7 @@ int QETApp::projectIdFromString(const QString &url) {
|
||||
QRegularExpression::CaseInsensitiveOption);
|
||||
if (!embedded.isValid())
|
||||
{
|
||||
qWarning() <<"this is an error in the code"
|
||||
qWarning() <<QObject::tr("this is an error in the code")
|
||||
<< embedded.errorString()
|
||||
<< embedded.patternErrorOffset();
|
||||
return(-1);
|
||||
|
||||
@@ -104,7 +104,7 @@ void TitleBlockTemplateLocation::fromString(const QString &loc_str)
|
||||
QRegularExpression name_from_url("//*(?<name>.*)");
|
||||
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.patternErrorOffset();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user