From 2d082611ac1f51f3a0ce86d29b8e3d674ad6e3b0 Mon Sep 17 00:00:00 2001 From: methodus Date: Mon, 29 Oct 2012 02:42:08 +0100 Subject: Added CLI parameter for setting the database directory. Also fixed segfault, if databse file can't be opened --- include/config.h | 4 ++-- include/media/mediaManager.h | 2 +- include/setup.h | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/config.h b/include/config.h index 187e46f..f36491c 100644 --- a/include/config.h +++ b/include/config.h @@ -104,9 +104,9 @@ struct cConfig { /** * The sqlite database file * - * This is the path to the database file. + * This is the path where the database file shall be located. */ - string databaseFile; + string databaseDir; }; } diff --git a/include/media/mediaManager.h b/include/media/mediaManager.h index 265e024..f7d803c 100644 --- a/include/media/mediaManager.h +++ b/include/media/mediaManager.h @@ -58,7 +58,7 @@ public: virtual ~cMediaManager(); void SetPluginDirectory(const string& directory); - void SetDatabaseFile(const string& file); + void SetDatabaseDir(const string& file); bool Initialise(); diff --git a/include/setup.h b/include/setup.h index 6ff0961..392c246 100644 --- a/include/setup.h +++ b/include/setup.h @@ -92,7 +92,7 @@ private: char presentationUrl[STRING_SIZE]; char address[16]; char interface[16]; - char databaseFile[STRING_SIZE]; + char databaseDir[STRING_SIZE]; char deviceUUID[STRING_SIZE]; upnp::cConfig config; @@ -104,6 +104,8 @@ private: int ifaceCount; upnp::StringVector ifaceVector; + static std::string parsedArgs; + }; #endif /* SETUP_H_ */ -- cgit v1.2.3