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

kdf

stdoption.cpp

Go to the documentation of this file.
00001 /*
00002 **
00003 ** Copyright (C) 1998 by Michael Kropfberger
00004 **
00005 */
00006 
00007 /*
00008 ** This program is free software; you can redistribute it and/or modify
00009 ** it under the terms of the GNU General Public License as published by
00010 ** the Free Software Foundation; either version 2 of the License, or
00011 ** (at your option) any later version.
00012 **
00013 ** This program is distributed in the hope that it will be useful,
00014 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016 ** GNU General Public License for more details.
00017 **
00018 ** You should have received a copy of the GNU General Public License
00019 ** along with this program in a file called COPYING; if not, write to
00020 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00021 ** MA 02110-1301, USA.
00022 */
00023 
00024 /*
00025 ** Bug reports and questions can be sent to <kde-devel@kde.org>
00026 */
00027 
00028 #include "stdoption.h"
00029 
00030 #include <kapplication.h>
00031 #include <kconfig.h>
00032 #include <kconfiggroup.h>
00033 #include <kglobal.h>
00034 
00035 QString CStdOption::mDefaultFileManager = "dolphin %m";
00036 int CStdOption::mDefaultUpdateFrequency = 60;
00037 
00038 CStdOption::CStdOption( void )
00039 {
00040   setDefault();
00041 }
00042 
00043 
00044 CStdOption::~CStdOption( void )
00045 {
00046 }
00047 
00048 
00049 void CStdOption::updateConfiguration( void )
00050 {
00051   KConfigGroup config(KGlobal::config(), "KDFConfig");
00052   mFileManager = config.readPathEntry(
00053     "FileManagerCommand", mDefaultFileManager );
00054   mUpdateFrequency = config.readEntry(
00055     "UpdateFrequency", mDefaultUpdateFrequency );
00056   mPopupIfFull = config.readEntry(
00057     "PopupIfFull", true );
00058   mOpenFileManagerOnMount = config.readEntry(
00059     "OpenFileMgrOnMount", false );
00060 }
00061 
00062 
00063 void CStdOption::writeConfiguration( void )
00064 {
00065   KConfigGroup config(KGlobal::config(), "KDFConfig");
00066   config.writeEntry( "UpdateFrequency", mUpdateFrequency );
00067   config.writePathEntry( "FileManagerCommand", mFileManager );
00068   config.writeEntry( "PopupIfFull", mPopupIfFull );
00069   config.writeEntry( "OpenFileMgrOnMount", mOpenFileManagerOnMount );
00070   config.sync();
00071 }
00072 
00073 
00074 void CStdOption::writeDefaultFileManager( void )
00075 {
00076   KConfigGroup config(KGlobal::config(), "KDFConfig");
00077   config.writePathEntry( "FileManagerCommand", mDefaultFileManager );
00078   config.sync();
00079 }
00080 
00081 
00082 
00083 QString CStdOption::fileManager( void )
00084 {
00085   return( mFileManager );
00086 }
00087 
00088 
00089 int CStdOption::updateFrequency( void )
00090 {
00091   return( mUpdateFrequency );
00092 }
00093 
00094 
00095 bool CStdOption::popupIfFull( void )
00096 {
00097   return( mPopupIfFull );
00098 }
00099 
00100 
00101 bool CStdOption::openFileManager( void )
00102 {
00103   return( mOpenFileManagerOnMount );
00104 }
00105 
00106 
00107 void CStdOption::setDefault( void )
00108 {
00109   mFileManager     = mDefaultFileManager;
00110   mUpdateFrequency = mDefaultUpdateFrequency;
00111   mPopupIfFull     = true;
00112   mOpenFileManagerOnMount = false;
00113 }
00114 
00115 
00116 void CStdOption::setFileManager( const QString &fileManager )
00117 {
00118   mFileManager = fileManager;
00119 }
00120 
00121 
00122 void CStdOption::setUpdateFrequency( int frequency )
00123 {
00124   mUpdateFrequency = frequency;
00125 }
00126 
00127 
00128 void CStdOption::setPopupIfFull( bool popupIfFull )
00129 {
00130   mPopupIfFull = popupIfFull;
00131 }
00132 
00133 
00134 void CStdOption::setOpenFileManager( bool openFileManagerOnMount )
00135 {
00136   mOpenFileManagerOnMount = openFileManagerOnMount;
00137 }
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 

kdf

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

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • okteta
  • printer-applet
  • superkaramba
  • sweeper
Generated for kdeutils 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