@@ -28,7 +28,7 @@ Scope::Scope(Scopes* parent) : Scope(QString(), QString(), false, parent)
2828{
2929}
3030
31−Scope::Scope(QString const& id, QString const& name, bool favorite, Scopes* parent, int categories)
31+Scope::Scope(QString const& id, QString const& name, bool favorite, Scopes* parent, int categories, bool returnNullPreview)
3232 : unity::shell::scopes::ScopeInterface(parent)
3333 , m_id(id)
3434 , m_name(name)
@@ -41,6 +41,7 @@ Scope::Scope(QString const& id, QString const& name, bool favorite, Scopes* pare
4141 , m_categories(new Categories(categories, this))
4242 , m_openScope(nullptr)
4343 , m_settings(new SettingsModel(this))
44+ , m_returnNullPreview(returnNullPreview)
4445{
4546}
4647
@@ -175,9 +176,16 @@ PreviewStack* Scope::preview(QVariant const& result)
175176{
176177 Q_UNUSED(result);
177178
178− // This probably leaks, do we don't care
179− // it's a test after all
180− return new PreviewStack;
179+ if (m_returnNullPreview)
180+ {
181+ return nullptr;
182+ }
183+ else
184+ {
185+ // This probably leaks, do we don't care
186+ // it's a test after all
187+ return new PreviewStack;
188+ }
181189}
182190
183191void Scope::cancelActivation()