Commit 3b036b53 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

QRegExp + QStringLiteral crash see...

QRegExp + QStringLiteral crash see https://blogs.kde.org/2015/11/05/qregexp-qstringliteral-crash-exit

Revert it until I port all to QRegularExpression
parent 36f1cc49
......@@ -58,7 +58,7 @@ QString AlarmTime::alarmTimeText(const DateTime& dateTime)
if (QApplication::isLeftToRight()) // don't try to align right-to-left languages
{
QString fmt = locale->timeFormat();
int i = fmt.indexOf(QRegExp(QStringLiteral("%[kl]"))); // check if leading zeroes are omitted
int i = fmt.indexOf(QRegExp(QLatin1String("%[kl]"))); // check if leading zeroes are omitted
if (i >= 0 && i == fmt.indexOf(QLatin1Char('%'))) // and whether the hour is first
mTimeHourPos = i; // yes, so need to align
}
......
......@@ -605,7 +605,7 @@ bool CollectionView::viewportEvent(QEvent* e)
int i = toolTip.indexOf(QLatin1Char('@'));
if (i > 0)
{
int j = toolTip.indexOf(QRegExp(QStringLiteral("<(nl|br)"), Qt::CaseInsensitive), i + 1);
int j = toolTip.indexOf(QRegExp(QLatin1String("<(nl|br)"), Qt::CaseInsensitive), i + 1);
int k = toolTip.indexOf(QLatin1Char('@'), j);
const QString name = toolTip.mid(i + 1, j - i - 1);
value = model()->data(index, Qt::FontRole);
......
......@@ -1734,7 +1734,7 @@ QString pathOrUrl(const QString& url)
QString browseFile(const QString& caption, QString& defaultDir, const QString& initialFile,
const QString& filter, KFile::Modes mode, QWidget* parent)
{
QString initialDir = !initialFile.isEmpty() ? QString(initialFile).remove(QRegExp(QStringLiteral("/[^/]*$")))
QString initialDir = !initialFile.isEmpty() ? QString(initialFile).remove(QRegExp(QLatin1String("/[^/]*$")))
: !defaultDir.isEmpty() ? defaultDir
: QDir::homePath();
// Use AutoQPointer to guard against crash on application exit while
......
......@@ -181,7 +181,7 @@ void LineEdit::dropEvent(QDropEvent* e)
{
// Remove newlines from a list of email addresses, and allow an eventual mailto: scheme
QString mailto = QStringLiteral("mailto:");
newEmails = txt.split(QRegExp(QStringLiteral("[\r\n]+")), QString::SkipEmptyParts);
newEmails = txt.split(QRegExp(QLatin1String("[\r\n]+")), QString::SkipEmptyParts);
for (QStringList::Iterator it = newEmails.begin(); it != newEmails.end(); ++it)
{
if ((*it).startsWith(mailto))
......
Markdown is supported
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