Fix handling of dashes in the style directory path

Now Telegram Desktop could be built if a path to the source directory
contains dashes.
This commit is contained in:
Friedrich von Never 2017-12-24 20:26:37 +07:00 committed by John Preston
parent 4d54cf1370
commit 711aa51046
1 changed files with 5 additions and 3 deletions

View File

@ -1191,9 +1191,11 @@ QByteArray iconMaskValueSize(int width, int height) {
QByteArray iconMaskValuePng(QString filepath) {
QByteArray result;
auto pathAndModifiers = filepath.split('-');
filepath = pathAndModifiers[0];
auto modifiers = pathAndModifiers.mid(1);
QFileInfo fileInfo(filepath);
auto directory = fileInfo.dir();
auto nameAndModifiers = fileInfo.fileName().split('-');
filepath = directory.filePath(nameAndModifiers[0]);
auto modifiers = nameAndModifiers.mid(1);
QImage png100x(filepath + ".png");
QImage png200x(filepath + "@2x.png");