From bc64c50b39ee4d3efa0fad6d1d6d42c906e7a5ab Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Sun, 24 Dec 2017 20:26:37 +0700 Subject: [PATCH] Fix handling of dashes in the style directory path --- Telegram/SourceFiles/codegen/style/generator.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/codegen/style/generator.cpp b/Telegram/SourceFiles/codegen/style/generator.cpp index 45202ec67..9dfa0f712 100644 --- a/Telegram/SourceFiles/codegen/style/generator.cpp +++ b/Telegram/SourceFiles/codegen/style/generator.cpp @@ -1186,9 +1186,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");