Merge lp:~stolowski/unity-scopes-shell/fix-delete-later into lp:unity-scopes-shell

Proposed by Paweł Stołowski
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 150
Merged at revision: 152
Proposed branch: lp:~stolowski/unity-scopes-shell/fix-delete-later
Merge into: lp:unity-scopes-shell
Diff against target: 33 lines (+5/-1)
2 files modified
src/Unity/scopes.cpp (+1/-1)
tests/favoritestest.cpp (+4/-0)
To merge this branch: bzr merge lp:~stolowski/unity-scopes-shell/fix-delete-later
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Albert Astals Cid (community) Approve
Review via email: mp+236349@code.launchpad.net

Commit message

Fix signature of the deleteLater slot when scheduling scope for removal after un-favoriting.

Description of the change

Fix signature of the deleteLater slot when scheduling scope for removal after un-favoriting.

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good, test passes with patch and not without.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Unity/scopes.cpp'
2--- src/Unity/scopes.cpp 2014-09-10 11:47:01 +0000
3+++ src/Unity/scopes.cpp 2014-09-29 14:27:13 +0000
4@@ -276,7 +276,7 @@
5 (*it)->setFavorite(false);
6 //
7 // we need to delay actual deletion of Scope object so that shell can animate it
8- QTimer::singleShot(1000 * SCOPE_DELETE_DELAY, (*it), SLOT(deleteLater));
9+ QTimer::singleShot(1000 * SCOPE_DELETE_DELAY, (*it), SLOT(deleteLater()));
10 it = m_scopes.erase(it);
11 endRemoveRows();
12 }
13
14=== modified file 'tests/favoritestest.cpp'
15--- tests/favoritestest.cpp 2014-09-15 12:03:13 +0000
16+++ tests/favoritestest.cpp 2014-09-29 14:27:13 +0000
17@@ -100,12 +100,16 @@
18
19 // unfavorite 1st scope
20 QSignalSpy spy(scope1, SIGNAL(favoriteChanged(bool)));
21+ QSignalSpy spy2(scope1, SIGNAL(destroyed(QObject *)));
22 scope1->setFavorite(false);
23 QTRY_COMPARE(spy.count(), 1);
24 QTRY_COMPARE(m_scopes->rowCount(), 1);
25 QVERIFY(m_scopes->getScopeById("mock-scope-departments") == nullptr);
26 QCOMPARE(m_scopes->data(m_scopes->index(0), Scopes::RoleId), QVariant(QString("mock-scope-double-nav")));
27
28+ // the scope should be destroyed after un-favoriting
29+ QTRY_COMPARE(spy2.count(), 1);
30+
31 // favorite a scope
32 auto overviewScope = m_scopes->overviewScope();
33 QVERIFY(overviewScope != nullptr);

Subscribers

People subscribed via source and target branches

to all changes: