summaryrefslogtreecommitdiffstats
path: root/src/core/jobs/qthreadpooler.cpp
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2017-05-24 12:09:44 +0100
committerSean Harmer <sean.harmer@kdab.com>2017-05-24 12:10:02 +0100
commit77d294db076dac19e8b549b445ffede9f7260c84 (patch)
tree828ee7a6862ec5c0bd24f97cb540625a2c647376 /src/core/jobs/qthreadpooler.cpp
parent59f8fec8a41606b3185fe3a4e276978e3e1ed5ef (diff)
parent939b9b4b7591e8a421cf048a0a84ed3e75d81d21 (diff)
Merge branch 'dev' into wip/animationwip/animation
Diffstat (limited to 'src/core/jobs/qthreadpooler.cpp')
-rw-r--r--src/core/jobs/qthreadpooler.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/core/jobs/qthreadpooler.cpp b/src/core/jobs/qthreadpooler.cpp
index 35e2df2a1..8ad6f7f0a 100644
--- a/src/core/jobs/qthreadpooler.cpp
+++ b/src/core/jobs/qthreadpooler.cpp
@@ -38,16 +38,17 @@
****************************************************************************/
#include "qthreadpooler_p.h"
-#include "dependencyhandler_p.h"
-
-#include <QDebug>
+#include <Qt3DCore/qt3dcore-config.h>
+#include <QtCore/QDebug>
#ifdef QT3D_JOBS_RUN_STATS
-#include <QFile>
-#include <QThreadStorage>
-#include <QDateTime>
+#include <QtCore/QFile>
+#include <QtCore/QThreadStorage>
+#include <QtCore/QDateTime>
#endif
+#include <Qt3DCore/private/dependencyhandler_p.h>
+
QT_BEGIN_NAMESPACE
namespace Qt3DCore {
@@ -57,10 +58,11 @@ QElapsedTimer QThreadPooler::m_jobsStatTimer;
#endif
QThreadPooler::QThreadPooler(QObject *parent)
- : QObject(parent),
- m_futureInterface(nullptr),
- m_mutex(),
- m_taskCount(0)
+ : QObject(parent)
+ , m_futureInterface(nullptr)
+ , m_mutex()
+ , m_dependencyHandler(nullptr)
+ , m_taskCount(0)
{
// Ensures that threads will never be recycled
m_threadPool.setExpiryTimeout(-1);
@@ -196,7 +198,12 @@ void QThreadPooler::writeFrameJobLogStats()
static QScopedPointer<QFile> traceFile;
static quint32 frameId = 0;
if (!traceFile) {
- traceFile.reset(new QFile(QStringLiteral("trace_") + QDateTime::currentDateTime().toString() + QStringLiteral(".qt3d")));
+ const QString fileName = QStringLiteral("trace_") + QCoreApplication::applicationName() + QDateTime::currentDateTime().toString(QStringLiteral("_ddd_dd_MM_yy-hh_mm_ss_"))+ QSysInfo::productType() + QStringLiteral("_") + QSysInfo::buildAbi() + QStringLiteral(".qt3d");
+#ifdef Q_OS_ANDROID
+ traceFile.reset(new QFile(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + QStringLiteral("/") + fileName));
+#else
+ traceFile.reset(new QFile(fileName));
+#endif
if (!traceFile->open(QFile::WriteOnly|QFile::Truncate))
qCritical("Failed to open trace file");
}