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

kdf

  • sources
  • kde-4.14
  • kdeutils
  • kdf
stdoption.cpp
Go to the documentation of this file.
1 /*
2 **
3 ** Copyright (C) 1998 by Michael Kropfberger <michael.kropfberger@gmx.net>
4 **
5 */
6 
7 /*
8 ** This program is free software; you can redistribute it and/or modify
9 ** it under the terms of the GNU General Public License as published by
10 ** the Free Software Foundation; either version 2 of the License, or
11 ** (at your option) any later version.
12 **
13 ** This program is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ** GNU General Public License for more details.
17 **
18 ** You should have received a copy of the GNU General Public License
19 ** along with this program in a file called COPYING; if not, write to
20 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 ** MA 02110-1301, USA.
22 */
23 
24 /*
25 ** Bug reports and questions can be sent to <kde-devel@kde.org>
26 */
27 
28 #include "stdoption.h"
29 
30 #include <QtCore/QString>
31 
32 #include <kapplication.h>
33 #include <kconfig.h>
34 #include <kconfiggroup.h>
35 #include <kglobal.h>
36 
37 QString CStdOption::mDefaultFileManager = QLatin1String( "dolphin %m" );
38 int CStdOption::mDefaultUpdateFrequency = 60;
39 
40 CStdOption::CStdOption( void )
41 {
42  setDefault();
43 }
44 
45 
46 CStdOption::~CStdOption( void )
47 {
48 }
49 
50 
51 void CStdOption::updateConfiguration( void )
52 {
53  KConfigGroup config(KGlobal::config(), "KDFConfig");
54  mFileManager = config.readPathEntry(
55  "FileManagerCommand", mDefaultFileManager );
56  mUpdateFrequency = config.readEntry(
57  "UpdateFrequency", mDefaultUpdateFrequency );
58  mPopupIfFull = config.readEntry(
59  "PopupIfFull", true );
60  mOpenFileManagerOnMount = config.readEntry(
61  "OpenFileMgrOnMount", false );
62 }
63 
64 
65 void CStdOption::writeConfiguration( void )
66 {
67  KConfigGroup config(KGlobal::config(), "KDFConfig");
68  config.writeEntry( "UpdateFrequency", mUpdateFrequency );
69  config.writePathEntry( "FileManagerCommand", mFileManager );
70  config.writeEntry( "PopupIfFull", mPopupIfFull );
71  config.writeEntry( "OpenFileMgrOnMount", mOpenFileManagerOnMount );
72  config.sync();
73 }
74 
75 
76 void CStdOption::writeDefaultFileManager( void )
77 {
78  KConfigGroup config(KGlobal::config(), "KDFConfig");
79  config.writePathEntry( "FileManagerCommand", mDefaultFileManager );
80  config.sync();
81 }
82 
83 
84 
85 QString CStdOption::fileManager( void )
86 {
87  return( mFileManager );
88 }
89 
90 
91 int CStdOption::updateFrequency( void )
92 {
93  return( mUpdateFrequency );
94 }
95 
96 
97 bool CStdOption::popupIfFull( void )
98 {
99  return( mPopupIfFull );
100 }
101 
102 
103 bool CStdOption::openFileManager( void )
104 {
105  return( mOpenFileManagerOnMount );
106 }
107 
108 
109 void CStdOption::setDefault( void )
110 {
111  mFileManager = mDefaultFileManager;
112  mUpdateFrequency = mDefaultUpdateFrequency;
113  mPopupIfFull = true;
114  mOpenFileManagerOnMount = false;
115 }
116 
117 
118 void CStdOption::setFileManager( const QString &fileManager )
119 {
120  mFileManager = fileManager;
121 }
122 
123 
124 void CStdOption::setUpdateFrequency( int frequency )
125 {
126  mUpdateFrequency = frequency;
127 }
128 
129 
130 void CStdOption::setPopupIfFull( bool popupIfFull )
131 {
132  mPopupIfFull = popupIfFull;
133 }
134 
135 
136 void CStdOption::setOpenFileManager( bool openFileManagerOnMount )
137 {
138  mOpenFileManagerOnMount = openFileManagerOnMount;
139 }
140 
CStdOption::writeConfiguration
void writeConfiguration(void)
Definition: stdoption.cpp:65
CStdOption::setUpdateFrequency
void setUpdateFrequency(int frequency)
Definition: stdoption.cpp:124
stdoption.h
CStdOption::setFileManager
void setFileManager(const QString &fileManager)
Definition: stdoption.cpp:118
CStdOption::popupIfFull
bool popupIfFull(void)
Definition: stdoption.cpp:97
CStdOption::openFileManager
bool openFileManager(void)
Definition: stdoption.cpp:103
CStdOption::writeDefaultFileManager
void writeDefaultFileManager(void)
Definition: stdoption.cpp:76
QString
CStdOption::setPopupIfFull
void setPopupIfFull(bool popupIfFull)
Definition: stdoption.cpp:130
CStdOption::fileManager
QString fileManager(void)
Definition: stdoption.cpp:85
QLatin1String
CStdOption::setDefault
void setDefault(void)
Definition: stdoption.cpp:109
CStdOption::~CStdOption
~CStdOption(void)
Definition: stdoption.cpp:46
CStdOption::CStdOption
CStdOption(void)
Definition: stdoption.cpp:40
CStdOption::setOpenFileManager
void setOpenFileManager(bool openFileManagerOnMount)
Definition: stdoption.cpp:136
CStdOption::updateFrequency
int updateFrequency(void)
Definition: stdoption.cpp:91
CStdOption::updateConfiguration
void updateConfiguration(void)
Definition: stdoption.cpp:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:23 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdf

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

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal