aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-09-26 13:36:52 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-26 16:04:03 +0200
commit08872e2e5759898ee08311b8882a865b9ecd53a4 (patch)
tree4e9ab0e3752e3dfe7cd299ca9105c0239a2a1434 /src
parentc070b93d902de34ea0f3d2a71b8e9ab356e3e2fa (diff)
QWinJumpListCategory: ignore and warn about unsupported item types
Change-Id: I119fba0938c3cb3caab7545ced18106051b531ac 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/qwinjumplistcategory.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/winextras/qwinjumplistcategory.cpp b/src/winextras/qwinjumplistcategory.cpp
index bab65ca..c338bf6 100644
--- a/src/winextras/qwinjumplistcategory.cpp
+++ b/src/winextras/qwinjumplistcategory.cpp
@@ -239,6 +239,17 @@ void QWinJumpListCategory::addItem(QWinJumpListItem *item)
if (!item)
return;
+ if (d->type == Recent || d->type == Frequent) {
+ if (item->type() == QWinJumpListItem::Separator) {
+ qWarning("QWinJumpListCategory::addItem(): only tasks/custom categories support separators.");
+ return;
+ }
+ if (item->type() == QWinJumpListItem::Destination) {
+ qWarning("QWinJumpListCategory::addItem(): only tasks/custom categories support destinations.");
+ return;
+ }
+ }
+
QWinJumpListItemPrivate *p = QWinJumpListItemPrivate::get(item);
if (p->category != this) {
p->category = this;
@@ -293,11 +304,6 @@ QWinJumpListItem *QWinJumpListCategory::addLink(const QIcon &icon, const QString
*/
QWinJumpListItem *QWinJumpListCategory::addSeparator()
{
- Q_D(QWinJumpListCategory);
- if (d->type != Tasks) {
- qWarning("QWinJumpListCategory::addSeparator(): only tasks category supports separators.");
- return 0;
- }
QWinJumpListItem *item = new QWinJumpListItem(QWinJumpListItem::Separator);
addItem(item);
return item;