2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-10-05 13:16:13 +00:00

Make qt_make_filter_list a part of file_utilities_linux.cpp

This commit is contained in:
Ilya Fedin
2020-07-13 06:29:48 +04:00
committed by John Preston
parent a6fe5c08ad
commit c61cabb075
2 changed files with 19 additions and 29 deletions

View File

@@ -34,34 +34,8 @@
// For QTextItemInt declaraion
#include <private/qtextengine_p.h>
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
/* TODO: find a dynamic library with these symbols. */
/* Debian maintainer: this function is taken from qfiledialog.cpp */
/*
Makes a list of filters from ;;-separated text.
Used by the mac and windows implementations
*/
QStringList qt_make_filter_list(const QString &filter)
{
QString f(filter);
if (f.isEmpty())
return QStringList();
QString sep(QLatin1String(";;"));
int i = f.indexOf(sep, 0);
if (i == -1) {
if (f.indexOf(QLatin1Char('\n'), 0) != -1) {
sep = QLatin1Char('\n');
i = f.indexOf(sep, 0);
}
}
return f.split(sep);
}
#endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
/* Debian maintainer: this constructor is taken from qtextengine.cpp for TextPainter::drawLine */
QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe, const QTextCharFormat &format)
: flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline), charFormat(format),