summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/kguiitem.cpp
Unidiff
Diffstat (limited to 'microkde/kdeui/kguiitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kdeui/kguiitem.cpp14
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
@@ -17,13 +17,13 @@
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
@@ -59,13 +59,13 @@ public:
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
71KGuiItem::KGuiItem() { 71KGuiItem::KGuiItem() {
@@ -79,13 +79,13 @@ KGuiItem::KGuiItem( const QString &text, const QString &iconName,
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
85KGuiItem::KGuiItem( const QString &text, const QIconSet &iconSet, 85KGuiItem::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;
@@ -121,13 +121,13 @@ 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
127QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instance */ ) const 127QIcon 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
@@ -145,13 +145,13 @@ QIconSet KGuiItem::iconSet( KIcon::Group group, int size /*US, KInstance* instan
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
154QString KGuiItem::iconName() const 154QString KGuiItem::iconName() const
155{ 155{
156 return d->m_iconName; 156 return d->m_iconName;
157} 157}
@@ -174,23 +174,23 @@ bool KGuiItem::hasIcon() const
174} 174}
175 175
176void KGuiItem::setText( const QString &text ) { 176void KGuiItem::setText( const QString &text ) {
177 d->m_text=text; 177 d->m_text=text;
178} 178}
179 179
180void KGuiItem::setIconSet( const QIconSet &iconset ) 180void 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
187void KGuiItem::setIconName( const QString &iconName ) 187void 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
194void KGuiItem::setToolTip( const QString &toolTip) { 194void KGuiItem::setToolTip( const QString &toolTip) {
195 d->m_toolTip = toolTip; 195 d->m_toolTip = toolTip;
196} 196}