[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.
icc-effect-5.14.5
Martin Gräßlin 2014-01-03 11:24:23 +01:00
parent e05a97f216
commit 33921a9535
1 changed files with 4 additions and 0 deletions

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) {