diff --git a/src/kdeclarative/CMakeLists.txt b/src/kdeclarative/CMakeLists.txt --- a/src/kdeclarative/CMakeLists.txt +++ b/src/kdeclarative/CMakeLists.txt @@ -6,7 +6,6 @@ kdeclarative.cpp private/kiconprovider.cpp private/kioaccessmanagerfactory.cpp - private/qmlobject_p.h ) add_library(KF5Declarative ${kdeclarative_SRCS}) diff --git a/src/kdeclarative/private/qmlobject_p.h b/src/kdeclarative/private/qmlobject_p.h deleted file mode 100644 --- a/src/kdeclarative/private/qmlobject_p.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2013 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef QMLOBJECT_P_H -#define QMLOBJECT_P_H - -#include -#include - -#include -#include -#include -#include - -class QQmlEngine; -class QQmlComponent; - -namespace KDeclarative { - -class QmlObjectIncubationController : public QObject, public QQmlIncubationController -{ - Q_OBJECT - -public: - QmlObjectIncubationController(QObject *parent) - : QObject(parent), - QQmlIncubationController() - { - // Allow incubation for 1/3 of a frame. - m_incubation_time = qMax(1, int(1000 / QGuiApplication::primaryScreen()->refreshRate()) / 3); - } - -protected: - bool event(QEvent *e) Q_DECL_OVERRIDE - { - if (e->type() == QEvent::User) { - incubate(); - return true; - } - return QObject::event(e); - } - -public Q_SLOTS: - void incubate() - { - if (incubatingObjectCount()) { - incubateFor(m_incubation_time * 2); - if (incubatingObjectCount()) { - QCoreApplication::postEvent(this, new QEvent(QEvent::User)); - } - } - } - - void animationStopped() - { - incubate(); - } - -protected: - void incubatingObjectCountChanged(int count) Q_DECL_OVERRIDE - { - if (count) { - incubate(); - } - QQmlIncubationController::incubatingObjectCountChanged(count); - } -private: - int m_incubation_time; -}; - -} - -#endif // multiple inclusion guard diff --git a/src/kdeclarative/qmlobject.cpp b/src/kdeclarative/qmlobject.cpp --- a/src/kdeclarative/qmlobject.cpp +++ b/src/kdeclarative/qmlobject.cpp @@ -18,7 +18,6 @@ */ #include "qmlobject.h" -#include "private/qmlobject_p.h" #include "private/kdeclarative_p.h" #include @@ -151,7 +150,6 @@ d->kdeclarative.d->qmlObj = this; //binds things like kconfig and icons d->kdeclarative.setupBindings(); - d->engine->setIncubationController(new QmlObjectIncubationController(this)); } QmlObject::QmlObject(QQmlEngine *engine, QObject *parent) @@ -162,7 +160,6 @@ d->engine = engine; } else { d->engine = new QQmlEngine(this); - d->engine->setIncubationController(new QmlObjectIncubationController(this)); } d->rootContext = d->engine->rootContext(); d->kdeclarative.setDeclarativeEngine(d->engine); @@ -179,7 +176,6 @@ d->engine = engine; } else { d->engine = new QQmlEngine(this); - d->engine->setIncubationController(new QmlObjectIncubationController(0)); } if (rootContext) { diff --git a/src/kdeclarative/qmlobjectsharedengine.cpp b/src/kdeclarative/qmlobjectsharedengine.cpp --- a/src/kdeclarative/qmlobjectsharedengine.cpp +++ b/src/kdeclarative/qmlobjectsharedengine.cpp @@ -18,7 +18,6 @@ */ #include "qmlobjectsharedengine.h" -#include "private/qmlobject_p.h" #include #include @@ -54,7 +53,6 @@ { if (!s_engine) { s_engine = std::make_shared(); - s_engine->setIncubationController(new QmlObjectIncubationController(0)); } return s_engine.get(); }