split switcher and traverser to prepare for shuffle mode

This commit is contained in:
Manuel
2020-02-13 21:52:17 +01:00
parent 0eb9596095
commit db09dc43f2
8 changed files with 189 additions and 77 deletions

View File

@@ -4,12 +4,12 @@
#include <QDirIterator>
#include <QTimer>
#include <QApplication>
#include <QDir>
#include <iostream>
#include <memory>
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
ImageSwitcher::ImageSwitcher(MainWindow& w, unsigned int timeout, const ImageSelector& selector):
ImageSwitcher::ImageSwitcher(MainWindow& w, unsigned int timeout, std::unique_ptr<ImageSelector>& selector):
QObject::QObject(),
window(w),
timeout(timeout),
@@ -20,7 +20,7 @@ ImageSwitcher::ImageSwitcher(MainWindow& w, unsigned int timeout, const ImageSel
void ImageSwitcher::updateImage()
{
std::string filename(selector.getNextImage());
std::string filename(selector->getNextImage());
if (filename == "")
{
window.warn("No image found.");