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

« back to all changes in this revision

Viewing changes to kompare/libdialogpages/viewsettings.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
 
                                generalsettings.cpp  -  description
 
2
                                generalsettings.cpp
3
3
                                -------------------
4
4
        begin                   : Sun Mar 4 2001
5
 
        copyright               : (C) 2001-2003 by Otto Bruggeman
6
 
                                  and John Firebaugh
7
 
        email                   : otto.bruggeman@home.nl
8
 
                                  jfirebaugh@kde.org
 
5
        Copyright 2001-2003 Otto Bruggeman <otto.bruggeman@home.nl>
 
6
        Copyright 2001-2003 John Firebaugh <jfirebaugh@kde.org>
 
7
        Copyright 2007      Kevin Kofler   <kevin.kofler@chello.at>
9
8
****************************************************************************/
10
9
 
11
10
/***************************************************************************
17
16
**
18
17
***************************************************************************/
19
18
 
20
 
#include <qfont.h>
 
19
#include "viewsettings.h"
 
20
 
 
21
#include <QtGui/QFont>
21
22
 
22
23
#include <kconfig.h>
23
24
#include <kglobalsettings.h>
24
 
 
25
 
#include "viewsettings.h"
 
25
#include <kconfiggroup.h>
26
26
 
27
27
using namespace Diff2;
28
28
 
49
49
void ViewSettings::loadSettings( KConfig* config )
50
50
{
51
51
        KConfigGroup cfg( config, "View Options" );
52
 
        m_removeColor         = cfg.readColorEntry( "RemoveColor",         &default_removeColor );
53
 
        m_changeColor         = cfg.readColorEntry( "ChangeColor",         &default_changeColor );
54
 
        m_addColor            = cfg.readColorEntry( "AddColor",            &default_addColor );
55
 
        m_appliedColor        = cfg.readColorEntry( "AppliedColor",        &default_appliedColor );
56
 
        m_scrollNoOfLines     = cfg.readNumEntry  ( "ScrollNoOfLines",     3 );
57
 
        m_tabToNumberOfSpaces = cfg.readNumEntry  ( "TabToNumberOfSpaces", 4 );
 
52
        m_removeColor         = cfg.readEntry( "RemoveColor",         default_removeColor );
 
53
        m_changeColor         = cfg.readEntry( "ChangeColor",         default_changeColor );
 
54
        m_addColor            = cfg.readEntry( "AddColor",            default_addColor );
 
55
        m_appliedColor        = cfg.readEntry( "AppliedColor",        default_appliedColor );
 
56
        m_scrollNoOfLines     = cfg.readEntry  ( "ScrollNoOfLines",     3 );
 
57
        m_tabToNumberOfSpaces = cfg.readEntry  ( "TabToNumberOfSpaces", 4 );
58
58
 
59
59
        QFont stdFixed = KGlobalSettings::fixedFont();
60
60
        stdFixed.setPointSize( 10 );
61
 
        m_font                = cfg.readFontEntry ( "TextFont", &stdFixed );
 
61
        m_font                = cfg.readEntry ( "TextFont", stdFixed );
62
62
}
63
63
 
64
64
void ViewSettings::saveSettings( KConfig* config )
84
84
        {
85
85
                type = type & 0xFFFFFFEF; // remove the AppliedByBlend
86
86
                switch( type ) {
87
 
                        case Difference::Unchanged: color = white; break;
 
87
                                case Difference::Unchanged: color = Qt::white; break;
88
88
                        case Difference::Change:    color = m_changeColor; break;
89
89
                        case Difference::Insert:    color = m_addColor; break;
90
90
                        case Difference::Delete:    color = m_removeColor; break;