summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shemov.cpp')
-rw-r--r--shemov.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/shemov.cpp b/shemov.cpp
index 2e3ab90..2bfe8c0 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -42,6 +42,8 @@
#include "coverarchiveeditor.h"
#include "statisticsdialog.h"
#include "filesystemfileproxy.h"
+#include "moviemodelsingleton.h"
+#include "listmodelsingleton.h"
SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags), mOpenWithGroupFS(0), mOpenWithGroupAV(0) {
qApp->setWindowIcon(QIcon(":/shemov.png"));
@@ -60,9 +62,9 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla
QMessageBox::critical(this, tr("Error"), tr("Could not open database. Please configure the database and restart the program"));
}
- mMovieModel = new MovieModel(this);
- mGenreModel = new ListModel("genre", this);
- mActorModel = new ListModel("actor", this);
+ mMovieModel = MovieModelSingleton::instance();
+ mGenreModel = ListModelSingleton::instance()->model("genre");
+ mActorModel = ListModelSingleton::instance()->model("actor");
mFSWidget = new FilesystemWidget;
setWindowTitle(mFSWidget->windowTitle());
@@ -73,8 +75,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla
mTab->addTab(mAVWidget, tr("Archive"));
connect(mAVWidget, SIGNAL(windowTitle(const QString &)), this, SLOT(newWindowTitle(const QString &)));
- mAEdit = new ArchiveEditDialog(mGenreModel, mActorModel, this);
- mAEdit->setMovieModel(mMovieModel);
+ mAEdit = new ArchiveEditDialog(this);
mFSWidget->setArchiveDialog(mAEdit);
mAItemEdit = new EditArchiveItemDialog(mGenreModel, mActorModel, mMovieModel, this);