-rw-r--r-- | microkde/kconfig.cpp | 4 | ||||
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 2 | ||||
-rw-r--r-- | microkde/kdeui/kactioncollection.cpp | 5 | ||||
-rw-r--r-- | microkde/kdeui/klistview.cpp | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp index ba41f6c..5b685d3 100644 --- a/microkde/kconfig.cpp +++ b/microkde/kconfig.cpp | |||
@@ -224,98 +224,98 @@ void KConfig::writeEntry( const QString &key, const QStringList &value ) | |||
224 | 224 | ||
225 | mDirty = true; | 225 | mDirty = true; |
226 | } | 226 | } |
227 | 227 | ||
228 | void KConfig::writeEntry( const QString &key, bool value) | 228 | void KConfig::writeEntry( const QString &key, bool value) |
229 | { | 229 | { |
230 | mBoolMap.insert( mGroup + key, value ); | 230 | mBoolMap.insert( mGroup + key, value ); |
231 | 231 | ||
232 | mDirty = true; | 232 | mDirty = true; |
233 | } | 233 | } |
234 | 234 | ||
235 | void KConfig::writeEntry( const QString & e, const QColor & c ) | 235 | void KConfig::writeEntry( const QString & e, const QColor & c ) |
236 | { | 236 | { |
237 | QStringList l; | 237 | QStringList l; |
238 | l.append( QString::number ( c.red() ) ); | 238 | l.append( QString::number ( c.red() ) ); |
239 | l.append( QString::number ( c.green() ) ); | 239 | l.append( QString::number ( c.green() ) ); |
240 | l.append( QString::number ( c.blue() ) ); | 240 | l.append( QString::number ( c.blue() ) ); |
241 | writeEntry( e, l ); | 241 | writeEntry( e, l ); |
242 | } | 242 | } |
243 | 243 | ||
244 | void KConfig::writeEntry( const QString & e, const QSize & s ) | 244 | void KConfig::writeEntry( const QString & e, const QSize & s ) |
245 | { | 245 | { |
246 | QValueList<int> intlist; | 246 | QValueList<int> intlist; |
247 | intlist << s.width() << s.height(); | 247 | intlist << s.width() << s.height(); |
248 | writeEntry( e, intlist ); | 248 | writeEntry( e, intlist ); |
249 | } | 249 | } |
250 | 250 | ||
251 | void KConfig::writeEntry( const QString & e , const QFont & f ) | 251 | void KConfig::writeEntry( const QString & e , const QFont & f ) |
252 | { | 252 | { |
253 | QStringList font; | 253 | QStringList font; |
254 | font.append( f.family()); | 254 | font.append( f.family()); |
255 | font.append( (!f.bold ()?"nonbold":"bold") ); | 255 | font.append( (!f.bold ()?"nonbold":"bold") ); |
256 | font.append( QString::number ( f.pointSize () ) ); | 256 | font.append( QString::number ( f.pointSize () ) ); |
257 | font.append( !f.italic ()?"nonitalic":"italic" ); | 257 | font.append( !f.italic ()?"nonitalic":"italic" ); |
258 | writeEntry( e, font ); | 258 | writeEntry( e, font ); |
259 | } | 259 | } |
260 | 260 | ||
261 | void KConfig::writeEntry( const QString &key, const QDateTime &dt ) | 261 | void KConfig::writeEntry( const QString &key, const QDateTime &dt ) |
262 | { | 262 | { |
263 | mDateTimeMap.insert( mGroup + key, dt ); | 263 | mDateTimeMap.insert( mGroup + key, dt ); |
264 | } | 264 | } |
265 | 265 | ||
266 | void KConfig::load() | 266 | void KConfig::load() |
267 | { | 267 | { |
268 | 268 | ||
269 | 269 | ||
270 | QFile f( mFileName ); | 270 | QFile f( mFileName ); |
271 | if ( !f.open( IO_ReadOnly ) ) { | 271 | if ( !f.open( IO_ReadOnly ) ) { |
272 | qDebug("KConfig: could not open file %s ",mFileName.latin1() ); | 272 | //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); |
273 | return; | 273 | return; |
274 | } | 274 | } |
275 | 275 | ||
276 | mBoolMap.clear(); | 276 | mBoolMap.clear(); |
277 | mStringMap.clear(); | 277 | mStringMap.clear(); |
278 | 278 | ||
279 | QTextStream t( &f ); | 279 | QTextStream t( &f ); |
280 | 280 | ||
281 | QString line = t.readLine(); | 281 | QString line = t.readLine(); |
282 | 282 | ||
283 | while ( !line.isNull() ) { | 283 | while ( !line.isNull() ) { |
284 | QStringList tokens = QStringList::split( ",", line ); | 284 | QStringList tokens = QStringList::split( ",", line ); |
285 | if ( tokens[0] == "bool" ) { | 285 | if ( tokens[0] == "bool" ) { |
286 | bool value = false; | 286 | bool value = false; |
287 | if ( tokens[2] == "1" ) value = true; | 287 | if ( tokens[2] == "1" ) value = true; |
288 | mBoolMap.insert( tokens[1], value ); | 288 | mBoolMap.insert( tokens[1], value ); |
289 | } else if ( tokens[0] == "QString" ) { | 289 | } else if ( tokens[0] == "QString" ) { |
290 | QString value = tokens[2]; | 290 | QString value = tokens[2]; |
291 | mStringMap.insert( tokens[1], value ); | 291 | mStringMap.insert( tokens[1], value ); |
292 | } else if ( tokens[0] == "QDateTime" ) { | 292 | } else if ( tokens[0] == "QDateTime" ) { |
293 | #if 0 | 293 | #if 0 |
294 | int year = tokens[2].toInt(); | 294 | int year = tokens[2].toInt(); |
295 | QDateTime dt( QDate( year, | 295 | QDateTime dt( QDate( year, |
296 | tokens[3].toInt(), | 296 | tokens[3].toInt(), |
297 | tokens[4].toInt() ), | 297 | tokens[4].toInt() ), |
298 | QTime( tokens[5].toInt(), tokens[6].toInt(), | 298 | QTime( tokens[5].toInt(), tokens[6].toInt(), |
299 | tokens[7].toInt() ) ); | 299 | tokens[7].toInt() ) ); |
300 | mDateTimeMap.insert( tokens[1], dt ); | 300 | mDateTimeMap.insert( tokens[1], dt ); |
301 | #endif | 301 | #endif |
302 | } | 302 | } |
303 | 303 | ||
304 | line = t.readLine(); | 304 | line = t.readLine(); |
305 | } | 305 | } |
306 | } | 306 | } |
307 | 307 | ||
308 | void KConfig::sync() | 308 | void KConfig::sync() |
309 | { | 309 | { |
310 | 310 | ||
311 | if ( !mDirty ) return; | 311 | if ( !mDirty ) return; |
312 | //qDebug("KConfig::sync() %s ",mFileName.latin1() ); | 312 | //qDebug("KConfig::sync() %s ",mFileName.latin1() ); |
313 | //kdDebug() << "KConfig::sync(): " << mFileName << endl; | 313 | //kdDebug() << "KConfig::sync(): " << mFileName << endl; |
314 | 314 | ||
315 | //US I took the following code from a newer version of KDE | 315 | //US I took the following code from a newer version of KDE |
316 | // Create the containing dir if needed | 316 | // Create the containing dir if needed |
317 | KURL path; | 317 | KURL path; |
318 | path.setPath(mFileName); | 318 | path.setPath(mFileName); |
319 | QString dir=path.directory(); | 319 | QString dir=path.directory(); |
320 | KStandardDirs::makeDir(dir); | 320 | KStandardDirs::makeDir(dir); |
321 | 321 | ||
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index 1c3e0ae..4c03c15 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp | |||
@@ -1511,97 +1511,97 @@ QString KStandardDirs::localkdedir() const | |||
1511 | } | 1511 | } |
1512 | 1512 | ||
1513 | QString KStandardDirs::localxdgdatadir() const | 1513 | QString KStandardDirs::localxdgdatadir() const |
1514 | { | 1514 | { |
1515 | // Return the prefix to use for saving | 1515 | // Return the prefix to use for saving |
1516 | return d->xdgdata_prefixes.first(); | 1516 | return d->xdgdata_prefixes.first(); |
1517 | } | 1517 | } |
1518 | 1518 | ||
1519 | QString KStandardDirs::localxdgconfdir() const | 1519 | QString KStandardDirs::localxdgconfdir() const |
1520 | { | 1520 | { |
1521 | // Return the prefix to use for saving | 1521 | // Return the prefix to use for saving |
1522 | return d->xdgconf_prefixes.first(); | 1522 | return d->xdgconf_prefixes.first(); |
1523 | } | 1523 | } |
1524 | 1524 | ||
1525 | void KStandardDirs::setAppDir( const QString &appDir ) | 1525 | void KStandardDirs::setAppDir( const QString &appDir ) |
1526 | { | 1526 | { |
1527 | mAppDir = appDir; | 1527 | mAppDir = appDir; |
1528 | 1528 | ||
1529 | if ( mAppDir.right( 1 ) != "/" ) | 1529 | if ( mAppDir.right( 1 ) != "/" ) |
1530 | mAppDir += "/"; | 1530 | mAppDir += "/"; |
1531 | } | 1531 | } |
1532 | 1532 | ||
1533 | QString KStandardDirs::appDir() | 1533 | QString KStandardDirs::appDir() |
1534 | { | 1534 | { |
1535 | return mAppDir; | 1535 | return mAppDir; |
1536 | } | 1536 | } |
1537 | 1537 | ||
1538 | // just to make code more readable without macros | 1538 | // just to make code more readable without macros |
1539 | QString locate( const char *type, | 1539 | QString locate( const char *type, |
1540 | const QString& filename/*US , const KInstance* inst*/ ) | 1540 | const QString& filename/*US , const KInstance* inst*/ ) |
1541 | { | 1541 | { |
1542 | //US return inst->dirs()->findResource(type, filename); | 1542 | //US return inst->dirs()->findResource(type, filename); |
1543 | return KGlobal::dirs()->findResource(type, filename); | 1543 | return KGlobal::dirs()->findResource(type, filename); |
1544 | } | 1544 | } |
1545 | 1545 | ||
1546 | QString locateLocal( const char *type, | 1546 | QString locateLocal( const char *type, |
1547 | const QString& filename/*US , const KInstance* inst*/ ) | 1547 | const QString& filename/*US , const KInstance* inst*/ ) |
1548 | { | 1548 | { |
1549 | 1549 | ||
1550 | QString path = locateLocal(type, filename, true /*US, inst*/); | 1550 | QString path = locateLocal(type, filename, true /*US, inst*/); |
1551 | 1551 | ||
1552 | 1552 | ||
1553 | /* | 1553 | /* |
1554 | static int ccc = 0; | 1554 | static int ccc = 0; |
1555 | ++ccc; | 1555 | ++ccc; |
1556 | if ( ccc > 13 ) | 1556 | if ( ccc > 13 ) |
1557 | abort(); | 1557 | abort(); |
1558 | */ | 1558 | */ |
1559 | qDebug("locatelocal: %s" , path.latin1()); | 1559 | //qDebug("locatelocal: %s" , path.latin1()); |
1560 | return path; | 1560 | return path; |
1561 | 1561 | ||
1562 | /*US why do we put all files into one directory. It is quit complicated. | 1562 | /*US why do we put all files into one directory. It is quit complicated. |
1563 | why not staying with the original directorystructure ? | 1563 | why not staying with the original directorystructure ? |
1564 | 1564 | ||
1565 | 1565 | ||
1566 | QString escapedFilename = filename; | 1566 | QString escapedFilename = filename; |
1567 | escapedFilename.replace( QRegExp( "/" ), "_" ); | 1567 | escapedFilename.replace( QRegExp( "/" ), "_" ); |
1568 | 1568 | ||
1569 | QString path = KStandardDirs::appDir() + type + "_" + escapedFilename; | 1569 | QString path = KStandardDirs::appDir() + type + "_" + escapedFilename; |
1570 | 1570 | ||
1571 | kdDebug() << "locate: '" << path << "'" << endl; | 1571 | kdDebug() << "locate: '" << path << "'" << endl; |
1572 | qDebug("locate: %s" , path.latin1()); | 1572 | qDebug("locate: %s" , path.latin1()); |
1573 | return path; | 1573 | return path; |
1574 | */ | 1574 | */ |
1575 | //US so my proposal is this: | 1575 | //US so my proposal is this: |
1576 | 1576 | ||
1577 | // QString escapedFilename = filename; | 1577 | // QString escapedFilename = filename; |
1578 | // escapedFilename.replace( QRegExp( "/" ), "_" ); | 1578 | // escapedFilename.replace( QRegExp( "/" ), "_" ); |
1579 | 1579 | ||
1580 | #if 0 | 1580 | #if 0 |
1581 | #ifdef _WIN32_ | 1581 | #ifdef _WIN32_ |
1582 | QString path = QDir::convertSeparators(KStandardDirs::appDir() + type + "/" + filename); | 1582 | QString path = QDir::convertSeparators(KStandardDirs::appDir() + type + "/" + filename); |
1583 | #else | 1583 | #else |
1584 | QString path = KStandardDirs::appDir() + type + "/" + filename; | 1584 | QString path = KStandardDirs::appDir() + type + "/" + filename; |
1585 | #endif | 1585 | #endif |
1586 | 1586 | ||
1587 | //US Create the containing dir if needed | 1587 | //US Create the containing dir if needed |
1588 | QFileInfo fi ( path ); | 1588 | QFileInfo fi ( path ); |
1589 | 1589 | ||
1590 | // QString dir=pathurl.directory(); | 1590 | // QString dir=pathurl.directory(); |
1591 | //QMessageBox::information( 0,"path", path, 1 ); | 1591 | //QMessageBox::information( 0,"path", path, 1 ); |
1592 | 1592 | ||
1593 | #ifdef _WIN32_ | 1593 | #ifdef _WIN32_ |
1594 | KStandardDirs::makeDir(path); | 1594 | KStandardDirs::makeDir(path); |
1595 | #else | 1595 | #else |
1596 | KStandardDirs::makeDir(fi.dirPath( true )); | 1596 | KStandardDirs::makeDir(fi.dirPath( true )); |
1597 | #endif | 1597 | #endif |
1598 | 1598 | ||
1599 | qDebug("locate22: %s" , path.latin1()); | 1599 | qDebug("locate22: %s" , path.latin1()); |
1600 | return path; | 1600 | return path; |
1601 | 1601 | ||
1602 | #endif | 1602 | #endif |
1603 | 1603 | ||
1604 | } | 1604 | } |
1605 | 1605 | ||
1606 | QString locateLocal( const char *type, | 1606 | QString locateLocal( const char *type, |
1607 | const QString& filename, bool createDir/*US , const KInstance* inst*/ ) | 1607 | const QString& filename, bool createDir/*US , const KInstance* inst*/ ) |
diff --git a/microkde/kdeui/kactioncollection.cpp b/microkde/kdeui/kactioncollection.cpp index b819e76..69e5d02 100644 --- a/microkde/kdeui/kactioncollection.cpp +++ b/microkde/kdeui/kactioncollection.cpp | |||
@@ -108,101 +108,102 @@ KActionCollection::KActionCollection( QWidget *watch, QObject* parent, const cha | |||
108 | KActionCollection::KActionCollection( QObject *parent, const char *name /*US, | 108 | KActionCollection::KActionCollection( QObject *parent, const char *name /*US, |
109 | KInstance *instance */) | 109 | KInstance *instance */) |
110 | : QObject( parent, name ) | 110 | : QObject( parent, name ) |
111 | { | 111 | { |
112 | kdWarning(129) << "KActionCollection::KActionCollection( QObject *parent, const char *name, KInstance *instance )" << endl; //ellis | 112 | kdWarning(129) << "KActionCollection::KActionCollection( QObject *parent, const char *name, KInstance *instance )" << endl; //ellis |
113 | //US kdBacktrace not available | 113 | //US kdBacktrace not available |
114 | //US kdDebug(129) << kdBacktrace() << endl; | 114 | //US kdDebug(129) << kdBacktrace() << endl; |
115 | d = new KActionCollectionPrivate; | 115 | d = new KActionCollectionPrivate; |
116 | //US QWidget* w = dynamic_cast<QWidget*>( parent ); | 116 | //US QWidget* w = dynamic_cast<QWidget*>( parent ); |
117 | QWidget* w = (QWidget*)( parent ); | 117 | QWidget* w = (QWidget*)( parent ); |
118 | if( w ) | 118 | if( w ) |
119 | setWidget( w ); | 119 | setWidget( w ); |
120 | //d->m_bOneKAccelOnly = (d->m_kaccelList.count() > 0); | 120 | //d->m_bOneKAccelOnly = (d->m_kaccelList.count() > 0); |
121 | //US setInstance( instance ); | 121 | //US setInstance( instance ); |
122 | } | 122 | } |
123 | 123 | ||
124 | KActionCollection::KActionCollection( const KActionCollection © ) | 124 | KActionCollection::KActionCollection( const KActionCollection © ) |
125 | : QObject() | 125 | : QObject() |
126 | { | 126 | { |
127 | kdWarning(129) << "KActionCollection::KActionCollection( const KActionCollection & ): function is severely deprecated." << endl; | 127 | kdWarning(129) << "KActionCollection::KActionCollection( const KActionCollection & ): function is severely deprecated." << endl; |
128 | d = new KActionCollectionPrivate; | 128 | d = new KActionCollectionPrivate; |
129 | *this = copy; | 129 | *this = copy; |
130 | } | 130 | } |
131 | // KDE 4: remove end | 131 | // KDE 4: remove end |
132 | 132 | ||
133 | KActionCollection::~KActionCollection() | 133 | KActionCollection::~KActionCollection() |
134 | { | 134 | { |
135 | kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl; | 135 | kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl; |
136 | for ( QAsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { | 136 | for ( QAsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { |
137 | KAction* pAction = it.current(); | 137 | KAction* pAction = it.current(); |
138 | if ( pAction->m_parentCollection == this ) | 138 | if ( pAction->m_parentCollection == this ) |
139 | pAction->m_parentCollection = 0L; | 139 | pAction->m_parentCollection = 0L; |
140 | } | 140 | } |
141 | 141 | ||
142 | //US delete d->m_kaccel; | 142 | //US delete d->m_kaccel; |
143 | //US delete d->m_builderKAccel; | 143 | //US delete d->m_builderKAccel; |
144 | delete d; d = 0; | 144 | delete d; d = 0; |
145 | } | 145 | } |
146 | 146 | ||
147 | void KActionCollection::setWidget( QWidget* w ) | 147 | void KActionCollection::setWidget( QWidget* w ) |
148 | { | 148 | { |
149 | //if ( d->m_actionDict.count() > 0 ) { | 149 | //if ( d->m_actionDict.count() > 0 ) { |
150 | // kdError(129) << "KActionCollection::setWidget(): must be called before any actions are added to collection!" << endl; | 150 | // kdError(129) << "KActionCollection::setWidget(): must be called before any actions are added to collection!" << endl; |
151 | // kdDebug(129) << kdBacktrace() << endl; | 151 | // kdDebug(129) << kdBacktrace() << endl; |
152 | //} | 152 | //} |
153 | //else | 153 | //else |
154 | if ( !d->m_widget ) { | 154 | if ( !d->m_widget ) { |
155 | d->m_widget = w; | 155 | d->m_widget = w; |
156 | qDebug("KActionCollection::setWidget: warning: KAccel is never used in microkde"); | 156 | //qDebug("KActionCollection::setWidget: warning: KAccel is never used in microkde"); |
157 | //US d->m_kaccel = new KAccel( w, this, "KActionCollection-KAccel" ); | 157 | //US d->m_kaccel = new KAccel( w, this, "KActionCollection-KAccel" ); |
158 | } | 158 | } |
159 | else if ( d->m_widget != w ) | 159 | else if ( d->m_widget != w ) |
160 | kdWarning(129) << "KActionCollection::setWidget(): tried to change widget from " << d->m_widget << " to " << w << endl; | 160 | ; |
161 | |||
161 | } | 162 | } |
162 | 163 | ||
163 | void KActionCollection::setAutoConnectShortcuts( bool b ) | 164 | void KActionCollection::setAutoConnectShortcuts( bool b ) |
164 | { | 165 | { |
165 | d->m_bAutoConnectShortcuts = b; | 166 | d->m_bAutoConnectShortcuts = b; |
166 | } | 167 | } |
167 | 168 | ||
168 | bool KActionCollection::isAutoConnectShortcuts() | 169 | bool KActionCollection::isAutoConnectShortcuts() |
169 | { | 170 | { |
170 | return d->m_bAutoConnectShortcuts; | 171 | return d->m_bAutoConnectShortcuts; |
171 | } | 172 | } |
172 | 173 | ||
173 | bool KActionCollection::addDocCollection( KActionCollection* pDoc ) | 174 | bool KActionCollection::addDocCollection( KActionCollection* pDoc ) |
174 | { | 175 | { |
175 | d->m_docList.append( pDoc ); | 176 | d->m_docList.append( pDoc ); |
176 | return true; | 177 | return true; |
177 | } | 178 | } |
178 | 179 | ||
179 | void KActionCollection::beginXMLPlug( QWidget *widget ) | 180 | void KActionCollection::beginXMLPlug( QWidget *widget ) |
180 | { | 181 | { |
181 | qDebug("KActionCollection::beginXMLPlug has to be fixed"); | 182 | qDebug("KActionCollection::beginXMLPlug has to be fixed"); |
182 | /*US | 183 | /*US |
183 | kdDebug(129) << "KActionCollection::beginXMLPlug( buildWidget = " << widget << " ): this = " << this << " d->m_builderKAccel = " << d->m_builderKAccel << endl; | 184 | kdDebug(129) << "KActionCollection::beginXMLPlug( buildWidget = " << widget << " ): this = " << this << " d->m_builderKAccel = " << d->m_builderKAccel << endl; |
184 | 185 | ||
185 | if( widget && !d->m_builderKAccel ) { | 186 | if( widget && !d->m_builderKAccel ) { |
186 | d->m_builderKAccel = new KAccel( widget, this, "KActionCollection-BuilderKAccel" ); | 187 | d->m_builderKAccel = new KAccel( widget, this, "KActionCollection-BuilderKAccel" ); |
187 | } | 188 | } |
188 | */ | 189 | */ |
189 | } | 190 | } |
190 | 191 | ||
191 | void KActionCollection::endXMLPlug() | 192 | void KActionCollection::endXMLPlug() |
192 | { | 193 | { |
193 | kdDebug(129) << "KActionCollection::endXMLPlug(): this = " << this << endl; | 194 | kdDebug(129) << "KActionCollection::endXMLPlug(): this = " << this << endl; |
194 | //s_kaccelXML = 0; | 195 | //s_kaccelXML = 0; |
195 | } | 196 | } |
196 | 197 | ||
197 | void KActionCollection::prepareXMLUnplug() | 198 | void KActionCollection::prepareXMLUnplug() |
198 | { | 199 | { |
199 | qDebug("KActionCollection::prepareXMLUnplug has to be fixed"); | 200 | qDebug("KActionCollection::prepareXMLUnplug has to be fixed"); |
200 | /*US | 201 | /*US |
201 | kdDebug(129) << "KActionCollection::prepareXMLUnplug(): this = " << this << endl; | 202 | kdDebug(129) << "KActionCollection::prepareXMLUnplug(): this = " << this << endl; |
202 | unplugShortcuts( d->m_kaccel ); | 203 | unplugShortcuts( d->m_kaccel ); |
203 | 204 | ||
204 | if( d->m_builderKAccel ) { | 205 | if( d->m_builderKAccel ) { |
205 | unplugShortcuts( d->m_builderKAccel ); | 206 | unplugShortcuts( d->m_builderKAccel ); |
206 | delete d->m_builderKAccel; | 207 | delete d->m_builderKAccel; |
207 | d->m_builderKAccel = 0; | 208 | d->m_builderKAccel = 0; |
208 | } | 209 | } |
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp index b53a88a..2856f2d 100644 --- a/microkde/kdeui/klistview.cpp +++ b/microkde/kdeui/klistview.cpp | |||
@@ -470,97 +470,97 @@ KListView::~KListView() | |||
470 | delete d; | 470 | delete d; |
471 | } | 471 | } |
472 | 472 | ||
473 | bool KListView::isExecuteArea( const QPoint& point ) | 473 | bool KListView::isExecuteArea( const QPoint& point ) |
474 | { | 474 | { |
475 | if ( itemAt( point ) ) | 475 | if ( itemAt( point ) ) |
476 | return isExecuteArea( point.x() ); | 476 | return isExecuteArea( point.x() ); |
477 | 477 | ||
478 | return false; | 478 | return false; |
479 | } | 479 | } |
480 | 480 | ||
481 | bool KListView::isExecuteArea( int x ) | 481 | bool KListView::isExecuteArea( int x ) |
482 | { | 482 | { |
483 | if( allColumnsShowFocus() ) | 483 | if( allColumnsShowFocus() ) |
484 | return true; | 484 | return true; |
485 | else { | 485 | else { |
486 | int offset = 0; | 486 | int offset = 0; |
487 | int width = columnWidth( 0 ); | 487 | int width = columnWidth( 0 ); |
488 | int pos = header()->mapToIndex( 0 ); | 488 | int pos = header()->mapToIndex( 0 ); |
489 | 489 | ||
490 | for ( int index = 0; index < pos; index++ ) | 490 | for ( int index = 0; index < pos; index++ ) |
491 | offset += columnWidth( header()->mapToSection( index ) ); | 491 | offset += columnWidth( header()->mapToSection( index ) ); |
492 | 492 | ||
493 | x += contentsX(); // in case of a horizontal scrollbar | 493 | x += contentsX(); // in case of a horizontal scrollbar |
494 | return ( x > offset && x < ( offset + width ) ); | 494 | return ( x > offset && x < ( offset + width ) ); |
495 | } | 495 | } |
496 | } | 496 | } |
497 | 497 | ||
498 | void KListView::slotOnItem( QListViewItem *item ) | 498 | void KListView::slotOnItem( QListViewItem *item ) |
499 | { | 499 | { |
500 | QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); | 500 | QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); |
501 | if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) { | 501 | if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) { |
502 | d->autoSelect.start( d->autoSelectDelay, true ); | 502 | d->autoSelect.start( d->autoSelectDelay, true ); |
503 | d->pCurrentItem = item; | 503 | d->pCurrentItem = item; |
504 | } | 504 | } |
505 | } | 505 | } |
506 | 506 | ||
507 | void KListView::slotOnViewport() | 507 | void KListView::slotOnViewport() |
508 | { | 508 | { |
509 | if ( d->bChangeCursorOverItem ) | 509 | if ( d->bChangeCursorOverItem ) |
510 | viewport()->unsetCursor(); | 510 | viewport()->unsetCursor(); |
511 | 511 | ||
512 | d->autoSelect.stop(); | 512 | d->autoSelect.stop(); |
513 | d->pCurrentItem = 0L; | 513 | d->pCurrentItem = 0L; |
514 | } | 514 | } |
515 | 515 | ||
516 | void KListView::slotSettingsChanged(int category) | 516 | void KListView::slotSettingsChanged(int category) |
517 | { | 517 | { |
518 | qDebug("KListView::slotSettingsChanged has to be verified"); | 518 | //qDebug("KListView::slotSettingsChanged has to be verified"); |
519 | /*US | 519 | /*US |
520 | 520 | ||
521 | switch (category) | 521 | switch (category) |
522 | { | 522 | { |
523 | case KApplication::SETTINGS_MOUSE: | 523 | case KApplication::SETTINGS_MOUSE: |
524 | d->dragDelay = KGlobalSettings::dndEventDelay(); | 524 | d->dragDelay = KGlobalSettings::dndEventDelay(); |
525 | d->bUseSingle = KGlobalSettings::singleClick(); | 525 | d->bUseSingle = KGlobalSettings::singleClick(); |
526 | 526 | ||
527 | disconnect(this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), | 527 | disconnect(this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), |
528 | this, SLOT (slotMouseButtonClicked (int, QListViewItem*, const QPoint &, int))); | 528 | this, SLOT (slotMouseButtonClicked (int, QListViewItem*, const QPoint &, int))); |
529 | 529 | ||
530 | if( d->bUseSingle ) | 530 | if( d->bUseSingle ) |
531 | connect (this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), | 531 | connect (this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), |
532 | this, SLOT (slotMouseButtonClicked( int, QListViewItem*, const QPoint &, int))); | 532 | this, SLOT (slotMouseButtonClicked( int, QListViewItem*, const QPoint &, int))); |
533 | 533 | ||
534 | d->bChangeCursorOverItem = KGlobalSettings::changeCursorOverIcon(); | 534 | d->bChangeCursorOverItem = KGlobalSettings::changeCursorOverIcon(); |
535 | d->autoSelectDelay = KGlobalSettings::autoSelectDelay(); | 535 | d->autoSelectDelay = KGlobalSettings::autoSelectDelay(); |
536 | 536 | ||
537 | if( !d->bUseSingle || !d->bChangeCursorOverItem ) | 537 | if( !d->bUseSingle || !d->bChangeCursorOverItem ) |
538 | viewport()->unsetCursor(); | 538 | viewport()->unsetCursor(); |
539 | 539 | ||
540 | break; | 540 | break; |
541 | 541 | ||
542 | case KApplication::SETTINGS_POPUPMENU: | 542 | case KApplication::SETTINGS_POPUPMENU: |
543 | d->contextMenuKey = KGlobalSettings::contextMenuKey (); | 543 | d->contextMenuKey = KGlobalSettings::contextMenuKey (); |
544 | d->showContextMenusOnPress = KGlobalSettings::showContextMenusOnPress (); | 544 | d->showContextMenusOnPress = KGlobalSettings::showContextMenusOnPress (); |
545 | 545 | ||
546 | if (d->showContextMenusOnPress) | 546 | if (d->showContextMenusOnPress) |
547 | { | 547 | { |
548 | disconnect (0L, 0L, this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); | 548 | disconnect (0L, 0L, this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); |
549 | 549 | ||
550 | connect(this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), | 550 | connect(this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), |
551 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); | 551 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); |
552 | } | 552 | } |
553 | else | 553 | else |
554 | { | 554 | { |
555 | disconnect (0L, 0L, this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); | 555 | disconnect (0L, 0L, this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); |
556 | 556 | ||
557 | connect(this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), | 557 | connect(this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), |
558 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); | 558 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); |
559 | } | 559 | } |
560 | break; | 560 | break; |
561 | 561 | ||
562 | default: | 562 | default: |
563 | break; | 563 | break; |
564 | } | 564 | } |
565 | */ | 565 | */ |
566 | 566 | ||