diff --git a/doomsday/apps/libdoomsday/include/doomsday/resource/resources.h b/doomsday/apps/libdoomsday/include/doomsday/resource/resources.h index 9342743d4d..0567d8429a 100644 --- a/doomsday/apps/libdoomsday/include/doomsday/resource/resources.h +++ b/doomsday/apps/libdoomsday/include/doomsday/resource/resources.h @@ -82,7 +82,7 @@ class LIBDOOMSDAY_PUBLIC Resources : public de::System /** * Lookup a ResourceClass by symbolic @a name. */ - ResourceClass &resClass(de::String name); + ResourceClass &resClass(const de::String& name); /** * Lookup a ResourceClass by @a id. @@ -138,7 +138,7 @@ namespace res { auto const *path = reinterpret_cast(context); /// @todo Use PathTree::Node::compare() - return manifest.path().toString().beginsWith(*path, de::CaseInsensitive); + return manifest.path().toString().beginsWith(path->toString(), de::CaseInsensitive); } } @@ -148,7 +148,7 @@ namespace res * * @param className Resource class name. */ -LIBDOOMSDAY_PUBLIC ResourceClass &App_ResourceClass(de::String className); +LIBDOOMSDAY_PUBLIC ResourceClass &App_ResourceClass(const de::String& className); /// @overload LIBDOOMSDAY_PUBLIC ResourceClass &App_ResourceClass(resourceclassid_t classId); diff --git a/doomsday/apps/libdoomsday/include/doomsday/resource/texturescheme.h b/doomsday/apps/libdoomsday/include/doomsday/resource/texturescheme.h index 0b079f9195..9cdb8768a2 100644 --- a/doomsday/apps/libdoomsday/include/doomsday/resource/texturescheme.h +++ b/doomsday/apps/libdoomsday/include/doomsday/resource/texturescheme.h @@ -61,7 +61,7 @@ class LIBDOOMSDAY_PUBLIC TextureScheme * @param symbolicName Symbolic name of the new subspace scheme. Must * have at least @ref min_name_length characters. */ - explicit TextureScheme(de::String symbolicName); + explicit TextureScheme(const de::String& symbolicName); ~TextureScheme(); diff --git a/doomsday/apps/libdoomsday/src/resource/resources.cpp b/doomsday/apps/libdoomsday/src/resource/resources.cpp index 1d0286b949..a673c50a1d 100644 --- a/doomsday/apps/libdoomsday/src/resource/resources.cpp +++ b/doomsday/apps/libdoomsday/src/resource/resources.cpp @@ -43,15 +43,15 @@ static Resources *theResources = nullptr; static String resolveUriSymbol(String const &symbol) { - if (!symbol.compare("App.DataPath", Qt::CaseInsensitive)) + if (!symbol.compare("App.DataPath", CaseInsensitive)) { return "data"; } - else if (!symbol.compare("App.DefsPath", Qt::CaseInsensitive)) + else if (!symbol.compare("App.DefsPath", CaseInsensitive)) { return "defs"; } - else if (!symbol.compare("Game.IdentityKey", Qt::CaseInsensitive)) + else if (!symbol.compare("Game.IdentityKey", CaseInsensitive)) { if (DoomsdayApp::game().isNull()) { @@ -61,7 +61,7 @@ static String resolveUriSymbol(String const &symbol) } return DoomsdayApp::game().id(); } - else if (!symbol.compare("GamePlugin.Name", Qt::CaseInsensitive)) + else if (!symbol.compare("GamePlugin.Name", CaseInsensitive)) { auto &gx = DoomsdayApp::plugins().gameExports(); if (DoomsdayApp::game().isNull() || !gx.GetPointer) @@ -84,7 +84,7 @@ DE_PIMPL(Resources) , DE_OBSERVES(PackageLoader, Load) , DE_OBSERVES(PackageLoader, Unload) { - typedef QList ResourceClasses; + typedef List ResourceClasses; ResourceClasses resClasses; NullResourceClass nullResourceClass; @@ -133,7 +133,7 @@ DE_PIMPL(Resources) ~Impl() { - qDeleteAll(resClasses); + deleteAll(resClasses); textures.clear(); theResources = nullptr; @@ -234,11 +234,11 @@ Resources &Resources::get() return *theResources; } -ResourceClass &Resources::resClass(String name) +ResourceClass &Resources::resClass(const String& name) { if (!name.isEmpty()) { - foreach (ResourceClass *resClass, d->resClasses) + for (ResourceClass *resClass : d->resClasses) { if (!resClass->name().compareWithoutCase(name)) return *resClass; @@ -255,7 +255,7 @@ ResourceClass &Resources::resClass(resourceclassid_t id) return *d->resClasses.at(uint(id)); } /// @throw UnknownResourceClass Attempted with an unknown id. - throw UnknownResourceClassError("ResourceResources::toClass", QString("Invalid id '%1'").arg(int(id))); + throw UnknownResourceClassError("ResourceResources::toClass", stringf("Invalid id '%i'", int(id))); } NativePath Resources::nativeSavePath() const @@ -324,7 +324,7 @@ String Resources::tryFindMusicFile(Record const &definition) { // All external music files are specified relative to the base path. String fullPath = App_BasePath() / songUri.path(); - if (F_Access(fullPath.toUtf8().constData())) + if (F_Access(fullPath)) { return fullPath; } @@ -349,7 +349,7 @@ String Resources::tryFindMusicFile(Record const &definition) return ""; // None found. } -ResourceClass &App_ResourceClass(String className) +ResourceClass &App_ResourceClass(const String& className) { return Resources::get().resClass(className); } @@ -377,18 +377,17 @@ static dint printMapsIndex2(Path const &like, de::Uri::ComposeAsTextFlags compos //if (!printSchemeName && scheme) // heading += " in scheme '" + scheme->name() + "'"; if (!like.isEmpty()) - heading += " like \"" _E(b) + like.toStringRef() + _E(.) "\""; + heading += " like \"" _E(b) + like.toString() + _E(.) "\""; LOG_RES_MSG(_E(D) "%s:" _E(.)) << heading; // Print the result index. - qSort(found.begin(), found.end(), comparePathTreeNodePathsAscending); - dint const numFoundDigits = de::max(3/*idx*/, M_NumDigits(found.count())); + std::sort(found.begin(), found.end(), comparePathTreeNodePathsAscending); +// dint const numFoundDigits = de::max(3/*idx*/, M_NumDigits(found.count())); dint idx = 0; for (res::MapManifest *mapManifest : found) { - String info = String("%1: " _E(1) "%2" _E(.)) - .arg(idx, numFoundDigits) - .arg(mapManifest->description(composeUriFlags)); + String info = String::format( + "%3i: " _E(1) "%s" _E(.), idx, mapManifest->description(composeUriFlags).c_str()); LOG_RES_MSG(" " _E(>)) << info; idx++; @@ -428,19 +427,19 @@ static int printMaterialIndex2(world::MaterialScheme *scheme, Path const &like, if (!printSchemeName && scheme) heading += " in scheme '" + scheme->name() + "'"; if (!like.isEmpty()) - heading += " like \"" _E(b) + like.toStringRef() + _E(.) "\""; + heading += " like \"" _E(b) + like.toString() + _E(.) "\""; LOG_RES_MSG(_E(D) "%s:" _E(.)) << heading; // Print the result index. - qSort(found.begin(), found.end(), comparePathTreeNodePathsAscending); - int const numFoundDigits = de::max(3/*idx*/, M_NumDigits(found.count())); + std::sort(found.begin(), found.end(), comparePathTreeNodePathsAscending); +// int const num/FoundDigits = de::max(3/*idx*/, M_NumDigits(found.count())); int idx = 0; - foreach (world::MaterialManifest *manifest, found) + for (world::MaterialManifest *manifest : found) { - String info = String("%1: %2%3" _E(.)) - .arg(idx, numFoundDigits) - .arg(manifest->hasMaterial()? _E(1) : _E(2)) - .arg(manifest->description(composeUriFlags)); + String info = String::format("%#i: %s%s" _E(.), + idx, + manifest->hasMaterial()? _E(1) : _E(2), + manifest->description(composeUriFlags).c_str()); LOG_RES_MSG(" " _E(>)) << info; idx++; @@ -465,9 +464,9 @@ static int printTextureIndex2(res::TextureScheme *scheme, Path const &like, } else // Consider resources in any scheme. { - foreach (res::TextureScheme *scheme, res::Textures::get().allTextureSchemes()) + for (const auto &s : res::Textures::get().allTextureSchemes()) { - scheme->index().findAll(found, res::pathBeginsWithComparator, const_cast(&like)); + s.second->index().findAll(found, res::pathBeginsWithComparator, const_cast(&like)); } } if (found.isEmpty()) return 0; @@ -479,19 +478,19 @@ static int printTextureIndex2(res::TextureScheme *scheme, Path const &like, if (!printSchemeName && scheme) heading += " in scheme '" + scheme->name() + "'"; if (!like.isEmpty()) - heading += " like \"" _E(b) + like.toStringRef() + _E(.) "\""; + heading += " like \"" _E(b) + like.toString() + _E(.) "\""; LOG_RES_MSG(_E(D) "%s:" _E(.)) << heading; // Print the result index key. - qSort(found.begin(), found.end(), comparePathTreeNodePathsAscending); - int numFoundDigits = de::max(3/*idx*/, M_NumDigits(found.count())); + std::sort(found.begin(), found.end(), comparePathTreeNodePathsAscending); +// int numFoundDigits = de::max(3/*idx*/, M_NumDigits(found.count())); int idx = 0; - foreach (res::TextureManifest *manifest, found) + for (res::TextureManifest *manifest : found) { - String info = String("%1: %2%3") - .arg(idx, numFoundDigits) - .arg(manifest->hasTexture()? _E(0) : _E(2)) - .arg(manifest->description(composeUriFlags)); + String info = String::format("%3i: %s%s", + idx, + manifest->hasTexture()? _E(0) : _E(2), + manifest->description(composeUriFlags).c_str()); LOG_RES_MSG(" " _E(>)) << info; idx++; @@ -566,9 +565,9 @@ static void printTextureIndex(de::Uri const &search, else { // Collect and sort results in each scheme separately. - foreach (res::TextureScheme *scheme, textures.allTextureSchemes()) + for (const auto &s : textures.allTextureSchemes()) { - int numPrinted = printTextureIndex2(scheme, search.path(), flags | de::Uri::OmitScheme); + int numPrinted = printTextureIndex2(s.second, search.path(), flags | de::Uri::OmitScheme); if (numPrinted) { LOG_RES_MSG(_E(R)); @@ -674,13 +673,13 @@ D_CMD(PrintTextureStats) DE_UNUSED(src, argc, argv); LOG_MSG(_E(b) "Texture Statistics:"); - foreach (res::TextureScheme *scheme, res::Textures::get().allTextureSchemes()) + for (const auto &s : res::Textures::get().allTextureSchemes()) { - res::TextureScheme::Index const &index = scheme->index(); + res::TextureScheme::Index const &index = s.second->index(); uint const count = index.count(); LOG_MSG("Scheme: %s (%u %s)") - << scheme->name() << count << (count == 1? "texture" : "textures"); + << s.second->name() << count << (count == 1? "texture" : "textures"); index.debugPrintHashDistribution(); index.debugPrint(); } diff --git a/doomsday/apps/libdoomsday/src/resource/textures.cpp b/doomsday/apps/libdoomsday/src/resource/textures.cpp index ef6d486722..97a979b20d 100644 --- a/doomsday/apps/libdoomsday/src/resource/textures.cpp +++ b/doomsday/apps/libdoomsday/src/resource/textures.cpp @@ -351,8 +351,7 @@ DE_PIMPL(Textures) // Process each definition file. int origIndexBase = 0; - //DE_FOR_EACH_CONST(QList, i, defFiles) - foreach (auto *file, defFiles) + for (auto *file : defFiles) { //File1 &file = **i; @@ -383,8 +382,8 @@ DE_PIMPL(Textures) // Print a summary. LOG_RES_MSG("Loaded %s texture definitions from \"%s:%s\"") - << (newDefs.count() == archiveCount? String("all %1").arg(newDefs.count()) - : String("%1 of %1").arg(newDefs.count()).arg(archiveCount)) + << (newDefs.count() == archiveCount? String::format("all %i", newDefs.count()) + : String::format("%i of %i", newDefs.count(), archiveCount)) << NativePath(file->container().composeUri().asText()).pretty() << NativePath(file->composeUri().asText()).pretty(); } @@ -395,9 +394,9 @@ DE_PIMPL(Textures) // Map the definitions for O(log n) lookup performance, CompositeTextureMap mappedCustomDefs; - foreach (Composite *custom, customDefs) + for (Composite *custom : customDefs) { - mappedCustomDefs.insert(custom->percentEncodedNameRef(), custom); + mappedCustomDefs.insert(std::make_pair(custom->percentEncodedNameRef(), custom)); } // Perform reclassification of replaced texture definitions. @@ -406,12 +405,12 @@ DE_PIMPL(Textures) Composite *orig = defs[i]; // Does a potential replacement exist for this original definition? - CompositeTextureMap::const_iterator found = mappedCustomDefs.constFind(orig->percentEncodedNameRef()); - if (found == mappedCustomDefs.constEnd()) + CompositeTextureMap::const_iterator found = mappedCustomDefs.find(orig->percentEncodedNameRef()); + if (found == mappedCustomDefs.end()) continue; // Definition 'custom' is destined to replace 'orig'. - Composite *custom = found.value(); + Composite *custom = found->second; bool haveReplacement = false; if (custom->isFlagged(Composite::Custom)) @@ -460,9 +459,9 @@ DE_PIMPL(Textures) while (!allDefs.isEmpty()) { Composite &def = *allDefs.takeFirst(); - de::Uri uri(QStringLiteral("Textures"), Path(def.percentEncodedName())); + de::Uri uri(DE_STR("Textures"), Path(def.percentEncodedName())); - Texture::Flags flags; + Flags flags; if (def.isFlagged(Composite::Custom)) flags |= Texture::Custom; /* @@ -559,10 +558,10 @@ DE_PIMPL(Textures) !percentEncodedName.compareWithoutCase("F_END") || !percentEncodedName.compareWithoutCase("FF_END")) continue; - de::Uri uri(QStringLiteral("Flats"), Path(percentEncodedName)); + de::Uri uri(DE_STR("Flats"), Path(percentEncodedName)); if (self().textureManifestPtr(uri)) continue; - Texture::Flags flags; + Flags flags; if (file.container().hasCustom()) flags |= Texture::Custom; /* @@ -607,16 +606,16 @@ DE_PIMPL(Textures) File1 &file = index[i]; String fileName = file.name().fileNameWithoutExtension(); - if (fileName.beginsWith('S', String::CaseInsensitive) && fileName.length() >= 5) + if (fileName.beginsWith('S', CaseInsensitive) && fileName.length() >= 5) { - if (fileName.endsWith("_START", String::CaseInsensitive)) + if (fileName.endsWith("_START", CaseInsensitive)) { // We've arrived at *a* sprite block. Stack_Push(stack, NULL); continue; } - if (Stack_Height(stack) > 0 && fileName.endsWith("_END", String::CaseInsensitive)) + if (Stack_Height(stack) > 0 && fileName.endsWith("_END", CaseInsensitive)) { // The sprite block ends. Stack_Pop(stack); @@ -626,7 +625,7 @@ DE_PIMPL(Textures) if (!Stack_Height(stack)) continue; - String decodedFileName = QString(QByteArray::fromPercentEncoding(fileName.toUtf8())); + String decodedFileName = String::fromPercentEncoding(fileName); if (!Sprites::isValidSpriteName(decodedFileName)) { LOG_RES_NOTE("Ignoring invalid sprite name '%s'") << decodedFileName; @@ -635,7 +634,7 @@ DE_PIMPL(Textures) de::Uri const uri("Sprites", Path(fileName)); - Texture::Flags flags = 0; + Flags flags = 0; // If this is from an add-on flag it as "custom". if (file.container().hasCustom()) { @@ -755,10 +754,10 @@ TextureScheme *Textures::textureSchemePtr(String const &name) const { if (!name.isEmpty()) { - auto found = d->textureSchemes.constFind(name); - if (found != d->textureSchemes.constEnd()) + auto found = d->textureSchemes.find(name); + if (found != d->textureSchemes.end()) { - return *found; + return found->second; } } return nullptr; @@ -815,12 +814,11 @@ TextureManifest *Textures::textureManifestPtr(de::Uri const &uri) const // Is this a URN? (of the form "urn:schemename:uniqueid") if (!uri.scheme().compareWithoutCase("urn")) { - String const &pathStr = uri.path().toStringRef(); - dint uIdPos = pathStr.indexOf(':'); - if (uIdPos > 0) + const String pathStr = uri.path().toString(); + if (auto uIdPos = pathStr.indexOf(":")) { String schemeName = pathStr.left(uIdPos); - dint uniqueId = pathStr.mid(uIdPos + 1 /*skip delimiter*/).toInt(); + dint uniqueId = pathStr.substr(uIdPos + 1 /*skip delimiter*/).toInt(); if (auto *ts = textureSchemePtr(schemeName)) { @@ -861,7 +859,7 @@ Textures::AllTextures const &Textures::allTextures() const TextureManifest &Textures::declareSystemTexture(Path const &texturePath, de::Uri const &resourceUri) { - auto &scheme = textureScheme(QStringLiteral("System")); + auto &scheme = textureScheme(DE_STR("System")); dint const uniqueId = scheme.count() + 1; return scheme.declare(texturePath, Texture::Custom, @@ -875,7 +873,7 @@ Texture *Textures::tryFindTextureByResourceUri(String const &schemeName, de::Uri { if (!resourceUri.isEmpty()) { - if (resourceUri.path().toStringRef() == QStringLiteral("-")) + if (resourceUri.path() == DE_STR("-")) { return nullptr; } @@ -914,7 +912,7 @@ Texture *Textures::defineTexture(String const &schemeName, return nullptr; } - de::Uri uri(scheme.name(), Path(String("%1").arg(uniqueId, 8, 10, QChar('0')))); + de::Uri uri(scheme.name(), Path(String::format("%08i", uniqueId))); try { TextureManifest &manifest = declareTexture(uri, Texture::Custom, dimensions, @@ -961,7 +959,7 @@ patchid_t Textures::declarePatch(String const &encodedName) if (encodedName.isEmpty()) return 0; - de::Uri uri(QStringLiteral("Patches"), Path(encodedName)); + de::Uri uri(DE_STR("Patches"), Path(encodedName)); // Already defined as a patch? if (auto *mft = textureManifestPtr(uri)) @@ -982,7 +980,7 @@ patchid_t Textures::declarePatch(String const &encodedName) lumpnum_t const lumpNum = fs1.nameIndex().findLast(lumpPath); File1 &file = fs1.lump(lumpNum); - Texture::Flags flags; + Flags flags; if (file.container().hasCustom()) flags |= Texture::Custom; Vec2ui dimensions; @@ -1010,7 +1008,7 @@ patchid_t Textures::declarePatch(String const &encodedName) } file.unlock(); - dint uniqueId = textureScheme(QStringLiteral("Patches")).count() + 1; // 1-based index. + dint uniqueId = textureScheme(DE_STR("Patches")).count() + 1; // 1-based index. de::Uri resourceUri = LumpIndex::composeResourceUrn(lumpNum); try diff --git a/doomsday/apps/libdoomsday/src/resource/texturescheme.cpp b/doomsday/apps/libdoomsday/src/resource/texturescheme.cpp index 0040535393..0f8e4ce37e 100644 --- a/doomsday/apps/libdoomsday/src/resource/texturescheme.cpp +++ b/doomsday/apps/libdoomsday/src/resource/texturescheme.cpp @@ -57,7 +57,7 @@ DE_PIMPL(TextureScheme) bool inline uniqueIdInLutRange(int uniqueId) const { - return (uniqueId - uniqueIdBase >= 0 && (uniqueId - uniqueIdBase) < uniqueIdLut.size()); + return (uniqueId - uniqueIdBase >= 0 && (uniqueId - uniqueIdBase) < uniqueIdLut.sizei()); } void findUniqueIdRange(int *minId, int *maxId) @@ -128,7 +128,7 @@ DE_PIMPL(TextureScheme) // Fill the LUT with initial values. uniqueIdLut.reserve(lutSize); int i = 0; - for (; i < uniqueIdLut.size(); ++i) + for (; i < uniqueIdLut.sizei(); ++i) { uniqueIdLut[i] = 0; } @@ -164,7 +164,8 @@ DE_PIMPL(TextureScheme) } }; -TextureScheme::TextureScheme(String symbolicName) : d(new Impl(this, symbolicName)) +TextureScheme::TextureScheme(const String& symbolicName) + : d(new Impl(this, symbolicName)) {} TextureScheme::~TextureScheme() diff --git a/doomsday/apps/libdoomsday/src/world/entitydef.cpp b/doomsday/apps/libdoomsday/src/world/entitydef.cpp index ea9961fd9d..215d17e6e0 100644 --- a/doomsday/apps/libdoomsday/src/world/entitydef.cpp +++ b/doomsday/apps/libdoomsday/src/world/entitydef.cpp @@ -164,33 +164,25 @@ void MapEntityDef_AddProperty(MapEntityDef* def, int propertyId, const char* pro break; default: - throw Error("MapEntityDef_AddProperty", QString("Unknown/not supported value type %1").arg(type)); + throw Error("MapEntityDef_AddProperty", stringf("Unknown/not supported value type %i", type)); } // Ensure both the identifer and the name for the new property are unique. if (MapEntityDef_Property(def, propertyId) >= 0) - throw Error("MapEntityDef_AddProperty", QString("propertyId %1 not unique for %2") - .arg(propertyId).arg(Str_Text(P_NameForMapEntityDef(def)))); + throw Error("MapEntityDef_AddProperty", stringf("propertyId %i not unique for %s", + propertyId, Str_Text(P_NameForMapEntityDef(def)))); if (MapEntityDef_PropertyByName(def, propertyName) >= 0) - throw Error("MapEntityDef_AddProperty", QString("propertyName \"%1\" not unique for %2") - .arg(propertyName).arg(Str_Text(P_NameForMapEntityDef(def)))); + throw Error("MapEntityDef_AddProperty", stringf("propertyName \"%s\" not unique for %s", + propertyName, Str_Text(P_NameForMapEntityDef(def)))); // Looks good! Add it to the list of properties. def->props = (MapEntityPropertyDef*) M_Realloc(def->props, ++def->numProps * sizeof(*def->props)); - if (!def->props) - throw Error("MapEntityDef_AddProperty", - QString("Failed on (re)allocation of %1 bytes for new MapEntityPropertyDef array") - .arg((unsigned long) sizeof(*def->props))); MapEntityPropertyDef* prop = &def->props[def->numProps - 1]; prop->id = propertyId; int len = (int)strlen(propertyName); prop->name = (char *) M_Malloc(sizeof(*prop->name) * (len + 1)); - if (!prop->name) - throw Error("MapEntityDef_AddProperty", - QString("Failed on allocation of %1 bytes for property name") - .arg((unsigned long) (sizeof(*prop->name) * (len + 1)))); strncpy(prop->name, propertyName, len); prop->name[len] = '\0'; @@ -251,13 +243,15 @@ DE_EXTERN_C dd_bool P_RegisterMapObj(int identifier, char const *name) return findMapEntityDef(identifier, name, true /*do create*/) != 0; } -DE_EXTERN_C dd_bool P_RegisterMapObjProperty(int entityId, int propertyId, - char const *propertyName, valuetype_t type) +DE_EXTERN_C dd_bool P_RegisterMapObjProperty(int entityId, + int propertyId, + char const *propertyName, + valuetype_t type) { try { MapEntityDef *def = findMapEntityDef(entityId, 0, false /*do not create*/); - if (!def) throw Error("P_RegisterMapObjProperty", QString("Unknown entityId %1").arg(entityId)); + if (!def) throw Error("P_RegisterMapObjProperty", stringf("Unknown entityId %i", entityId)); MapEntityDef_AddProperty(def, propertyId, propertyName, type); return true; // Success! @@ -284,14 +278,14 @@ static MapEntityPropertyDef *entityPropertyDef(int entityId, int propertyId) { // Is this a known entity? MapEntityDef *entity = P_MapEntityDef(entityId); - if (!entity) throw Error("entityPropertyDef", QString("Unknown entity definition id %1").arg(entityId)); + if (!entity) throw Error("entityPropertyDef", stringf("Unknown entity definition id %i", entityId)); // Is this a known property? MapEntityPropertyDef *property; if (MapEntityDef_Property(entity, propertyId, &property) < 0) - throw Error("entityPropertyDef", QString("Entity definition %1 has no property with id %2") - .arg(Str_Text(P_NameForMapEntityDef(entity))) - .arg(propertyId)); + throw Error("entityPropertyDef", stringf("Entity definition %s has no property with id %i", + Str_Text(P_NameForMapEntityDef(entity)), + propertyId)); return property; // Found it. } @@ -308,7 +302,7 @@ static void setValue(void *dst, valuetype_t dstType, PropertyValue const &pvalue case DDVT_SHORT: *( (short *) dst) = pvalue.asInt16(); break; case DDVT_ANGLE: *((angle_t *) dst) = pvalue.asAngle(); break; default: - throw Error("setValue", QString("Unknown value type %d").arg(dstType)); + throw Error("setValue", stringf("Unknown value type %d", dstType)); } } diff --git a/doomsday/apps/libdoomsday/src/world/thinkerdata.cpp b/doomsday/apps/libdoomsday/src/world/thinkerdata.cpp index 2c07643377..7ca8dff1bf 100644 --- a/doomsday/apps/libdoomsday/src/world/thinkerdata.cpp +++ b/doomsday/apps/libdoomsday/src/world/thinkerdata.cpp @@ -47,7 +47,7 @@ DE_PIMPL(ThinkerData) ~Impl() { - thinkerLookup.remove(id, &self()); + multiRemove(thinkerLookup, id, &self()); DE_FOR_PUBLIC_AUDIENCE2(Deletion, i) { @@ -84,7 +84,7 @@ Id const &ThinkerData::id() const void ThinkerData::setId(Id const &id) { - thinkerLookup.remove(d->id, this); + multiRemove(thinkerLookup, d->id, this); thinkerLookup.insert(std::make_pair(id, this)); d->id = id; @@ -139,7 +139,7 @@ void ThinkerData::operator >> (Writer &to) const void ThinkerData::operator << (Reader &from) { - thinkerLookup.remove(d->id, this); + multiRemove(thinkerLookup, d->id, this); world::InternalSerialId sid; from >> sid;