Bläddra i källkod

Remove all error messages

Change-Id: I6c0300d9ddaf3e56a594989b35328efada204014
Donald Carr 9 år sedan
förälder
incheckning
3716a7b162
2 ändrade filer med 7 tillägg och 1 borttagningar
  1. 2 0
      main.cpp
  2. 5 1
      picturemodel.cpp

+ 2 - 0
main.cpp

@@ -45,5 +45,7 @@ int main(int argc, char *argv[])
     engine.rootContext()->setContextProperty("imageModel", model);
     engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
 
+    QObject::connect(&app, &QGuiApplication::lastWindowClosed, &scanningThread, &QThread::quit);
+
     return app.exec();
 }

+ 5 - 1
picturemodel.cpp

@@ -1,8 +1,8 @@
 #include "picturemodel.h"
 
 #include <QDir>
-
 #include <QDebug>
+#include <QCoreApplication>
 
 struct FSNode {
   FSNode(const QString& rname, const FSNode *pparent = nullptr)
@@ -24,6 +24,8 @@ PictureModel::~PictureModel()
 
 void PictureModel::addModelNode(const FSNode* parentNode)
 {
+    QCoreApplication::processEvents();
+
     // TODO: Check for symlink recursion
     QDir parentDir(qualifyNode(parentNode));
 
@@ -58,6 +60,7 @@ void PictureModel::setModelRoot(const QString &root)
 
 int PictureModel::rowCount(const QModelIndex &parent) const
 {
+    Q_UNUSED(parent)
     return files.length();
 }
 
@@ -68,6 +71,7 @@ QString PictureModel::randomPicture() const
 
 QVariant PictureModel::data(const QModelIndex &index, int role) const
 {
+    Q_UNUSED(role)
     if (index.row() < 0 || index.row() >= files.length())
         return QVariant();