report success on tablet->pushOntoStack

This commit is contained in:
Zach Pomerantz 2017-05-26 17:09:39 -04:00
parent cfbbf3183a
commit 297993b358
2 changed files with 6 additions and 2 deletions

View file

@ -439,7 +439,7 @@ void TabletProxy::loadQMLSource(const QVariant& path) {
}
}
void TabletProxy::pushOntoStack(const QVariant& path) {
bool TabletProxy::pushOntoStack(const QVariant& path) {
QObject* root = nullptr;
if (!_toolbarMode && _qmlTabletRoot) {
root = _qmlTabletRoot;
@ -457,6 +457,8 @@ void TabletProxy::pushOntoStack(const QVariant& path) {
} else {
qCDebug(scriptengine) << "tablet cannot push QML because _qmlTabletRoot or _desktopWindow is null";
}
return root;
}
void TabletProxy::popFromStack() {

View file

@ -119,7 +119,9 @@ public:
Q_INVOKABLE void gotoWebScreen(const QString& url, const QString& injectedJavaScriptUrl);
Q_INVOKABLE void loadQMLSource(const QVariant& path);
Q_INVOKABLE void pushOntoStack(const QVariant& path);
// FIXME: This currently relies on a script initializing the tablet (hence the bool denoting success);
// it should be initialized internally so it cannot fail
Q_INVOKABLE bool pushOntoStack(const QVariant& path);
Q_INVOKABLE void popFromStack();
Q_INVOKABLE void loadQMLOnTop(const QVariant& path);