summaryrefslogtreecommitdiff
authorzecke <zecke>2004-09-12 23:18:37 (UTC)
committer zecke <zecke>2004-09-12 23:18:37 (UTC)
commitf05a19bd1e248ea8cea29d361a1a8085ca145c6a (patch) (side-by-side diff)
treeae7204968f4e8841232a976eb9cc341db65dca50
parent8123b75c55cb5140ae5b0c5aeddb4644a0a8ffbb (diff)
downloadopie-f05a19bd1e248ea8cea29d361a1a8085ca145c6a.zip
opie-f05a19bd1e248ea8cea29d361a1a8085ca145c6a.tar.gz
opie-f05a19bd1e248ea8cea29d361a1a8085ca145c6a.tar.bz2
If there is no 'excluded' plugin the excluded-list wasn't made
empty and the old/prior setting still was used. This fix makes sure that an empty string is written if no plugin is excluded
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/opluginloader.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/libopie2/opiecore/opluginloader.cpp b/libopie2/opiecore/opluginloader.cpp
index 1edf3a1..b8b6b79 100644
--- a/libopie2/opiecore/opluginloader.cpp
+++ b/libopie2/opiecore/opluginloader.cpp
@@ -554,18 +554,21 @@ OPluginItem::List OGenericPluginLoader::plugins( const QString& _dir, bool sorte
QStringList excludes = cfg.readListEntry( "Excluded", ',' );
for ( QStringList::Iterator it = excludes.begin(); it != excludes.end(); ++it )
excludedMap.insert( *it, -2 );
if ( sorted ) {
QStringList pos = cfg.readListEntry( "Positions", '.' );
QStringList::Iterator it = pos.begin();
- while ( it != pos.end() )
- positionMap.insert( *it++, (*it++).toInt() );
+ QString tmp; int i;
+ while ( it != pos.end() ) {
+ tmp = *it++; i = (*it++).toInt();
+ positionMap.insert( tmp, i );
+ }
}
QStringList list = dir.entryList();
for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
@@ -580,16 +583,17 @@ OPluginItem::List OGenericPluginLoader::plugins( const QString& _dir, bool sorte
*/
if ( ex && !disabled)
item.setEnabled( false );
else if ( ex && disabled )
continue;
else if ( sorted )
item.setPosition( positionMap[str] );
+
lst.append( item );
}
return lst;
}
/**
* @internal generate a list of languages from $LANG
@@ -829,16 +833,19 @@ void OPluginManager::save() {
QString path = QFileInfo( item.path() ).dirPath(true);
if ( sorted ) {
positions[path].append( item.name() );
positions[path].append( QString::number( item.position() ) );
}
if ( !item.isEnabled() )
excluded[path].append( item.name() );
+ if ( !excluded.contains( path ) )
+ excluded[path] = QString::null;
+
}
/*
* The code below wouldn't work because we can't delete groups/keys from the config
* ### for ODP make Config right!
*/
// if ( excluded.isEmpty() && positions.isEmpty() ) return;
/*