author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdeui/kguiitem.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | microkde/kdeui/kguiitem.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/microkde/kdeui/kguiitem.cpp b/microkde/kdeui/kguiitem.cpp index 828c5e6..c91ffb7 100644 --- a/microkde/kdeui/kguiitem.cpp +++ b/microkde/kdeui/kguiitem.cpp | |||
@@ -15,17 +15,17 @@ | |||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <qregexp.h> | 21 | #include <qregexp.h> |
22 | #include <qstring.h> | 22 | #include <qstring.h> |
23 | #include <qiconset.h> | 23 | #include <qicon.h> |
24 | #include <qpixmap.h> | 24 | #include <qpixmap.h> |
25 | 25 | ||
26 | #include <assert.h> | 26 | #include <assert.h> |
27 | //US #include <kiconloader.h> | 27 | //US #include <kiconloader.h> |
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | 29 | ||
30 | #include "kguiitem.h" | 30 | #include "kguiitem.h" |
31 | 31 | ||
@@ -57,17 +57,17 @@ public: | |||
57 | return *this; | 57 | return *this; |
58 | } | 58 | } |
59 | 59 | ||
60 | QString m_text; | 60 | QString m_text; |
61 | QString m_toolTip; | 61 | QString m_toolTip; |
62 | QString m_whatsThis; | 62 | QString m_whatsThis; |
63 | QString m_statusText; | 63 | QString m_statusText; |
64 | QString m_iconName; | 64 | QString m_iconName; |
65 | QIconSet m_iconSet; | 65 | QIcon m_iconSet; |
66 | bool m_hasIcon : 1; | 66 | bool m_hasIcon : 1; |
67 | bool m_enabled : 1; | 67 | bool m_enabled : 1; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | 70 | ||
71 | KGuiItem::KGuiItem() { | 71 | KGuiItem::KGuiItem() { |
72 | d = new KGuiItemPrivate; | 72 | d = new KGuiItemPrivate; |
73 | } | 73 | } |
@@ -77,17 +77,17 @@ KGuiItem::KGuiItem( const QString &text, const QString &iconName, | |||
77 | { | 77 | { |
78 | d = new KGuiItemPrivate; | 78 | d = new KGuiItemPrivate; |
79 | d->m_text = text; | 79 | d->m_text = text; |
80 | d->m_toolTip = toolTip; | 80 | d->m_toolTip = toolTip; |
81 | d->m_whatsThis = whatsThis; | 81 | d->m_whatsThis = whatsThis; |
82 | setIconName( iconName ); | 82 | setIconName( iconName ); |
83 | } | 83 | } |
84 | 84 | ||
85 | KGuiItem::KGuiItem( const QString &text, const QIconSet &iconSet, | 85 | KGuiItem::KGuiItem( const QString &text, const QIcon &iconSet, |
86 | const QString &toolTip, const QString &whatsThis ) | 86 | const QString &toolTip, const QString &whatsThis ) |
87 | { | 87 | { |
88 | d = new KGuiItemPrivate; | 88 | d = new KGuiItemPrivate; |
89 | d->m_text = text; | 89 | d->m_text = text; |
90 | d->m_toolTip = toolTip; | 90 | d->m_toolTip = toolTip; |
91 | d->m_whatsThis = whatsThis; | 91 | d->m_whatsThis = whatsThis; |
92 | setIconSet( iconSet ); | 92 | setIconSet( iconSet ); |
93 | } | 93 | } |
@@ -119,17 +119,17 @@ QString KGuiItem::text() const { | |||
119 | } | 119 | } |
120 | QString KGuiItem::plainText() const { | 120 | QString KGuiItem::plainText() const { |
121 | QString stripped( d->m_text ); | 121 | QString stripped( d->m_text ); |
122 | stripped.replace( QRegExp( "&(?!&)" ), QString::null ); | 122 | stripped.replace( QRegExp( "&(?!&)" ), QString::null ); |
123 | 123 | ||
124 | return stripped; | 124 | return stripped; |
125 | } | 125 | } |
126 | 126 | ||
127 | QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const | 127 | QIcon KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const |
128 | { | 128 | { |
129 | if( d->m_hasIcon ) | 129 | if( d->m_hasIcon ) |
130 | { | 130 | { |
131 | if( !d->m_iconName.isEmpty()) | 131 | if( !d->m_iconName.isEmpty()) |
132 | { | 132 | { |
133 | // some caching here would(?) come handy | 133 | // some caching here would(?) come handy |
134 | //US return instance->iconLoader()->loadIconSet( d->m_iconName, group, size ); | 134 | //US return instance->iconLoader()->loadIconSet( d->m_iconName, group, size ); |
135 | return KGlobal::iconLoader()->loadIconSet( d->m_iconName); | 135 | return KGlobal::iconLoader()->loadIconSet( d->m_iconName); |
@@ -143,17 +143,17 @@ QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instan | |||
143 | // return set; | 143 | // return set; |
144 | } | 144 | } |
145 | else | 145 | else |
146 | { | 146 | { |
147 | return d->m_iconSet; | 147 | return d->m_iconSet; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | else | 150 | else |
151 | return QIconSet(); | 151 | return QIcon(); |
152 | } | 152 | } |
153 | 153 | ||
154 | QString KGuiItem::iconName() const | 154 | QString KGuiItem::iconName() const |
155 | { | 155 | { |
156 | return d->m_iconName; | 156 | return d->m_iconName; |
157 | } | 157 | } |
158 | 158 | ||
159 | QString KGuiItem::toolTip() const { | 159 | QString KGuiItem::toolTip() const { |
@@ -172,27 +172,27 @@ bool KGuiItem::hasIcon() const | |||
172 | { | 172 | { |
173 | return d->m_hasIcon; | 173 | return d->m_hasIcon; |
174 | } | 174 | } |
175 | 175 | ||
176 | void KGuiItem::setText( const QString &text ) { | 176 | void KGuiItem::setText( const QString &text ) { |
177 | d->m_text=text; | 177 | d->m_text=text; |
178 | } | 178 | } |
179 | 179 | ||
180 | void KGuiItem::setIconSet( const QIconSet &iconset ) | 180 | void KGuiItem::setIconSet( const QIcon &iconset ) |
181 | { | 181 | { |
182 | d->m_iconSet = iconset; | 182 | d->m_iconSet = iconset; |
183 | d->m_iconName = QString::null; | 183 | d->m_iconName = QString::null; |
184 | d->m_hasIcon = !iconset.isNull(); | 184 | d->m_hasIcon = !iconset.isNull(); |
185 | } | 185 | } |
186 | 186 | ||
187 | void KGuiItem::setIconName( const QString &iconName ) | 187 | void KGuiItem::setIconName( const QString &iconName ) |
188 | { | 188 | { |
189 | d->m_iconName = iconName; | 189 | d->m_iconName = iconName; |
190 | d->m_iconSet = QIconSet(); | 190 | d->m_iconSet = QIcon(); |
191 | d->m_hasIcon = !iconName.isEmpty(); | 191 | d->m_hasIcon = !iconName.isEmpty(); |
192 | } | 192 | } |
193 | 193 | ||
194 | void KGuiItem::setToolTip( const QString &toolTip) { | 194 | void KGuiItem::setToolTip( const QString &toolTip) { |
195 | d->m_toolTip = toolTip; | 195 | d->m_toolTip = toolTip; |
196 | } | 196 | } |
197 | void KGuiItem::setWhatsThis( const QString &whatsThis ) { | 197 | void KGuiItem::setWhatsThis( const QString &whatsThis ) { |
198 | d->m_whatsThis = whatsThis; | 198 | d->m_whatsThis = whatsThis; |