[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:
parent
e05a97f216
commit
33921a9535
1 changed files with 4 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue