2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Move MimeType from utils to core/mime_type.

Also move to Core namespace.
This commit is contained in:
John Preston
2018-06-14 01:06:21 +03:00
parent 2b36dd660b
commit 0e9793b845
11 changed files with 153 additions and 112 deletions

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
#include <cmath>
#include <set>
#include "logs.h"
#include "core/basic_types.h"
@@ -435,35 +436,6 @@ enum DBIPeerReportSpamStatus {
dbiprsRequesting = 5, // requesting the cloud setting right now
};
class MimeType {
public:
enum class Known {
Unknown,
TDesktopTheme,
TDesktopPalette,
WebP,
};
MimeType(const QMimeType &type) : _typeStruct(type) {
}
MimeType(Known type) : _type(type) {
}
QStringList globPatterns() const;
QString filterString() const;
QString name() const;
private:
QMimeType _typeStruct;
Known _type = Known::Unknown;
};
MimeType mimeTypeForName(const QString &mime);
MimeType mimeTypeForFile(const QFileInfo &file);
MimeType mimeTypeForData(const QByteArray &data);
#include <cmath>
inline int rowscount(int fullCount, int countPerRow) {
return (fullCount + countPerRow - 1) / countPerRow;
}