Changeset View
Changeset View
Standalone View
Standalone View
src/metadata/filemetadata.cpp
Show All 38 Lines | 33 | FileMetaData::FileMetaData() | |||
---|---|---|---|---|---|
39 | , fuzzy(0) | 39 | , fuzzy(0) | ||
40 | , fuzzy_reviewer(0) | 40 | , fuzzy_reviewer(0) | ||
41 | , fuzzy_approver(0) | 41 | , fuzzy_approver(0) | ||
42 | {} | 42 | {} | ||
43 | 43 | | |||
44 | // static | 44 | // static | ||
45 | FileMetaData FileMetaData::extract(const QString &filePath) | 45 | FileMetaData FileMetaData::extract(const QString &filePath) | ||
46 | { | 46 | { | ||
47 | FileMetaData m; | | |||
48 | | ||||
49 | if (filePath.endsWith(QLatin1String(".po")) || filePath.endsWith(QLatin1String(".pot"))) { | 47 | if (filePath.endsWith(QLatin1String(".po")) || filePath.endsWith(QLatin1String(".pot"))) { | ||
50 | POExtractor extractor; | 48 | POExtractor extractor; | ||
51 | extractor.extract(filePath, m); | 49 | return extractor.extract(filePath); | ||
52 | } else if (filePath.endsWith(QLatin1String(".xlf")) || filePath.endsWith(QLatin1String(".xliff"))) { | 50 | } else if (filePath.endsWith(QLatin1String(".xlf")) || filePath.endsWith(QLatin1String(".xliff"))) { | ||
53 | XliffExtractor extractor; | 51 | XliffExtractor extractor; | ||
54 | extractor.extract(filePath, m); | 52 | return extractor.extract(filePath); | ||
55 | } else if (filePath.endsWith(QLatin1String(".ts"))) { | 53 | } else if (filePath.endsWith(QLatin1String(".ts"))) { | ||
56 | //POExtractor extractor; | 54 | //POExtractor extractor; | ||
57 | //extractor.extract(filePath, m); | 55 | //extractor.extract(filePath, m); | ||
58 | } | 56 | } | ||
59 | 57 | | |||
60 | return m; | 58 | return {}; | ||
61 | } | 59 | } | ||
62 | 60 | | |||
63 | QDataStream &operator<<(QDataStream &s, const FileMetaData &d) | 61 | QDataStream &operator<<(QDataStream &s, const FileMetaData &d) | ||
64 | { | 62 | { | ||
65 | //Magic number | 63 | //Magic number | ||
66 | s << (quint32)0xABC42BCA; | 64 | s << (quint32)0xABC42BCA; | ||
67 | //Version | 65 | //Version | ||
68 | s << (qint32)1; | 66 | s << (qint32)1; | ||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |