From b5cbc3d5290972ea7c6e69ffc82f9a17801ac990 Mon Sep 17 00:00:00 2001 From: BasioMeusPuga Date: Mon, 6 Nov 2017 07:41:07 +0530 Subject: [PATCH] Changes to database --- __main__.py | 6 ++++-- database.py | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/__main__.py b/__main__.py index 55031c4..4137947 100755 --- a/__main__.py +++ b/__main__.py @@ -13,6 +13,7 @@ sqlite3 for storing metadata sqlite3 for caching files open @ time of exit sqlite3 for cover images cache + Use format* icons for toolbar buttons Information dialog widget Check file hashes upon restart Recursive file addition @@ -103,8 +104,8 @@ class MainUI(QtWidgets.QMainWindow, mainwindow.Ui_MainWindow): def populatelist(self): self.listView.setWindowTitle('huh') - # The QlistView widget needs to be populated with a model that - # inherits from QStandardItemModel + # The QlistView widget needs to be populated + # with a model that inherits from QStandardItemModel model = QtGui.QStandardItemModel() # Get the list of images from here @@ -224,6 +225,7 @@ class Tabs: class Database: + # This is maybe, possibly, redundant def __init__(self, parent): self.parent_window = parent self.database_path = QtCore.QStandardPaths.writableLocation( diff --git a/database.py b/database.py index a80599c..d0ce4c4 100644 --- a/database.py +++ b/database.py @@ -18,4 +18,10 @@ class DatabaseFunctions: self.database.execute( "CREATE TABLE books \ (id INTEGER PRIMARY KEY, Name TEXT, Path TEXT, ISBN TEXT, CoverImage BLOB)") + self.database.execute( + "CREATE TABLE cache \ + (id INTEGER PRIMARY KEY, Name TEXT, Path TEXT, CachedDict BLOB)") + # It's assumed that any cached books will be pickled and put into the + # database at time of closing + self.database.commit()