_l = l; _r = r; _t = t; _b = b;
_pix = imgFile;
+ if (_pix.startsWith(QLatin1Char('"')) && _pix.endsWith(QLatin1Char('"')))
+ _pix = _pix.mid(1, _pix.size() - 2); // remove leading/trailing quotes.
}
QSGBorderImage::TileMode QSGGridScaledImage::stringToRule(const QString &s)
_l = l; _r = r; _t = t; _b = b;
_pix = imgFile;
+ if (_pix.startsWith(QLatin1Char('"')) && _pix.endsWith(QLatin1Char('"')))
+ _pix = _pix.mid(1, _pix.size() - 2); // remove leading/trailing quotes.
}
QDeclarative1BorderImage::TileMode QDeclarative1GridScaledImage::stringToRule(const QString &s)
--- /dev/null
+border.left:10
+border.top:20
+border.right:30
+border.bottom:40
+horizontalTileRule:Round
+verticalTileRule:Repeat
+source:"colors.png"
QTest::addColumn<bool>("valid");
QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors-round.sci").toString() << true;
+ QTest::newRow("local quoted filename") << QUrl::fromLocalFile(SRCDIR "/data/colors-round-quotes.sci").toString() << true;
QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.sci").toString() << false;
QTest::newRow("remote") << SERVER_ADDR "/colors-round.sci" << true;
+ QTest::newRow("remote filename quoted") << SERVER_ADDR "/colors-round-quotes.sci" << true;
QTest::newRow("remote image") << SERVER_ADDR "/colors-round-remote.sci" << true;
QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.sci" << false;
}
--- /dev/null
+border.left:10
+border.top:20
+border.right:30
+border.bottom:40
+horizontalTileRule:Round
+verticalTileRule:Repeat
+source:"colors.png"
QTest::addColumn<bool>("valid");
QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors-round.sci").toString() << true;
+ QTest::newRow("local quoted filename") << QUrl::fromLocalFile(SRCDIR "/data/colors-round-quotes.sci").toString() << true;
QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.sci").toString() << false;
QTest::newRow("remote") << SERVER_ADDR "/colors-round.sci" << true;
+ QTest::newRow("remote filename quoted") << SERVER_ADDR "/colors-round-quotes.sci" << true;
QTest::newRow("remote image") << SERVER_ADDR "/colors-round-remote.sci" << true;
QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.sci" << false;
}