-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 ) mDirty = true; } void KConfig::writeEntry( const QString &key, bool value) { mBoolMap.insert( mGroup + key, value ); mDirty = true; } void KConfig::writeEntry( const QString & e, const QColor & c ) { QStringList l; l.append( QString::number ( c.red() ) ); l.append( QString::number ( c.green() ) ); l.append( QString::number ( c.blue() ) ); writeEntry( e, l ); } void KConfig::writeEntry( const QString & e, const QSize & s ) { QValueList<int> intlist; intlist << s.width() << s.height(); writeEntry( e, intlist ); } void KConfig::writeEntry( const QString & e , const QFont & f ) { QStringList font; font.append( f.family()); font.append( (!f.bold ()?"nonbold":"bold") ); font.append( QString::number ( f.pointSize () ) ); font.append( !f.italic ()?"nonitalic":"italic" ); writeEntry( e, font ); } void KConfig::writeEntry( const QString &key, const QDateTime &dt ) { mDateTimeMap.insert( mGroup + key, dt ); } void KConfig::load() { QFile f( mFileName ); if ( !f.open( IO_ReadOnly ) ) { - qDebug("KConfig: could not open file %s ",mFileName.latin1() ); - return; + //qDebug("KConfig: could not open file %s ",mFileName.latin1() ); + return; } mBoolMap.clear(); mStringMap.clear(); QTextStream t( &f ); QString line = t.readLine(); while ( !line.isNull() ) { QStringList tokens = QStringList::split( ",", line ); if ( tokens[0] == "bool" ) { bool value = false; if ( tokens[2] == "1" ) value = true; mBoolMap.insert( tokens[1], value ); } else if ( tokens[0] == "QString" ) { QString value = tokens[2]; mStringMap.insert( tokens[1], value ); } else if ( tokens[0] == "QDateTime" ) { #if 0 int year = tokens[2].toInt(); QDateTime dt( QDate( year, tokens[3].toInt(), tokens[4].toInt() ), QTime( tokens[5].toInt(), tokens[6].toInt(), tokens[7].toInt() ) ); mDateTimeMap.insert( tokens[1], dt ); #endif } line = t.readLine(); } } void KConfig::sync() { if ( !mDirty ) return; //qDebug("KConfig::sync() %s ",mFileName.latin1() ); //kdDebug() << "KConfig::sync(): " << mFileName << endl; //US I took the following code from a newer version of KDE // Create the containing dir if needed KURL path; path.setPath(mFileName); QString dir=path.directory(); KStandardDirs::makeDir(dir); 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 } QString KStandardDirs::localxdgdatadir() const { // Return the prefix to use for saving return d->xdgdata_prefixes.first(); } QString KStandardDirs::localxdgconfdir() const { // Return the prefix to use for saving return d->xdgconf_prefixes.first(); } void KStandardDirs::setAppDir( const QString &appDir ) { mAppDir = appDir; if ( mAppDir.right( 1 ) != "/" ) mAppDir += "/"; } QString KStandardDirs::appDir() { return mAppDir; } // just to make code more readable without macros QString locate( const char *type, const QString& filename/*US , const KInstance* inst*/ ) { //US return inst->dirs()->findResource(type, filename); return KGlobal::dirs()->findResource(type, filename); } QString locateLocal( const char *type, const QString& filename/*US , const KInstance* inst*/ ) { QString path = locateLocal(type, filename, true /*US, inst*/); /* static int ccc = 0; ++ccc; if ( ccc > 13 ) abort(); */ - qDebug("locatelocal: %s" , path.latin1()); + //qDebug("locatelocal: %s" , path.latin1()); return path; /*US why do we put all files into one directory. It is quit complicated. why not staying with the original directorystructure ? QString escapedFilename = filename; escapedFilename.replace( QRegExp( "/" ), "_" ); QString path = KStandardDirs::appDir() + type + "_" + escapedFilename; kdDebug() << "locate: '" << path << "'" << endl; qDebug("locate: %s" , path.latin1()); return path; */ //US so my proposal is this: // QString escapedFilename = filename; // escapedFilename.replace( QRegExp( "/" ), "_" ); #if 0 #ifdef _WIN32_ QString path = QDir::convertSeparators(KStandardDirs::appDir() + type + "/" + filename); #else QString path = KStandardDirs::appDir() + type + "/" + filename; #endif //US Create the containing dir if needed QFileInfo fi ( path ); // QString dir=pathurl.directory(); // QMessageBox::information( 0,"path", path, 1 ); #ifdef _WIN32_ KStandardDirs::makeDir(path); #else KStandardDirs::makeDir(fi.dirPath( true )); #endif qDebug("locate22: %s" , path.latin1()); return path; #endif } QString locateLocal( const char *type, 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 KActionCollection::KActionCollection( QObject *parent, const char *name /*US, KInstance *instance */) : QObject( parent, name ) { kdWarning(129) << "KActionCollection::KActionCollection( QObject *parent, const char *name, KInstance *instance )" << endl; //ellis //US kdBacktrace not available //US kdDebug(129) << kdBacktrace() << endl; d = new KActionCollectionPrivate; //US QWidget* w = dynamic_cast<QWidget*>( parent ); QWidget* w = (QWidget*)( parent ); if( w ) setWidget( w ); //d->m_bOneKAccelOnly = (d->m_kaccelList.count() > 0); //US setInstance( instance ); } KActionCollection::KActionCollection( const KActionCollection © ) : QObject() { kdWarning(129) << "KActionCollection::KActionCollection( const KActionCollection & ): function is severely deprecated." << endl; d = new KActionCollectionPrivate; *this = copy; } // KDE 4: remove end KActionCollection::~KActionCollection() { kdDebug(129) << "KActionCollection::~KActionCollection(): this = " << this << endl; for ( QAsciiDictIterator<KAction> it( d->m_actionDict ); it.current(); ++it ) { KAction* pAction = it.current(); if ( pAction->m_parentCollection == this ) pAction->m_parentCollection = 0L; } //US delete d->m_kaccel; //US delete d->m_builderKAccel; delete d; d = 0; } void KActionCollection::setWidget( QWidget* w ) { //if ( d->m_actionDict.count() > 0 ) { // kdError(129) << "KActionCollection::setWidget(): must be called before any actions are added to collection!" << endl; // kdDebug(129) << kdBacktrace() << endl; //} //else if ( !d->m_widget ) { d->m_widget = w; - qDebug("KActionCollection::setWidget: warning: KAccel is never used in microkde"); + //qDebug("KActionCollection::setWidget: warning: KAccel is never used in microkde"); //US d->m_kaccel = new KAccel( w, this, "KActionCollection-KAccel" ); } else if ( d->m_widget != w ) - kdWarning(129) << "KActionCollection::setWidget(): tried to change widget from " << d->m_widget << " to " << w << endl; + ; + } void KActionCollection::setAutoConnectShortcuts( bool b ) { d->m_bAutoConnectShortcuts = b; } bool KActionCollection::isAutoConnectShortcuts() { return d->m_bAutoConnectShortcuts; } bool KActionCollection::addDocCollection( KActionCollection* pDoc ) { d->m_docList.append( pDoc ); return true; } void KActionCollection::beginXMLPlug( QWidget *widget ) { qDebug("KActionCollection::beginXMLPlug has to be fixed"); /*US kdDebug(129) << "KActionCollection::beginXMLPlug( buildWidget = " << widget << " ): this = " << this << " d->m_builderKAccel = " << d->m_builderKAccel << endl; if( widget && !d->m_builderKAccel ) { d->m_builderKAccel = new KAccel( widget, this, "KActionCollection-BuilderKAccel" ); } */ } void KActionCollection::endXMLPlug() { kdDebug(129) << "KActionCollection::endXMLPlug(): this = " << this << endl; //s_kaccelXML = 0; } void KActionCollection::prepareXMLUnplug() { qDebug("KActionCollection::prepareXMLUnplug has to be fixed"); /*US kdDebug(129) << "KActionCollection::prepareXMLUnplug(): this = " << this << endl; unplugShortcuts( d->m_kaccel ); if( d->m_builderKAccel ) { unplugShortcuts( d->m_builderKAccel ); delete d->m_builderKAccel; d->m_builderKAccel = 0; } 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() delete d; } bool KListView::isExecuteArea( const QPoint& point ) { if ( itemAt( point ) ) return isExecuteArea( point.x() ); return false; } bool KListView::isExecuteArea( int x ) { if( allColumnsShowFocus() ) return true; else { int offset = 0; int width = columnWidth( 0 ); int pos = header()->mapToIndex( 0 ); for ( int index = 0; index < pos; index++ ) offset += columnWidth( header()->mapToSection( index ) ); x += contentsX(); // in case of a horizontal scrollbar return ( x > offset && x < ( offset + width ) ); } } void KListView::slotOnItem( QListViewItem *item ) { QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) { d->autoSelect.start( d->autoSelectDelay, true ); d->pCurrentItem = item; } } void KListView::slotOnViewport() { if ( d->bChangeCursorOverItem ) viewport()->unsetCursor(); d->autoSelect.stop(); d->pCurrentItem = 0L; } void KListView::slotSettingsChanged(int category) { -qDebug("KListView::slotSettingsChanged has to be verified"); + //qDebug("KListView::slotSettingsChanged has to be verified"); /*US switch (category) { case KApplication::SETTINGS_MOUSE: d->dragDelay = KGlobalSettings::dndEventDelay(); d->bUseSingle = KGlobalSettings::singleClick(); disconnect(this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), this, SLOT (slotMouseButtonClicked (int, QListViewItem*, const QPoint &, int))); if( d->bUseSingle ) connect (this, SIGNAL (mouseButtonClicked (int, QListViewItem*, const QPoint &, int)), this, SLOT (slotMouseButtonClicked( int, QListViewItem*, const QPoint &, int))); d->bChangeCursorOverItem = KGlobalSettings::changeCursorOverIcon(); d->autoSelectDelay = KGlobalSettings::autoSelectDelay(); if( !d->bUseSingle || !d->bChangeCursorOverItem ) viewport()->unsetCursor(); break; case KApplication::SETTINGS_POPUPMENU: d->contextMenuKey = KGlobalSettings::contextMenuKey (); d->showContextMenusOnPress = KGlobalSettings::showContextMenusOnPress (); if (d->showContextMenusOnPress) { disconnect (0L, 0L, this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); connect(this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); } else { disconnect (0L, 0L, this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); connect(this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); } break; default: break; } */ |