Fixed column headers.
authorMikko Keinänen <mikko.keinanen@gmail.com>
Sun, 3 Oct 2010 09:08:59 +0000 (12:08 +0300)
committerMikko Keinänen <mikko.keinanen@gmail.com>
Sun, 3 Oct 2010 09:08:59 +0000 (12:08 +0300)
src/db/dbmediaimagecontainer.cpp
src/db/dbmediaimagecontainer.h

index b09aea8..1cd6200 100644 (file)
@@ -158,7 +158,20 @@ EmuFrontObject* DbMediaImageContainer::recordToDataObject(const QSqlRecord *rec)
 
 QSqlQueryModel* DbMediaImageContainer::getData()
 {
-    return DbFile::getData();
+    QSqlQueryModel *model = new QSqlQueryModel(this);
+    model->setQuery(constructSelect());
+    model->setHeaderData(MIC_FileId, Qt::Horizontal, tr("File id"));
+    model->setHeaderData(MIC_FileName, Qt::Horizontal, tr("File Name"));
+    model->setHeaderData(MIC_FileCheckSum, Qt::Horizontal, tr("File checksum"));
+    model->setHeaderData(MIC_FileSize, Qt::Horizontal, tr("File Size"));
+    model->setHeaderData(MIC_FilePathId, Qt::Horizontal, tr("File path id"));
+    model->setHeaderData(MIC_FilePathName, Qt::Horizontal, tr("File path name"));
+    model->setHeaderData(MIC_SetupId, Qt::Horizontal, tr("Setup id"));
+    model->setHeaderData(MIC_PlatformId, Qt::Horizontal, tr("Platform id"));
+    model->setHeaderData(MIC_PlatformName, Qt::Horizontal, tr("Platform name"));
+    model->setHeaderData(MIC_MediaTypeId, Qt::Horizontal, tr("Media type id"));
+    model->setHeaderData(MIC_MediaTypeName, Qt::Horizontal, tr("Media type name"));
+    return model;
 }
 
 /* Returns the id of a media image container with a given cheksum or -1 if not found */
index 33bfc50..a632a10 100644 (file)
@@ -37,6 +37,21 @@ public:
     void storeContainers(QList<MediaImageContainer*>, FilePathObject*);
     int getMediaImageContainer(QString checksum) const;
     void filter(int mediaTypeId, int platformId);
+   enum {
+        MIC_FileId = 0,
+        MIC_FileName,
+        MIC_FileCheckSum,
+        MIC_FileSize,
+        MIC_FilePathId,
+        MIC_FilePathName,
+        MIC_SetupId,
+        MIC_PlatformId,
+        MIC_PlatformName,
+        MIC_MediaTypeId,
+        MIC_MediaTypeName
+   };
+
+
 protected:
     virtual QString constructSelect(QString whereClause = "") const;
     virtual QString constructSelectById(int id) const;