~ubuntu-branches/ubuntu/intrepid/kdesdk/intrepid-updates

« back to all changes in this revision

Viewing changes to kompare/libdialogpages/filessettings.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-05-28 10:11:43 UTC
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: james.westby@ubuntu.com-20080528101143-gzc3styjz1b70zxu
Tags: upstream-4.0.80
ImportĀ upstreamĀ versionĀ 4.0.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
                                filessettings.cpp  -  description
3
 
                                -------------------
4
 
        begin                   : Sun Apr 18 2004
5
 
        copyright               : (C) 2004 Otto Bruggeman
6
 
        email                   : otto.bruggeman@home.nl
7
 
 
 
2
                                filessettings.cpp
 
3
                                -----------------
 
4
        begin                   : Sun Apr 18 2004
 
5
        Copyright 2004 Otto Bruggeman <otto.bruggeman@home.nl>
 
6
        Copyright 2007 Kevin Kofler   <kevin.kofler@chello.at>
8
7
****************************************************************************/
9
8
 
10
9
/***************************************************************************
16
15
**
17
16
****************************************************************************/
18
17
 
 
18
#include "filessettings.h"
 
19
 
19
20
#include <kapplication.h>
20
21
#include <kconfig.h>
21
 
 
22
 
#include "filessettings.h"
 
22
#include <kconfiggroup.h>
23
23
 
24
24
FilesSettings::FilesSettings( QWidget* parent )
25
25
        : SettingsBase( parent )
32
32
 
33
33
void FilesSettings::loadSettings( KConfig* config )
34
34
{
35
 
        config->setGroup( m_configGroupName );
 
35
        KConfigGroup group( config, m_configGroupName );
36
36
 
37
 
        m_recentSources            = config->readListEntry( "Recent Sources" );
38
 
        m_lastChosenSourceURL      = config->readEntry    ( "LastChosenSourceListEntry", "" );
39
 
        m_recentDestinations       = config->readListEntry( "Recent Destinations" );
40
 
        m_lastChosenDestinationURL = config->readEntry    ( "LastChosenDestinationListEntry", "" );
41
 
        m_encoding                 = config->readEntry    ( "Encoding", "default" );
 
37
        m_recentSources            = group.readEntry( "Recent Sources", QStringList() );
 
38
        m_lastChosenSourceURL      = group.readEntry    ( "LastChosenSourceListEntry", "" );
 
39
        m_recentDestinations       = group.readEntry( "Recent Destinations", QStringList() );
 
40
        m_lastChosenDestinationURL = group.readEntry    ( "LastChosenDestinationListEntry", "" );
 
41
        m_encoding                 = group.readEntry    ( "Encoding", "default" );
42
42
}
43
43
 
44
44
void FilesSettings::saveSettings( KConfig* config )
45
45
{
46
 
        config->setGroup( m_configGroupName );
47
 
        config->writeEntry( "Recent Sources", m_recentSources );
48
 
        config->writeEntry( "Recent Destinations", m_recentDestinations );
49
 
        config->writeEntry( "LastChosenSourceListEntry", m_lastChosenSourceURL );
50
 
        config->writeEntry( "LastChosenDestinationListEntry", m_lastChosenDestinationURL );
51
 
        config->writeEntry( "Encoding", m_encoding );
 
46
        KConfigGroup group( config, m_configGroupName );
 
47
        group.writeEntry( "Recent Sources", m_recentSources );
 
48
        group.writeEntry( "Recent Destinations", m_recentDestinations );
 
49
        group.writeEntry( "LastChosenSourceListEntry", m_lastChosenSourceURL );
 
50
        group.writeEntry( "LastChosenDestinationListEntry", m_lastChosenDestinationURL );
 
51
        group.writeEntry( "Encoding", m_encoding );
52
52
        config->sync();
53
53
}
54
54