File indexing completed on 2024-04-21 15:07:54

0001 /*
0002  * Copyright 1999 by Martin R. Jones <mjones@kde.org>
0003  *
0004  * This program is free software; you can redistribute it and/or modify
0005  * it under the terms of the GNU General Public License as published by
0006  * the Free Software Foundation; either version 2 of the License, or
0007  * (at your option) any later version.
0008  *
0009  * This program is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  * GNU General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU General Public License
0015  * along with this program; if not, write to the Free Software
0016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0017  */
0018 #include "amorconfig.h"
0019 
0020 #include <KConfigGroup>
0021 #include <KSharedConfig>
0022 
0023 
0024 AmorConfig::AmorConfig()
0025   : mTheme(QLatin1String( "blobrc" ) ),
0026     mOnTop( false ),
0027     mOffset( 0 ),
0028     mTips( false ),
0029     mRandomTheme( false ),
0030     mAppTips( true ),
0031     mStaticPos( 20 )
0032 {
0033 }
0034 
0035 
0036 void AmorConfig::read()
0037 {
0038     KSharedConfig::Ptr config = KSharedConfig::openConfig();
0039     KConfigGroup cs( config, "General" );
0040 
0041     mOnTop = cs.readEntry( "OnTop", false );
0042     mOffset = cs.readEntry( "Offset", 0 );
0043     mTheme = cs.readEntry( "Theme", "blobrc" );
0044     mTips = cs.readEntry( "Tips", false );
0045     mRandomTheme = cs.readEntry( "RandomTheme", false );
0046     mAppTips = cs.readEntry( "ApplicationTips", true );
0047     mStaticPos = cs.readEntry( "StaticPosition", 20 );
0048 }
0049 
0050 
0051 void AmorConfig::write()
0052 {
0053     KSharedConfig::Ptr config = KSharedConfig::openConfig();
0054     KConfigGroup cs( config, "General" );
0055 
0056     cs.writeEntry( "OnTop", mOnTop );
0057     cs.writeEntry( "Offset", mOffset );
0058     cs.writeEntry( "Theme", mTheme );
0059     cs.writeEntry( "Tips", mTips );
0060     cs.writeEntry( "RandomTheme", mRandomTheme );
0061     cs.writeEntry( "ApplicationTips", mAppTips );
0062     cs.writeEntry( "StaticPosition", mStaticPos );
0063 
0064     config->sync();
0065 }
0066 
0067 
0068 // kate: word-wrap off; encoding utf-8; indent-width 4; tab-width 4; line-numbers on; mixed-indent off; remove-trailing-space-save on; replace-tabs-save on; replace-tabs on; space-indent on;
0069 // vim:set spell et sw=4 ts=4 nowrap cino=l1,cs,U1: