[Marble-commits] KDE/kdeedu/marble/src
Dennis Nienhüser
earthwings at gentoo.org
Thu Oct 14 00:02:45 CEST 2010
SVN commit 1185618 by nienhueser:
Compile (KDE version)
M +3 -1 lib/routing/RoutingProfile.h
M +11 -11 marble_part.cpp
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingProfile.h #1185617:1185618
@@ -12,6 +12,8 @@
#ifndef MARBLE_ROUTINGPROFILE_H
#define MARBLE_ROUTINGPROFILE_H
+#include "marble_export.h"
+
#include <QtCore/QString>
#include <QtCore/QHash>
#include <QtCore/QVariant>
@@ -19,7 +21,7 @@
namespace Marble
{
-class RoutingProfile {
+class MARBLE_EXPORT RoutingProfile {
public:
explicit RoutingProfile( const QString &name = QString() );
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1185617:1185618
@@ -459,19 +459,19 @@
KSharedConfig::Ptr sharedConfig = KSharedConfig::openConfig( KGlobal::mainComponent() );
if ( sharedConfig->hasGroup( "Routing Profiles" ) ) {
- QList<RoutingProfilesModel::Profile> profiles;
+ QList<RoutingProfile> profiles;
KConfigGroup profilesGroup = sharedConfig->group( "Routing Profiles" );
int numProfiles = profilesGroup.readEntry( "Num", 0 );
for ( int i = 0; i < numProfiles; ++i ) {
KConfigGroup profileGroup = profilesGroup.group( QString( "Profile %0" ).arg(i) );
- RoutingProfilesModel::Profile profile;
- profile.name = profileGroup.readEntry( "Name", tr( "Unnamed" ) );
+ QString name = profileGroup.readEntry( "Name", tr( "Unnamed" ) );
+ RoutingProfile profile( name );
foreach ( const QString& pluginName, profileGroup.groupList() ) {
KConfigGroup pluginGroup = profileGroup.group( pluginName );
- profile.pluginSettings.insert( pluginName, QHash<QString, QVariant>() );
+ profile.pluginSettings().insert( pluginName, QHash<QString, QVariant>() );
foreach ( const QString& key, pluginGroup.keyList() ) {
if ( key != "Enabled" ) {
- profile.pluginSettings[ pluginName ].insert( key, pluginGroup.readEntry( key ) );
+ profile.pluginSettings()[ pluginName ].insert( key, pluginGroup.readEntry( key ) );
}
}
}
@@ -1299,24 +1299,24 @@
(*i)->applyItemState();
}
- QList<RoutingProfilesModel::Profile> profiles = m_controlView->marbleWidget()
+ QList<RoutingProfile> profiles = m_controlView->marbleWidget()
->model()->routingManager()->profilesModel()->profiles();
KSharedConfig::Ptr sharedConfig = KSharedConfig::openConfig( KGlobal::mainComponent() );
KConfigGroup profilesGroup = sharedConfig->group( "Routing Profiles" );
profilesGroup.writeEntry( "Num", profiles.count() );
for ( int i = 0; i < profiles.count(); ++i ) {
KConfigGroup profileGroup = profilesGroup.group( QString( "Profile %0" ).arg(i) );
- RoutingProfilesModel::Profile profile = profiles.at( i );
- profileGroup.writeEntry( "Name", profile.name );
+ RoutingProfile profile = profiles.at( i );
+ profileGroup.writeEntry( "Name", profile.name() );
foreach ( const QString &pluginName, profileGroup.groupList() ) {
profileGroup.group( pluginName ).deleteGroup();
}
- foreach ( const QString &key, profile.pluginSettings.keys() ) {
+ foreach ( const QString &key, profile.pluginSettings().keys() ) {
KConfigGroup pluginGroup = profileGroup.group( key );
pluginGroup.writeEntry( "Enabled", true );
- foreach ( const QString& settingKey, profile.pluginSettings[ key ].keys() ) {
+ foreach ( const QString& settingKey, profile.pluginSettings()[ key ].keys() ) {
Q_ASSERT( settingKey != "Enabled" );
- pluginGroup.writeEntry( settingKey, profile.pluginSettings[ key ][ settingKey ] );
+ pluginGroup.writeEntry( settingKey, profile.pluginSettings()[ key ][ settingKey ] );
}
}
}
More information about the Marble-commits
mailing list