Commit bcb8210b authored by David Jarvie's avatar David Jarvie
Browse files

Update config file when a collection's display name has been changed

svn path=/trunk/KDE/kdepim/runtime/; revision=1148654
parent 0d7103a3
......@@ -220,7 +220,6 @@ class SingleFileResource : public SingleFileResourceBase
taskDone();
}
public Q_SLOTS:
virtual void collectionChanged( const Collection &collection )
{
QString newName;
......@@ -231,10 +230,12 @@ class SingleFileResource : public SingleFileResourceBase
const QString oldName = Settings::self()->displayName();
if ( newName != oldName ) {
Settings::self()->setDisplayName( newName );
Settings::self()->writeConfig();
}
SingleFileResourceBase::collectionChanged( collection );
}
public Q_SLOTS:
/**
* Display the configuration dialog for the resource.
*/
......
......@@ -46,9 +46,6 @@ SingleFileResourceBase::SingleFileResourceBase( const QString & id )
changeRecorder()->fetchCollection( true );
connect( changeRecorder(), SIGNAL( changesAdded() ), SLOT( scheduleWrite() ) );
//TODO: The following is only necessary because inheriting from AgentBase::Observer doesn't work
connect( changeRecorder(), SIGNAL( collectionChanged(const Akonadi::Collection&)), SLOT(collectionChanged(const Akonadi::Collection&)));
connect( KDirWatch::self(), SIGNAL( dirty( QString ) ), SLOT( fileChanged( QString ) ) );
connect( KDirWatch::self(), SIGNAL( created( QString ) ), SLOT( fileChanged( QString ) ) );
......
......@@ -38,7 +38,7 @@ namespace Akonadi
* Base class for single file based resources.
* @see SingleFileResource
*/
class SingleFileResourceBase : public ResourceBase, public Akonadi::AgentBase::Observer
class SingleFileResourceBase : public ResourceBase, public AgentBase::Observer
{
Q_OBJECT
public:
......@@ -49,8 +49,9 @@ class SingleFileResourceBase : public ResourceBase, public Akonadi::AgentBase::O
*/
void setSupportedMimetypes( const QStringList &mimeTypes, const QString &icon = QString() );
void collectionChanged( const Akonadi::Collection &collection );
public Q_SLOTS:
virtual void collectionChanged( const Akonadi::Collection &collection );
void reloadFile();
virtual void readFile() = 0;
virtual void writeFile() = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment