~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/plugin/ucactionitem.cpp

  • Committer: CI Train Bot
  • Author(s): Christian Dywan, Zsombor Egri, Zoltán Balogh, Tim Peeters, Albert Astals Cid, Michael Sheldon, Benjamin Zeller
  • Date: 2015-12-17 17:13:49 UTC
  • mfrom: (1000.739.27 OTA9-landing-2015-12-16)
  • Revision ID: ci-train-bot@canonical.com-20151217171349-8xwclnhnx8v9oz4m
OTA9-landing-2015-12-16
Approved by: Zoltan Balogh

Show diffs side-by-side

added added

removed removed

Lines of Context:
233
233
void UCActionItem::setText(const QString &text)
234
234
{
235
235
    Q_D(UCActionItem);
236
 
    if (d->text == text) {
237
 
        return;
238
 
    }
239
 
    d->text = text;
 
236
 
240
237
    if (d->action && !(d->flags & UCActionItemPrivate::CustomText)) {
241
238
        // disconnect change signal from Action
242
239
        disconnect(d->action, &UCAction::textChanged,
243
240
                   this, &UCActionItem::textChanged);
244
241
    }
245
242
    d->flags |= UCActionItemPrivate::CustomText;
 
243
 
 
244
    if (d->text == text) {
 
245
        return;
 
246
    }
 
247
    d->text = text;
246
248
    Q_EMIT textChanged();
247
249
}
248
250
void UCActionItem::resetText()
279
281
void UCActionItem::setIconSource(const QUrl &iconSource)
280
282
{
281
283
    Q_D(UCActionItem);
282
 
    if (d->iconSource == iconSource) {
283
 
        return;
284
 
    }
285
 
    d->iconSource = iconSource;
 
284
 
286
285
    if (d->action && !(d->flags & UCActionItemPrivate::CustomIconSource)) {
287
286
        // disconnect change signal from Action
288
287
        disconnect(d->action, &UCAction::iconSourceChanged,
289
288
                   this, &UCActionItem::iconSourceChanged);
290
289
    }
291
290
    d->flags |= UCActionItemPrivate::CustomIconSource;
 
291
 
 
292
    if (d->iconSource == iconSource) {
 
293
        return;
 
294
    }
 
295
    d->iconSource = iconSource;
292
296
    Q_EMIT iconSourceChanged();
293
297
}
294
298
void UCActionItem::resetIconSource()
330
334
void UCActionItem::setIconName(const QString &iconName)
331
335
{
332
336
    Q_D(UCActionItem);
333
 
    if (d->iconName == iconName) {
334
 
        return;
335
 
    }
336
 
    d->iconName = iconName;
 
337
 
337
338
    if (d->action && !(d->flags & UCActionItemPrivate::CustomIconName)) {
338
339
        // disconnect change signal from Action
339
340
        disconnect(d->action, &UCAction::iconNameChanged,
340
341
                   this, &UCActionItem::iconNameChanged);
341
342
    }
342
343
    d->flags |= UCActionItemPrivate::CustomIconName;
 
344
 
 
345
    if (d->iconName == iconName) {
 
346
        return;
 
347
    }
 
348
    d->iconName = iconName;
343
349
    Q_EMIT iconNameChanged();
344
350
    // also sync iconSource if that is not a custom one or taken from action
345
351
    if (!d->action || (d->flags & UCActionItemPrivate::CustomIconSource)) {