Some notes.
authorMikko Keinänen <mikko.keinanen@gmail.com>
Thu, 21 Oct 2010 22:41:35 +0000 (01:41 +0300)
committerMikko Keinänen <mikko.keinanen@gmail.com>
Thu, 21 Oct 2010 22:41:35 +0000 (01:41 +0300)
src/db/dbcreator.cpp
src/db/dbmediaimage.cpp

index 42eb076..825cd44 100644 (file)
@@ -55,7 +55,8 @@ bool DbCreator::createDB()
 
         ret = query.exec("CREATE TABLE IF NOT EXISTS file"
                         "(id INTEGER PRIMARY KEY, "
-                        "name TEXT, "
+                        "name TEXT, "   // TODO: optional here! -> mediaimagecontainer has filepath spesific name and media image has mediaimagecontainer specific name
+                                        // so no name here for those file types
                         "type INTEGER, "
                         "checksum TEXT, "
                         "size INTEGER, "
@@ -117,9 +118,10 @@ bool DbCreator::createDB()
 
         qDebug() << "Creating TABLE mediaimagecontainer";
 
-        ret = query.exec("CREATE TABLE IF NOT EXISTS mediaimagecontainer "
+        ret = query.exec("CREATE TABLE IF NOT EXISTS mediaimagecontainer " // mediaimagecontainer_filepath
                         "(fileid INTEGER REFERENCES file(id), "
                         "filepathid INTEGER REFERENCES filepath(id), "
+                        // TODO: mediaimagecontainername -> filepath specific name for media image container!
                         "updatetime NUMERIC)");
 
         if (!ret) throw QString("tbl mediaimagecontainer");
@@ -129,6 +131,7 @@ bool DbCreator::createDB()
 
         ret = query.exec("CREATE TABLE IF NOT EXISTS mediaimagecontainer_mediaimage "
                         "(mediaimagecontainerid INTEGER REFERENCES file(id), "
+                        // TODO: mediaimagename -> mediaimagecontainer specific name for media image!
                         "mediaimageid INTEGER REFERENCES file(id))");
 
         if (!ret) throw QString("tbl mediaimagecontainer_mediaimage");
index 1eac48c..9a8fd1a 100644 (file)
@@ -110,7 +110,10 @@ QList<int> DbMediaImage::storeMediaImages(QMap<QString, EmuFrontObject*> images)
             delete o;
             // this media image is already in the database
             // TODO: what if the name differs? (cannot update to database, since the same media image
-            // might be inside another container
+            // might be inside another container...
+            // possible solution:
+            // * store media image names in different
+            //   table linked to the media image container
         }
         else if (id < 0)
         {