kdf
stdoption.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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