~feng-kylin/unity8/fix-lp1413791

« back to all changes in this revision

Viewing changes to tests/mocks/Unity/fake_scope.cpp

Merged with unity-team's shellRotation branch and fixed conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "fake_scopes.h"
25
25
#include "fake_settingsmodel.h"
26
26
 
 
27
#include <paths.h> // from unity8/include
 
28
 
27
29
Scope::Scope(Scopes* parent) : Scope("MockScope5", "Mock Scope", false, parent)
28
30
{
29
31
}
249
251
        m["foreground-color"] = "blue";
250
252
        m["page-header"] = h;
251
253
    } else if (m_id == "MockScope4") {
252
 
        h["navigation-background"] = QUrl("../../../tests/qmltests/Dash/artwork/background.png");
 
254
        h["navigation-background"] = QUrl(sourceDirectory() + "tests/qmltests/Dash/artwork/background.png");
253
255
        m["page-header"] = h;
254
256
    } else if (m_id == "MockScope5") {
255
257
        h["background"] = "gradient:///lightgrey/grey";
256
 
        h["logo"] = QUrl("../../../tests/qmltests/Dash/tst_PageHeader/logo-ubuntu-orange.svg");
 
258
        h["logo"] = QUrl(sourceDirectory() + "tests/qmltests/Dash/tst_PageHeader/logo-ubuntu-orange.svg");
257
259
        h["divider-color"] = "red";
258
260
        h["navigation-background"] = "color:///black";
259
261
        m["page-header"] = h;
310
312
        Q_EMIT currentNavigationIdChanged();
311
313
    }
312
314
}
 
315
 
 
316
void Scope::performQuery(const QString& query)
 
317
{
 
318
    Q_EMIT queryPerformed(query);
 
319
    if (query.startsWith("scopes://")) {
 
320
        QString scopeId = query.mid(9);
 
321
        Q_EMIT gotoScope(scopeId);
 
322
    }
 
323
}