Diffstat (limited to 'noncore/apps/opie-reader/StyleConsts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/StyleConsts.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/noncore/apps/opie-reader/StyleConsts.cpp b/noncore/apps/opie-reader/StyleConsts.cpp index e111dbd..9fb56b7 100644 --- a/noncore/apps/opie-reader/StyleConsts.cpp +++ b/noncore/apps/opie-reader/StyleConsts.cpp | |||
@@ -1,40 +1,35 @@ | |||
1 | 1 | ||
2 | #include <qpixmap.h> | 2 | #include <qimage.h> |
3 | #include "StyleConsts.h" | 3 | #include "StyleConsts.h" |
4 | 4 | ||
5 | GraphicLink::~GraphicLink() { delete graphic; } | 5 | GraphicLink::~GraphicLink() { delete graphic; } |
6 | 6 | ||
7 | pmstore::~pmstore() | 7 | pmstore::~pmstore() |
8 | { | 8 | { |
9 | // qDebug("Deleting image"); | 9 | //// qDebug("Deleting image"); |
10 | delete graphic; | 10 | delete graphic; |
11 | } | 11 | } |
12 | 12 | ||
13 | CStyle::~CStyle() | 13 | CStyle::~CStyle() |
14 | { | 14 | { |
15 | if (graphic != NULL) | 15 | if (graphic != NULL) |
16 | { | 16 | { |
17 | if (--(graphic->count) == 0) | 17 | if (--(graphic->count) == 0) |
18 | { | 18 | { |
19 | delete graphic; | 19 | delete graphic; |
20 | } | 20 | } |
21 | } | 21 | } |
22 | } | 22 | } |
23 | 23 | ||
24 | CStyle::CStyle(CStyle& rhs) : graphic(NULL) | ||
25 | { | ||
26 | *this = rhs; | ||
27 | } | ||
28 | |||
29 | CStyle::CStyle(const CStyle& rhs) : graphic(NULL) | 24 | CStyle::CStyle(const CStyle& rhs) : graphic(NULL) |
30 | { | 25 | { |
31 | *this = rhs; | 26 | *this = rhs; |
32 | } | 27 | } |
33 | 28 | ||
34 | CStyle& CStyle::operator=(const CStyle& rhs) | 29 | CStyle& CStyle::operator=(const CStyle& rhs) |
35 | { | 30 | { |
36 | if (rhs.graphic != NULL) | 31 | if (rhs.graphic != NULL) |
37 | { | 32 | { |
38 | (rhs.graphic->count)++; | 33 | (rhs.graphic->count)++; |
39 | if (graphic != NULL) | 34 | if (graphic != NULL) |
40 | { | 35 | { |
@@ -76,24 +71,24 @@ void CStyle::unset() | |||
76 | { | 71 | { |
77 | sty.unset(); | 72 | sty.unset(); |
78 | if (graphic != NULL) | 73 | if (graphic != NULL) |
79 | { | 74 | { |
80 | if (--(graphic->count) == 0) | 75 | if (--(graphic->count) == 0) |
81 | { | 76 | { |
82 | delete graphic; | 77 | delete graphic; |
83 | } | 78 | } |
84 | graphic = NULL; | 79 | graphic = NULL; |
85 | } | 80 | } |
86 | } | 81 | } |
87 | 82 | ||
88 | void CStyle::setPicture(QPixmap* _g, bool il, unsigned long tgt) | 83 | void CStyle::setPicture(bool canScale, QImage* _g, bool il, unsigned long tgt) |
89 | { | 84 | { |
90 | if (graphic != NULL) | 85 | if (graphic != NULL) |
91 | { | 86 | { |
92 | if (--(graphic->count) == 0) | 87 | if (--(graphic->count) == 0) |
93 | { | 88 | { |
94 | delete graphic; | 89 | delete graphic; |
95 | } | 90 | } |
96 | graphic = NULL; | 91 | graphic = NULL; |
97 | } | 92 | } |
98 | if (_g != NULL) graphic = new pmstore(_g, il, tgt); | 93 | if (_g != NULL) graphic = new pmstore(canScale, _g, il, tgt); |
99 | } | 94 | } |