mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 21:16:00 +02:00
CR fixes
This commit is contained in:
parent
f4698065ce
commit
b8db07be5f
1 changed files with 15 additions and 12 deletions
|
@ -25,6 +25,8 @@ const QString INFO_LABEL_TEXT = QObject::tr("<div style='line-height:20px;'>"
|
||||||
"add mode (S or V keys will toggle mode) to place.</div>");
|
"add mode (S or V keys will toggle mode) to place.</div>");
|
||||||
|
|
||||||
const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
||||||
|
const int SHORT_FILE_EXTENSION = 4;
|
||||||
|
const int SECOND_INDEX_LETTER = 1;
|
||||||
|
|
||||||
QIcon HiFiIconProvider::icon(QFileIconProvider::IconType type) const {
|
QIcon HiFiIconProvider::icon(QFileIconProvider::IconType type) const {
|
||||||
|
|
||||||
|
@ -83,8 +85,9 @@ QIcon HiFiIconProvider::icon(const QFileInfo &info) const {
|
||||||
|
|
||||||
QString HiFiIconProvider::type(const QFileInfo &info) const {
|
QString HiFiIconProvider::type(const QFileInfo &info) const {
|
||||||
if (info.isFile()) {
|
if (info.isFile()) {
|
||||||
if (info.suffix().size() > 4) {
|
if (info.suffix().size() > SHORT_FILE_EXTENSION) {
|
||||||
return info.suffix().at(0).toUpper() + info.suffix().mid(1);
|
// Capitalize extension
|
||||||
|
return info.suffix().left(SECOND_INDEX_LETTER).toUpper() + info.suffix().mid(SECOND_INDEX_LETTER);
|
||||||
}
|
}
|
||||||
return info.suffix().toUpper();
|
return info.suffix().toUpper();
|
||||||
}
|
}
|
||||||
|
@ -243,7 +246,7 @@ void ImportDialog::setImportTypes() {
|
||||||
QJsonObject configObject = document.object();
|
QJsonObject configObject = document.object();
|
||||||
if (!configObject.isEmpty()) {
|
if (!configObject.isEmpty()) {
|
||||||
QJsonArray fileFormats = configObject["importFormats"].toArray();
|
QJsonArray fileFormats = configObject["importFormats"].toArray();
|
||||||
int ff = 0;
|
int formatsCounter = 0;
|
||||||
foreach (const QJsonValue& fileFormat, fileFormats) {
|
foreach (const QJsonValue& fileFormat, fileFormats) {
|
||||||
QJsonObject fileFormatObject = fileFormat.toObject();
|
QJsonObject fileFormatObject = fileFormat.toObject();
|
||||||
|
|
||||||
|
@ -251,19 +254,19 @@ void ImportDialog::setImportTypes() {
|
||||||
QString description(fileFormatObject.value("description").toString());
|
QString description(fileFormatObject.value("description").toString());
|
||||||
QString icon(fileFormatObject.value("icon").toString());
|
QString icon(fileFormatObject.value("icon").toString());
|
||||||
|
|
||||||
if (ff > 0) {
|
if (formatsCounter > 0) {
|
||||||
importFormatsInfo.append(",");
|
importFormatsInfo.append(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
// set ' or' on last import type text
|
// set ' or' on last import type text
|
||||||
if (ff == fileFormats.count() - 1) {
|
if (formatsCounter == fileFormats.count() - 1) {
|
||||||
importFormatsInfo.append(" or");
|
importFormatsInfo.append(" or");
|
||||||
}
|
}
|
||||||
|
|
||||||
importFormatsFilterList.append(QString("*.%1 ").arg(ext));
|
importFormatsFilterList.append(QString("*.%1 ").arg(ext));
|
||||||
importFormatsInfo.append(" .").append(ext);
|
importFormatsInfo.append(" .").append(ext);
|
||||||
iconsMap[ext] = icon;
|
iconsMap[ext] = icon;
|
||||||
ff++;
|
formatsCounter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue