summaryrefslogtreecommitdiffstats
path: root/mainwindow.cpp
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2009-09-27 17:21:26 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2009-09-27 17:21:26 -0400
commit89c443bd183ffe579625d94545026d7243207a9f (patch)
tree178480cdedbc7c839cc18f5fd78f4b7b08c36cbc /mainwindow.cpp
parentAdd from ISO (diff)
downloadAnyRip-89c443bd183ffe579625d94545026d7243207a9f.tar.xz
AnyRip-89c443bd183ffe579625d94545026d7243207a9f.zip
Termination, slotted dvd title loading, framework fixes.
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 29925ec..e89df5a 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -15,6 +15,18 @@
MainWindow::MainWindow()
{
+ QSettings settings;
+ settings.beginGroup(QLatin1String("Videos"));
+ //We delay adding because addVideo needs things to be contructed.
+ //We need to remove bad entries though because other constructors here rely on our settings
+ QList<Video*> toAdd;
+ foreach(QString title, settings.childGroups()) {
+ Video *video = new Video(title, this);
+ if (video->isJobCompleted(Video::DVDImage))
+ toAdd.append(video);
+ else
+ settings.remove(title);
+ }
m_queue = new VideoQueue;
connect(m_queue, SIGNAL(runningJob(Job*)), this, SLOT(runningJob(Job*)));
m_videoGuis = new QVBoxLayout;
@@ -30,15 +42,8 @@ MainWindow::MainWindow()
NewImageGui *newImageGui = new NewImageGui;
connect(newImageGui, SIGNAL(newImage(QString,QString)), this, SLOT(newVideoFromImage(QString,QString)));
m_jobGuis->addWidget(newImageGui, 0, Qt::AlignTop);
- QSettings settings;
- settings.beginGroup(QLatin1String("Videos"));
- foreach(QString title, settings.childGroups()) {
- Video *video = new Video(title, this);
- if (video->isJobCompleted(Video::DVDImage))
- addVideo(video);
- else
- settings.remove(title);
- }
+ foreach (Video *video, toAdd)
+ addVideo(video);
setLayout(layout);
}
void MainWindow::addVideo(Video *video)