forked from qt-creator/qt-creator
add ProStringList::join(ProString) overload and make use of it
Change-Id: Ic3919a1fa9419bbb3b57dd1aa7eb95643ee59e53 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from qtbase/e45a9fe457a4e5e70bf4e62092b253675dc97819) Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
@@ -362,6 +362,11 @@ static QString ProStringList_join(const ProStringList &this_, const QChar *sep,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ProStringList::join(const ProString &sep) const
|
||||||
|
{
|
||||||
|
return ProStringList_join(*this, sep.constData(), sep.size());
|
||||||
|
}
|
||||||
|
|
||||||
QString ProStringList::join(const QString &sep) const
|
QString ProStringList::join(const QString &sep) const
|
||||||
{
|
{
|
||||||
return ProStringList_join(*this, sep.constData(), sep.size());
|
return ProStringList_join(*this, sep.constData(), sep.size());
|
||||||
|
@@ -229,6 +229,7 @@ public:
|
|||||||
|
|
||||||
int length() const { return size(); }
|
int length() const { return size(); }
|
||||||
|
|
||||||
|
QString join(const ProString &sep) const;
|
||||||
QString join(const QString &sep) const;
|
QString join(const QString &sep) const;
|
||||||
QString join(QChar sep) const;
|
QString join(QChar sep) const;
|
||||||
|
|
||||||
|
@@ -602,10 +602,9 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
if (args.count() < 1 || args.count() > 4) {
|
if (args.count() < 1 || args.count() > 4) {
|
||||||
evalError(fL1S("join(var, glue, before, after) requires one to four arguments."));
|
evalError(fL1S("join(var, glue, before, after) requires one to four arguments."));
|
||||||
} else {
|
} else {
|
||||||
QString glue;
|
ProString glue, before, after;
|
||||||
ProString before, after;
|
|
||||||
if (args.count() >= 2)
|
if (args.count() >= 2)
|
||||||
glue = args.at(1).toQString(m_tmp1);
|
glue = args.at(1);
|
||||||
if (args.count() >= 3)
|
if (args.count() >= 3)
|
||||||
before = args[2];
|
before = args[2];
|
||||||
if (args.count() == 4)
|
if (args.count() == 4)
|
||||||
|
Reference in New Issue
Block a user