From 130e0a3115cd66e38ec57846e06f69e7fd284400 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 3 Sep 2013 06:12:33 +0200 Subject: Switch to QRunnable + QThreadPool Get rid of SmDataCollector and do its job in small, QRunnable tasks and let QThreadPool manage the treads. Works well with a local Filesystem. Yet to see how it works over networked Filesystems. Ah, before I forget: NEVER, EVER USE QPixmap in THREADS -> Random crashes! (Yes, I know, it's documented...) --- helper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'helper.cpp') diff --git a/helper.cpp b/helper.cpp index cff490c..102e0f3 100644 --- a/helper.cpp +++ b/helper.cpp @@ -305,9 +305,9 @@ namespace Helper { } QVariant picSize(const QString &path){ - QPixmap pm(path); - if(!pm.isNull()){ - QString retval = QString("%1x%2").arg(QString::number(pm.width())).arg(QString::number(pm.height())); + QImage img(path); + if(!img.isNull()){ + QString retval = QString("%1x%2").arg(QString::number(img.width())).arg(QString::number(img.height())); return retval; } return QVariant(); -- cgit v1.2.3-70-g09d2