[rygel/wip/static-title] media-export: Be able to use in-memory database
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/wip/static-title] media-export: Be able to use in-memory database
- Date: Wed, 13 Mar 2013 10:45:42 +0000 (UTC)
commit a71a916811d43337923d5a33f98ada291457b324
Author: Jens Georg <mail jensge org>
Date: Wed Aug 25 20:09:04 2010 +0300
media-export: Be able to use in-memory database
Useful for unittests
.../media-export/rygel-media-export-database.vala | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-database.vala
b/src/plugins/media-export/rygel-media-export-database.vala
index 16c007d..1b2f3d3 100644
--- a/src/plugins/media-export/rygel-media-export-database.vala
+++ b/src/plugins/media-export/rygel-media-export-database.vala
@@ -87,10 +87,17 @@ internal class Rygel.MediaExport.Database : SqliteWrapper {
* (<cache-dir>/rygel/<name>.db)
*/
public Database (string name) throws DatabaseError {
- var dirname = Path.build_filename (Environment.get_user_cache_dir (),
- "rygel");
- DirUtils.create_with_parents (dirname, 0750);
- var db_file = Path.build_filename (dirname, "%s.db".printf (name));
+ string db_file;
+
+ if (name != ":memory:") {
+ var dirname = Path.build_filename (
+ Environment.get_user_cache_dir (),
+ "rygel");
+ DirUtils.create_with_parents (dirname, 0750);
+ db_file = Path.build_filename (dirname, "%s.db".printf (name));
+ } else {
+ db_file = name;
+ }
base (db_file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]