• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

korganizer

docprefs.cpp

Go to the documentation of this file.
00001 /*
00002   This file is part of KOrganizer.
00003   Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
00004   Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
00005 
00006   This program is free software; you can redistribute it and/or modify
00007   it under the terms of the GNU General Public License as published by
00008   the Free Software Foundation; either version 2 of the License, or
00009   (at your option) any later version.
00010 
00011   This program is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014   GNU General Public License for more details.
00015 
00016   You should have received a copy of the GNU General Public License along
00017   with this program; if not, write to the Free Software Foundation, Inc.,
00018   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020   As a special exception, permission is given to link this program
00021   with any edition of Qt, and distribute the resulting executable,
00022   without including the source code for Qt in the source distribution.
00023 */
00024 
00025 #include "docprefs.h"
00026 
00027 #include <kconfig.h>
00028 #include <kconfiggroup.h>
00029 #include <kstandarddirs.h>
00030 
00031 KConfig *DocPrefs::mConfig = 0;
00032 
00033 DocPrefs::DocPrefs( const QString &type )
00034 {
00035   if ( !mConfig ) {
00036     mConfig = new KConfig(
00037       KStandardDirs::locateLocal( "data", "korganizer/docprefs." + type + ".kconfig" ) );
00038   }
00039 }
00040 
00041 DocPrefs::~DocPrefs()
00042 {
00043   mConfig->sync();
00044 }
00045 
00046 void DocPrefs::setDoc( const QString &identifier )
00047 {
00048   mDocId = identifier;
00049 }
00050 
00051 QString DocPrefs::doc() const
00052 {
00053   return mDocId;
00054 }
00055 
00056 bool DocPrefs::readBoolEntry( const QString &id ) const
00057 {
00058   KConfigGroup docConfig( mConfig, mDocId );
00059   bool result = docConfig.readEntry( id, false );
00060   return result;
00061 }
00062 
00063 void DocPrefs::writeBoolEntry( const QString &id, bool value )
00064 {
00065   KConfigGroup docConfig( mConfig, mDocId );
00066   docConfig.writeEntry( id, value );
00067 }
00068 
00069 int DocPrefs::readNumEntry( const QString &id ) const
00070 {
00071   KConfigGroup docConfig( mConfig, mDocId );
00072   int result = docConfig.readEntry( id, 0 );
00073   return result;
00074 }
00075 
00076 void DocPrefs::writeNumEntry( const QString &id, int value )
00077 {
00078   KConfigGroup docConfig( mConfig, mDocId );
00079   docConfig.writeEntry( id, value );
00080 }

korganizer

Skip menu "korganizer"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal