aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-09-26 13:19:42 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-26 14:40:44 +0200
commita90585a246de4ae800432b94ab3ca102f9e8b2bc (patch)
tree830f019f8c69c65ea896f74a12a04c39034def4a /src
parentc4115a247a16fcbb96cc26d19117282860f74a38 (diff)
Fix QWinJumpList::clear() for recent & frequent categories
It must actually instantiate the recent & frequent categories in order for clear() to be effective. Change-Id: Ic3fc9c95a1170b21f257637eaaac080e1c30db9a Reviewed-by: Ivan Vizir <define-true-false@yandex.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/winextras/qwinjumplist.cpp44
-rw-r--r--src/winextras/qwinjumplist_p.h2
2 files changed, 17 insertions, 29 deletions
diff --git a/src/winextras/qwinjumplist.cpp b/src/winextras/qwinjumplist.cpp
index 6fd61c9..e6f2bb0 100644
--- a/src/winextras/qwinjumplist.cpp
+++ b/src/winextras/qwinjumplist.cpp
@@ -140,31 +140,15 @@ void QWinJumpListPrivate::_q_rebuild()
dirty = false;
}
-void QWinJumpListPrivate::destroy(bool clear)
+void QWinJumpListPrivate::destroy()
{
- if (recent) {
- if (clear)
- recent->clear();
- delete recent;
- recent = 0;
- }
- if (frequent) {
- if (clear)
- frequent->clear();
- delete frequent;
- frequent = 0;
- }
- if (tasks) {
- if (clear)
- tasks->clear();
- delete tasks;
- tasks = 0;
- }
- foreach (QWinJumpListCategory *category, categories) {
- if (clear)
- category->clear();
- delete category;
- }
+ delete recent;
+ recent = 0;
+ delete frequent;
+ frequent = 0;
+ delete tasks;
+ tasks = 0;
+ qDeleteAll(categories);
categories.clear();
invalidate();
}
@@ -440,8 +424,7 @@ QWinJumpList::~QWinJumpList()
d->pDestList->Release();
d->pDestList = 0;
}
- const bool clear = false;
- d->destroy(clear);
+ d->destroy();
}
/*!
@@ -525,8 +508,13 @@ QWinJumpListCategory *QWinJumpList::addCategory(const QString &title, const QLis
void QWinJumpList::clear()
{
Q_D(QWinJumpList);
- const bool clear = true;
- d->destroy(clear);
+ recent()->clear();
+ frequent()->clear();
+ if (d->tasks)
+ d->tasks->clear();
+ foreach (QWinJumpListCategory *category, d->categories)
+ category->clear();
+ d->destroy();
}
QT_END_NAMESPACE
diff --git a/src/winextras/qwinjumplist_p.h b/src/winextras/qwinjumplist_p.h
index c30d64b..ca21e33 100644
--- a/src/winextras/qwinjumplist_p.h
+++ b/src/winextras/qwinjumplist_p.h
@@ -65,7 +65,7 @@ public:
void invalidate();
void _q_rebuild();
- void destroy(bool clear);
+ void destroy();
bool beginList();
bool commitList();