Changeset View
Changeset View
Standalone View
Standalone View
src/main/startup/KexiWelcomeStatusBar.cpp
Context not available. | |||||
55 | #include <QFontDatabase> | 55 | #include <QFontDatabase> | ||
---|---|---|---|---|---|
56 | #include <QAction> | 56 | #include <QAction> | ||
57 | #include <QLocale> | 57 | #include <QLocale> | ||
58 | #include <QRegularExpression> | ||||
58 | 59 | | |||
59 | #include <stdio.h> | 60 | #include <stdio.h> | ||
60 | 61 | | |||
Context not available. | |||||
185 | << "in line" << i+1 << "- no files will be updated"; | 186 | << "in line" << i+1 << "- no files will be updated"; | ||
186 | return; | 187 | return; | ||
187 | } | 188 | } | ||
188 | if (remoteFname.contains(QRegExp("\\s"))) { | 189 | if (remoteFname.contains(QRegularExpression("\\s"))) { | ||
189 | qWarning() << "Filename expected without whitespace but found" << remoteFname | 190 | qWarning() << "Filename expected without whitespace but found" << remoteFname | ||
190 | << "in line" << i+1 << "- no files will be updated"; | 191 | << "in line" << i+1 << "- no files will be updated"; | ||
191 | return; | 192 | return; | ||
Context not available. | |||||
315 | 316 | | |||
316 | foreach(QLabel* lbl, widget()->findChildren<QLabel*>()) { | 317 | foreach(QLabel* lbl, widget()->findChildren<QLabel*>()) { | ||
317 | QString t = lbl->text(); | 318 | QString t = lbl->text(); | ||
318 | QRegExp re("<a.*>"); | 319 | QRegularExpression re("<a.*>", QRegularExpression::InvertedGreedinessOption); | ||
319 | re.setMinimal(true); | | |||
320 | int pos = 0; | 320 | int pos = 0; | ||
321 | int oldPos = 0; | 321 | int oldPos = 0; | ||
322 | QString newText; | 322 | QString newText; | ||
323 | QRegularExpressionMatch match = re.match(t); | ||||
323 | //qDebug() << "t:" << t; | 324 | //qDebug() << "t:" << t; | ||
324 | while ((pos = re.indexIn(t, pos)) != -1) { | 325 | while ((pos = match.capturedStart(pos)) != -1) { | ||
325 | //qDebug() << "pos:" << pos; | 326 | //qDebug() << "pos:" << pos; | ||
326 | //qDebug() << "newText += t.mid(oldPos, pos - oldPos)" | 327 | //qDebug() << "newText += t.mid(oldPos, pos - oldPos)" | ||
327 | // << t.mid(oldPos, pos - oldPos); | 328 | // << t.mid(oldPos, pos - oldPos); | ||
328 | newText += t.mid(oldPos, pos - oldPos); | 329 | newText += t.mid(oldPos, pos - oldPos); | ||
329 | //qDebug() << "newText1:" << newText; | 330 | //qDebug() << "newText1:" << newText; | ||
330 | //qDebug() << lbl->objectName() << "~~~~" << t.mid(pos, re.matchedLength()); | 331 | //qDebug() << lbl->objectName() << "~~~~" << t.mid(pos, re.matchedLength()); | ||
331 | QString a = t.mid(pos, re.matchedLength()); | 332 | QString a = t.mid(pos, match.capturedLength()); | ||
332 | //qDebug() << "a:" << a; | 333 | //qDebug() << "a:" << a; | ||
333 | int colPos = a.indexOf("color:"); | 334 | int colPos = a.indexOf("color:"); | ||
334 | if (colPos == -1) { // add color | 335 | if (colPos == -1) { // add color | ||
Context not available. | |||||
352 | //qDebug() << "a2:" << a; | 353 | //qDebug() << "a2:" << a; | ||
353 | newText += a; | 354 | newText += a; | ||
354 | //qDebug() << "newText2:" << newText; | 355 | //qDebug() << "newText2:" << newText; | ||
355 | pos += re.matchedLength(); | 356 | pos += match.capturedLength(); | ||
356 | oldPos = pos; | 357 | oldPos = pos; | ||
357 | //qDebug() << "pos2:" << pos; | 358 | //qDebug() << "pos2:" << pos; | ||
358 | } | 359 | } | ||
Context not available. |