[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Mon Jan 10 21:34:51 CET 2011
SVN commit 1213562 by tgridel:
filemanager: why check basename if we can accomodate full path?
M +5 -11 FileManager.cpp
M +0 -5 FileManager.h
--- trunk/KDE/kdeedu/marble/src/lib/FileManager.cpp #1213561:1213562
@@ -86,17 +86,10 @@
return retList + d->m_pathList;
}
-QString FileManager::toRegularName( QString name )
-{
- QFileInfo fileinfo( name );
- return fileinfo.completeBaseName();
-}
-
void FileManager::addFile( const QString& filepath )
{
- QString regularName = toRegularName( filepath );
- if ( !containers().contains( regularName ) ) {
- mDebug() << "adding container:" << regularName;
+ if ( !containers().contains( filepath ) ) {
+ mDebug() << "adding container:" << filepath;
FileLoader* loader = new FileLoader( this, filepath );
appendLoader( loader );
d->m_pathList.append( filepath );
@@ -124,11 +117,12 @@
void FileManager::removeFile( const QString& key )
{
for ( int i = 0; i < d->m_fileItemList.size(); ++i ) {
- if ( toRegularName( key ) == toRegularName( d->m_fileItemList.at(i)->name() ) ) {
+ if ( key == d->m_fileItemList.at(i)->name() ) {
closeFile( i );
- break;
+ return;
}
}
+ mDebug() << "could not identify " << key;
}
void FileManager::addFile ( KmlFileViewItem * item )
--- trunk/KDE/kdeedu/marble/src/lib/FileManager.h #1213561:1213562
@@ -99,11 +99,6 @@
void appendLoader( FileLoader *loader );
- /**
- * internal helper function which returns the regular name of a kml or cache file
- */
- static QString toRegularName( QString name );
-
Q_DISABLE_COPY( FileManager )
FileManagerPrivate *const d;
More information about the Marble-commits
mailing list