[kcm-kwintabbox] Add a debug message on failed QML loading

If the Layout Preview fails to load the Qml, at least show a debug
message to see what's going wrong.
This commit is contained in:
Martin Gräßlin 2014-01-03 11:24:23 +01:00
parent e05a97f216
commit 33921a9535

View file

@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "layoutpreview.h"
#include "thumbnailitem.h"
#include <QApplication>
#include <QDebug>
#include <QDesktopWidget>
#include <QQmlEngine>
#include <QQmlContext>
@ -45,6 +46,9 @@ LayoutPreview::LayoutPreview(const QString &path, QObject *parent)
qmlRegisterType<SwitcherItem>("org.kde.kwin", 2, 0, "Switcher");
qmlRegisterType<QAbstractItemModel>();
component->loadUrl(QUrl::fromLocalFile(path));
if (component->isError()) {
qDebug() << component->errorString();
}
QObject *item = component->create();
auto findSwitcher = [item]() -> SwitcherItem* {
if (!item) {