~cimi/unity8/card_touchdown

« back to all changes in this revision

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

  • Committer: Andrea Cimitan
  • Date: 2014-06-24 09:54:02 UTC
  • mfrom: (917.6.36 unity8)
  • Revision ID: andrea.cimitan@gmail.com-20140624095402-gaw0o3l8y9fmoqhz
[ Michał Sawicz ]
* Make so that fixedArtShapeSize actually fixes artShapeSize.
[ Albert Astals ]
* Add VerticalJournal integration to Dash/scopes/QML (LP: #1326467)
* Make so that fixedArtShapeSize actually fixes artShapeSize.
[ Mirco Müller ]
* Added the frontend-part of sound-hint support for notifications with
  updated QML-tests.
* New rebuild forced
[ Albert Astals ]
* Departments support (LP: #1320847)
[ Pawel Stolowski ]
* Extend the hack for click scope categories with the upcoming 'store'
  category: single-tap on results from the 'store' category should
  activate them, instead of requesting a preview. (LP: #1326292)
[ Albert Astals ]
* Drop the " Preview" suffix from Preview title As requested in
  https://bugs.launchpad.net/unity8/+bug/1316671 (LP: #1316671)
[ Michael Terry ]
* Revert split greeter for now.  We will bring it back as an option
  for Desktop, but use a big hammer revert right now to get Touch back
  in shape.
[ CI bot ]
* Fix build problems. Reviewed by: Michael Terry (LP: #1328850)
[ Michał Sawicz ]
* Make lockscreen buttons translatable.
[ Albert Astals ]
* Correctly mark these functions as overrides
* Remove connections to non existant signal
* Better test name
* Improvements for headerless categories LVPWH: No section name -> no
  header LVPWH: New hasSectionHeader context property for delegates
  GSV: Add topMargin if no hasSectionHeader (LP: #1326415)
* Make tryVerticalJournal, tryHorizontalJournal and tryOrganicGrid
  work again
[ Michael Zanetti ]
* Don't crash when we get an invalid app from ApplicationManager (LP:
  #1309162)
[ Andrea Cimitan ]
* Workaround for lp1324159 (LP: #1322233, #1324159)
[ CI bot ]
* Resync trunk
[ Florian Boucault ]
* Application startup: changed splash rectangle to be black instead of
  white and added a neat little animation. (LP: #1124265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 */
16
16
 
17
17
#include "fake_scope.h"
 
18
#include "fake_department.h"
18
19
#include "fake_resultsmodel.h"
19
20
 
20
21
Scope::Scope(QObject* parent) : Scope(QString(), QString(), false, parent)
28
29
    , m_visible(visible)
29
30
    , m_searching(false)
30
31
    , m_isActive(false)
 
32
    , m_currentDeparment("root")
31
33
    , m_previewRendererName("preview-generic")
32
34
    , m_categories(new Categories(20, this))
33
35
{
102
104
void Scope::setActive(const bool active) {
103
105
    if (active != m_isActive) {
104
106
        m_isActive = active;
105
 
        Q_EMIT isActiveChanged(active);
 
107
        Q_EMIT isActiveChanged();
106
108
    }
107
109
}
108
110
 
142
144
{
143
145
    qFatal("Scope::closeScope is not implemented");
144
146
}
 
147
 
 
148
QString Scope::currentDepartmentId() const
 
149
{
 
150
    return m_currentDeparment;
 
151
}
 
152
 
 
153
bool Scope::hasDepartments() const
 
154
{
 
155
    return true;
 
156
}
 
157
 
 
158
unity::shell::scopes::DepartmentInterface* Scope::getDepartment(const QString& id)
 
159
{
 
160
    if (id.isEmpty())
 
161
        return nullptr;
 
162
 
 
163
    QString parentId;
 
164
    QString parentLabel;
 
165
    if (id.startsWith("middle")) {
 
166
        parentId = "root";
 
167
        parentLabel = "root";
 
168
    } else if (id.startsWith("child")) {
 
169
        parentId = id.mid(5, 7);
 
170
        parentLabel = parentId;
 
171
    }
 
172
    return new Department(id, id, "all"+id, parentId, parentLabel, this);
 
173
}
 
174
 
 
175
void Scope::loadDepartment(const QString& id)
 
176
{
 
177
    m_currentDeparment = id;
 
178
    Q_EMIT currentDepartmentIdChanged();
 
179
}