67{
68 while (!m_lytWdgBundles->isEmpty()) {
69 QLayoutItem *item = m_lytWdgBundles->takeAt(m_lytWdgBundles->count() - 1);
70 QWidget *widget = item->widget();
71 if (widget) {
72 widget->deleteLater();
73 }
74 delete item;
75 }
76
78
81
83
84
85
88 bundleWidgets.append(bundleWidget);
89 } else {
90 dbgResources <<
"No products for bundle" << bundle.fileName;
91 }
92 }
93
94 if (bundleWidgets.isEmpty()) {
95 m_lytWdgBundles->addStretch();
96 QLabel *label = new QLabel(i18n("No supporter bundles available."));
97 label->setAlignment(Qt::AlignCenter);
98 label->setWordWrap(true);
99 m_lytWdgBundles->addWidget(label);
100 m_lytWdgBundles->addStretch();
101 } else {
103
104
105
106
107 QLabel *purchaseNoteLabel =
108 new QLabel(i18n("These bundles have been made available by their authors to help provide rewards for "
109 "supporting Krita's development. They do not receive compensation for purchases and may "
110 "make these bundles in other ways behind the links below."));
111 purchaseNoteLabel->setTextFormat(Qt::PlainText);
112 purchaseNoteLabel->setWordWrap(true);
113 m_lytWdgBundles->addWidget(purchaseNoteLabel);
114
116 QFrame *separator = new QFrame;
117 separator->setFrameShape(QFrame::HLine);
118 separator->setFrameShadow(QFrame::Sunken);
119 m_lytWdgBundles->addWidget(separator);
120 m_lytWdgBundles->addWidget(bundleWidget);
121 }
122 m_lytWdgBundles->addStretch();
123 }
124}
static QVector< KisSupporterProduct > getProductsForBundle(const QVector< KisSupporterProduct > ¤tProducts, const KisSupporterBundle &bundle)
static bool couldOwnAnyProduct(const QVector< KisSupporterProduct > &bundleProducts)
static bool bundleWidgetLessThan(const KisSupporterBundleWidget *a, const KisSupporterBundleWidget *b)
QVector< KisSupporterProduct > getCurrentProducts() const