Commit 1302a16d authored by Camilo higuita's avatar Camilo higuita

finish movement to maui fm modeling

parent 7e2658ea
......@@ -52,7 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "./src/models/basemodel.h"
#include "./src/models/baselist.h"
#include "./src/models/gallery/gallery.h"
//#include "./src/models/albums/albums.h"
#include "./src/models/albums/albums.h"
#include "./src/models/folders/foldermodel.h"
#include "./src/models/folders/folders.h"
......@@ -135,13 +135,13 @@ int main(int argc, char *argv[])
context->setContextProperty("tag", dba->tag);
context->setContextProperty("dba", dba);
// qmlRegisterUncreatableMetaObject(PIX::staticMetaObject, "PIX", 1, 0, "KEY", "Error");
qmlRegisterUncreatableMetaObject(PIX::staticMetaObject, "PIX", 1, 0, "KEY", "Error");
qmlRegisterUncreatableType<BaseList>("BaseList", 1, 0, "BaseList", QStringLiteral("BaseList should not be created in QML"));
qmlRegisterType<BaseModel>("PixModel", 1, 0, "PixModel");
qmlRegisterType<Gallery>("GalleryList", 1, 0, "GalleryList");
// qmlRegisterType<Albums>("AlbumsList", 1, 0, "AlbumsList");
qmlRegisterType<Albums>("AlbumsList", 1, 0, "AlbumsList");
qmlRegisterType<FolderModel>("FolderModel", 1, 0, "FolderModel");
qmlRegisterType<Folders>("FoldersList", 1, 0, "FoldersList");
......
......@@ -91,6 +91,7 @@ bool DBActions::insertPic(const FMH::MODEL &img)
{FMH::MODEL_NAME[FMH::MODEL_KEY::DATE], picDate},
{FMH::MODEL_NAME[FMH::MODEL_KEY::PLACE], place},
{FMH::MODEL_NAME[FMH::MODEL_KEY::ADDDATE], QDateTime::currentDateTime()}};
return this->insert(PIX::TABLEMAP[PIX::TABLE::IMAGES], imgMap);
}
......
CREATE TABLE IF NOT EXISTS SOURCES (
url TEXT PRIMARY KEY
);
CREATE TABLE IF NOT EXISTS ALBUMS (
album TEXT PRIMARY KEY,
adddate DATE
......@@ -15,7 +13,7 @@ tag TEXT PRIMARY KEY
CREATE TABLE IF NOT EXISTS IMAGES (
url TEXT PRIMARY KEY,
sources TEXT NOT NULL,
source TEXT NOT NULL,
title TEXT NOT NULL,
rate INTEGER NOT NULL,
fav INTEGER NOT NULL,
......@@ -25,7 +23,7 @@ date DATE,
place DATE,
format TEXT,
FOREIGN KEY(sources) REFERENCES SOURCES(url)
FOREIGN KEY(source) REFERENCES SOURCES(url)
);
CREATE TABLE IF NOT EXISTS IMAGES_TAGS (
......@@ -53,7 +51,6 @@ PRIMARY KEY (note, url),
FOREIGN KEY(url) REFERENCES IMAGES(url)
);
CREATE TABLE IF NOT EXISTS ALBUMS_TAGS (
tag TEXT NOT NULL,
album TEXT NOT NULL,
......@@ -70,3 +67,7 @@ album TEXT NOT NULL,
PRIMARY KEY (note, album),
FOREIGN KEY(album) REFERENCES ALBUMS(album)
);
INSERT INTO ALBUMS VALUES ("Favs", CURRENT_TIME);
INSERT INTO ALBUMS VALUES ("Recent", CURRENT_TIME);
COMMIT;
......@@ -8,6 +8,8 @@ import org.kde.mauikit 1.0 as Maui
import PIX 1.0
import PixModel 1.0
import GalleryList 1.0
import FMList 1.0
import "../widgets"
Maui.Page
......@@ -109,48 +111,48 @@ Maui.Page
{
text: qsTr("Title")
checkable: true
checked: pixList.sortBy === KEY.TITLE
onTriggered: pixList.sortBy = KEY.TITLE
checked: pixList.sortBy === FMList.TITLE
onTriggered: pixList.sortBy = FMList.TITLE
}
Maui.MenuItem
{
text: qsTr("Add date")
checkable: true
checked: pixList.sortBy === KEY.ADD_DATE
onTriggered: pixList.sortBy = KEY.ADD_DATE
checked: pixList.sortBy === FMList.ADDDATE
onTriggered: pixList.sortBy = FMList.ADDDATE
}
Maui.MenuItem
{
text: qsTr("Creation date")
checkable: true
checked: pixList.sortBy === KEY.PIC_DATE
onTriggered: pixList.sortBy = KEY.PIC_DATE
checked: pixList.sortBy === FMList.DATE
onTriggered: pixList.sortBy = FMList.DATE
}
Maui.MenuItem
{
text: qsTr("Place")
checkable: true
checked: pixList.sortBy === KEY.PLACE
onTriggered: pixList.sortBy = KEY.PLACE
checked: pixList.sortBy === FMList.PLACE
onTriggered: pixList.sortBy = FMList.PLACE
}
Maui.MenuItem
{
text: qsTr("Format")
checkable: true
checked: pixList.sortBy === KEY.FORMAT
onTriggered: pixList.sortBy = KEY.FORMAT
checked: pixList.sortBy === FMList.FORMAT
onTriggered: pixList.sortBy = FMList.FORMAT
}
Maui.MenuItem
{
text: qsTr("Size")
checkable: true
checked: pixList.sortBy === KEY.SIZE
onTriggered: pixList.sortBy = KEY.SIZE
checked: pixList.sortBy === FMList.SIZE
onTriggered: pixList.sortBy = FMList.SIZE
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment