From b101fcc7ce6b9136b98e94117e7627784d3dd71e Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Sat, 2 Jan 2021 17:29:11 +0100 Subject: [PATCH] Cleanup, fix leftovers. --- src/common/repository/sqlite/StellaDb.cxx | 6 ++++++ src/common/repository/sqlite/StellaDb.hxx | 2 +- src/emucore/OSystem.cxx | 15 +++------------ src/emucore/OSystem.hxx | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/common/repository/sqlite/StellaDb.cxx b/src/common/repository/sqlite/StellaDb.cxx index 514d0b835..98212961c 100644 --- a/src/common/repository/sqlite/StellaDb.cxx +++ b/src/common/repository/sqlite/StellaDb.cxx @@ -74,6 +74,12 @@ void StellaDb::initialize() } } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +const string StellaDb::databaseFileName() const +{ + return myDb ? FilesystemNode(myDb->fileName()).getShortPath() : "[failed]"; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void StellaDb::initializeDb() const { diff --git a/src/common/repository/sqlite/StellaDb.hxx b/src/common/repository/sqlite/StellaDb.hxx index 3ef9122eb..ce75395bc 100644 --- a/src/common/repository/sqlite/StellaDb.hxx +++ b/src/common/repository/sqlite/StellaDb.hxx @@ -36,7 +36,7 @@ class StellaDb CompositeKeyValueRepository& propertyRepository() const { return *myPropertyRepository; } - const string& databaseFileName() const { return myDatabaseName; } + const string databaseFileName() const; private: diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index c762d273e..c4a5b2869 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -126,14 +126,9 @@ bool OSystem::create() << "State directory: '" << myStateDir.getShortPath() << "'" << endl << "NVRam directory: '" - << myNVRamDir.getShortPath() << "'" << endl; - - if(myConfigFile.getPath() != EmptyString) - buf << "Configuration file: '" - << myConfigFile.getShortPath() << "'" << endl; - - buf << "Game properties: '" - << myPropertiesFile.getShortPath() << "'" << endl + << myNVRamDir.getShortPath() << "'" << endl + << "Database file: '" + << myStellaDb->databaseFileName() << "'" << endl << "Cheat file: '" << myCheatFile.getShortPath() << "'" << endl << "Palette file: '" @@ -225,7 +220,6 @@ void OSystem::loadConfig(const Settings::Options& options) myStellaDb = make_shared(myBaseDir.getPath(), "stella"); myStellaDb->initialize(); - myConfigFile = FilesystemNode(myStellaDb->databaseFileName()); mySettings->setRepository(getSettingsRepository()); myPropSet->setRepository(getPropertyRepository()); @@ -302,7 +296,6 @@ void OSystem::setConfigPaths() myCheatFile = myBaseDir; myCheatFile /= "stella.cht"; myPaletteFile = myBaseDir; myPaletteFile /= "stella.pal"; - myPropertiesFile = myBaseDir; myPropertiesFile /= "stella.pro"; #if 0 // Debug code @@ -318,8 +311,6 @@ void OSystem::setConfigPaths() dbgPath("sload dir ", mySnapshotLoadDir); dbgPath("cheat file", myCheatFile); dbgPath("pal file ", myPaletteFile); - dbgPath("pro file ", myPropertiesFile); - dbgPath("INI file ", myConfigFile); #endif } diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx index d6120639f..c451cff7a 100644 --- a/src/emucore/OSystem.hxx +++ b/src/emucore/OSystem.hxx @@ -553,7 +553,7 @@ class OSystem private: FilesystemNode myBaseDir, myStateDir, mySnapshotSaveDir, mySnapshotLoadDir, myNVRamDir, myCfgDir, myHomeDir, myUserDir; - FilesystemNode myCheatFile, myConfigFile, myPaletteFile, myPropertiesFile; + FilesystemNode myCheatFile, myPaletteFile; FilesystemNode myRomFile; string myRomMD5; string myFeatures;