Few tweaks before PR

This commit is contained in:
Atlante45 2014-04-02 16:46:03 -07:00
parent 0c5b3b60b2
commit cf20c448a3

View file

@ -54,7 +54,7 @@ static const QString propertiesIds[MODEL_METADATA_COUNT] = {
DO_NOT_MODIFY_TAG,
"Type",
"Gender",
"x-amz-request-id",
"Creator",
"Last-Modified"
};
@ -97,7 +97,7 @@ void ModelsBrowser::applyFilter(const QString &filter) {
for (int k = 0; k < filters.count(); ++k) {
match = false;
for (int j = 0; j < MODEL_METADATA_COUNT; ++j) {
if (model->item(i, j)->text().contains(filters.at(k))) {
if (model->item(i, j)->text().contains(filters.at(k), Qt::CaseInsensitive)) {
match = true;
break;
}
@ -359,6 +359,22 @@ bool ModelHandler::parseHeaders(QNetworkReply* reply) {
_model.item(_model.indexFromItem(items.first()).row(), i)->setText(item);
}
}
// Rand properties for now (Will be taken out when we have real metadata on the server)
if (_model.item(_model.indexFromItem(items.first()).row(), i)->text().isEmpty()) {
if (i == CREATOR) {
static QString creator[] = {"Ryan", "Philip", "Andzrej", "Phteven", "Brad"};
_model.item(_model.indexFromItem(items.first()).row(), i)->setText(creator[randIntInRange(0, 4)]);
} else if (i == TYPE) {
static QString type[] = {"human", "beast", "pet", "elfe"};
_model.item(_model.indexFromItem(items.first()).row(), i)->setText(type[randIntInRange(0, 3)]);
} else if (i == GENDER) {
static QString gender[] = {"male", "female", "none"};
_model.item(_model.indexFromItem(items.first()).row(), i)->setText(gender[randIntInRange(0, 2)]);
}
}
////////////////////////////////////////////////////////////
}
_lock.unlock();