Changeset View
Changeset View
Standalone View
Standalone View
commands/imagelib/effects/kpEffectCommandBase.cpp
Show All 33 Lines | |||||
34 | 34 | | |||
35 | #include <KLocalizedString> | 35 | #include <KLocalizedString> | ||
36 | 36 | | |||
37 | //-------------------------------------------------------------------------------- | 37 | //-------------------------------------------------------------------------------- | ||
38 | 38 | | |||
39 | struct kpEffectCommandBasePrivate | 39 | struct kpEffectCommandBasePrivate | ||
40 | { | 40 | { | ||
41 | QString name; | 41 | QString name; | ||
42 | bool actOnSelection; | 42 | bool actOnSelection{false}; | ||
43 | 43 | | |||
44 | kpImage oldImage; | 44 | kpImage oldImage; | ||
45 | }; | 45 | }; | ||
46 | 46 | | |||
47 | kpEffectCommandBase::kpEffectCommandBase (const QString &name, | 47 | kpEffectCommandBase::kpEffectCommandBase (const QString &name, | ||
48 | bool actOnSelection, | 48 | bool actOnSelection, | ||
49 | kpCommandEnvironment *environ) | 49 | kpCommandEnvironment *environ) | ||
50 | : kpCommand (environ), | 50 | : kpCommand (environ), | ||
51 | d (new kpEffectCommandBasePrivate ()) | 51 | d (new kpEffectCommandBasePrivate ()) | ||
52 | { | 52 | { | ||
53 | d->name = name; | 53 | d->name = name; | ||
54 | d->actOnSelection = actOnSelection; | 54 | d->actOnSelection = actOnSelection; | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | kpEffectCommandBase::~kpEffectCommandBase () | 57 | kpEffectCommandBase::~kpEffectCommandBase () | ||
58 | { | 58 | { | ||
59 | delete d; | 59 | delete d; | ||
60 | } | 60 | } | ||
61 | 61 | | |||
62 | 62 | | |||
63 | // public virtual [base kpCommand] | 63 | // public virtual [base kpCommand] | ||
64 | QString kpEffectCommandBase::name () const | 64 | QString kpEffectCommandBase::name () const | ||
65 | { | 65 | { | ||
66 | if (d->actOnSelection) | 66 | return (d->actOnSelection) ? i18n ("Selection: %1", d->name) : d->name; | ||
67 | return i18n ("Selection: %1", d->name); | | |||
68 | else | | |||
69 | return d->name; | | |||
70 | } | 67 | } | ||
71 | 68 | | |||
72 | 69 | | |||
73 | // public virtual [base kpCommand] | 70 | // public virtual [base kpCommand] | ||
74 | kpCommandSize::SizeType kpEffectCommandBase::size () const | 71 | kpCommandSize::SizeType kpEffectCommandBase::size () const | ||
75 | { | 72 | { | ||
76 | return ImageSize (d->oldImage); | 73 | return ImageSize (d->oldImage); | ||
77 | } | 74 | } | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |