Browse Source

Fix issues pointed out in code review.

Darryl Pogue 12 years ago
parent
commit
cd53cf180d
  1. 12
      Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp
  2. 2
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp
  3. 2
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.h

12
Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp

@ -80,17 +80,9 @@ plRegistryPageNode::plRegistryPageNode(const plLocation& location, const plStrin
{ {
fPageInfo.SetStrings(age, page); fPageInfo.SetStrings(age, page);
plString path = dataPath;
path += PATH_SEPARATOR_STR;
// Time to construct our actual file name. For now, we'll use the same old format // Time to construct our actual file name. For now, we'll use the same old format
// of age_page.extension // of age_page.extension
path += fPageInfo.GetAge(); fPath = plString::Format("%s%x%s_District_%s.prp", dataPath.c_str(), PATH_SEPARATOR_STR, fPageInfo.GetAge().c_str(), fPageInfo.GetPage().c_str());
path += "_District_";
path += fPageInfo.GetPage();
path += ".prp";
fPath = path;
} }
plRegistryPageNode::~plRegistryPageNode() plRegistryPageNode::~plRegistryPageNode()
@ -137,7 +129,7 @@ hsStream* plRegistryPageNode::OpenStream()
{ {
if (fOpenRequests == 0) if (fOpenRequests == 0)
{ {
if (!fStream.Open(fPath.c_str(), "rb")) if (!fStream.Open_TEMP(fPath, "rb"))
return nil; return nil;
} }
fOpenRequests++; fOpenRequests++;

2
Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp

@ -1770,7 +1770,7 @@ bool plResManager::IteratePages(plRegistryPageIterator* iterator, const plString
if (page->GetPageInfo().GetLocation() == plLocation::kGlobalFixedLoc) if (page->GetPageInfo().GetLocation() == plLocation::kGlobalFixedLoc)
continue; continue;
if (!ageToRestrictTo.IsNull() || page->GetPageInfo().GetAge().CompareI(ageToRestrictTo) == 0) if (ageToRestrictTo.IsNull() || page->GetPageInfo().GetAge().CompareI(ageToRestrictTo) == 0)
{ {
if (!iterator->EatPage(page)) if (!iterator->EatPage(page))
{ {

2
Sources/Plasma/PubUtilLib/plResMgr/plResManager.h

@ -155,7 +155,7 @@ public:
// Single page version // Single page version
bool IterateKeys(plRegistryKeyIterator* iterator, const plLocation& pageToRestrictTo); bool IterateKeys(plRegistryKeyIterator* iterator, const plLocation& pageToRestrictTo);
// Iterate through loaded pages // Iterate through loaded pages
bool IteratePages(plRegistryPageIterator* iterator, const plString& ageToRestrictTo = nil); bool IteratePages(plRegistryPageIterator* iterator, const plString& ageToRestrictTo = "");
// Iterate through ALL pages, loaded or not // Iterate through ALL pages, loaded or not
bool IterateAllPages(plRegistryPageIterator* iterator); bool IterateAllPages(plRegistryPageIterator* iterator);

Loading…
Cancel
Save