languages/cpp/cppcodecompletionconfig.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
#include "cppcodecompletionconfig.h"
00014
#include "cppsupportpart.h"
00015
00016
#include <domutil.h>
00017
00018
#include <kdebug.h>
00019
#include <qdom.h>
00020
00021 QString CppCodeCompletionConfig::defaultPath = QString::fromLatin1(
"/kdevcppsupport/codecompletion" );
00022
00023 CppCodeCompletionConfig::CppCodeCompletionConfig(
CppSupportPart * part,
QDomDocument* dom )
00024 :
QObject( part ), m_part( part ), m_dom( dom )
00025 {
00026
init();
00027 }
00028
00029 CppCodeCompletionConfig::~CppCodeCompletionConfig()
00030 {
00031 }
00032
00033 void CppCodeCompletionConfig::init( )
00034 {
00035
m_includeGlobalFunctions = DomUtil::readBoolEntry( *
m_dom,
defaultPath +
"/includeGlobalFunctions",
true );
00036
m_includeTypes = DomUtil::readBoolEntry( *
m_dom,
defaultPath +
"/includeTypes",
true );
00037
m_includeEnums = DomUtil::readBoolEntry( *
m_dom,
defaultPath +
"/includeEnums",
true );
00038
m_includeTypedefs = DomUtil::readBoolEntry( *
m_dom,
defaultPath +
"/includeTypedefs",
false );
00039
m_automaticCodeCompletion = DomUtil::readBoolEntry( *
m_dom,
defaultPath +
"/automaticCodeCompletion",
true );
00040
m_automaticArgumentsHint = DomUtil::readBoolEntry( *
m_dom,
defaultPath +
"/automaticArgumentsHint",
true );
00041
m_automaticHeaderCompletion=DomUtil::readBoolEntry( *
m_dom,
defaultPath +
"/automaticHeaderCompletion",
true );
00042
m_codeCompletionDelay = DomUtil::readIntEntry( *
m_dom,
defaultPath +
"/codeCompletionDelay", 250 );
00043
m_argumentsHintDelay = DomUtil::readIntEntry( *
m_dom,
defaultPath +
"/argumentsHintDelay", 400 );
00044
m_headerCompletionDelay = DomUtil::readIntEntry( *
m_dom,
defaultPath +
"/headerCompletionDelay", 250 );
00045 }
00046
00047 void CppCodeCompletionConfig::store( )
00048 {
00049 DomUtil::writeBoolEntry( *
m_dom,
defaultPath +
"/includeGlobalFunctions",
m_includeGlobalFunctions );
00050 DomUtil::writeBoolEntry( *
m_dom,
defaultPath +
"/includeTypes",
m_includeTypes );
00051 DomUtil::writeBoolEntry( *
m_dom,
defaultPath +
"/includeEnums",
m_includeEnums );
00052 DomUtil::writeBoolEntry( *
m_dom,
defaultPath +
"/includeTypedefs",
m_includeTypedefs );
00053 DomUtil::writeBoolEntry( *
m_dom,
defaultPath +
"/automaticCodeCompletion",
m_automaticCodeCompletion );
00054 DomUtil::writeBoolEntry( *
m_dom,
defaultPath +
"/automaticArgumentsHint",
m_automaticArgumentsHint );
00055 DomUtil::writeBoolEntry( *
m_dom,
defaultPath +
"/automaticHeaderCompletion",
m_automaticHeaderCompletion );
00056 DomUtil::writeIntEntry( *
m_dom,
defaultPath +
"/codeCompletionDelay",
m_codeCompletionDelay );
00057 DomUtil::writeIntEntry( *
m_dom,
defaultPath +
"/argumentsHintDelay",
m_argumentsHintDelay );
00058 DomUtil::writeIntEntry( *
m_dom,
defaultPath +
"/headerCompletionDelay",
m_headerCompletionDelay );
00059
00060 emit
stored();
00061 }
00062
00063 void CppCodeCompletionConfig::setIncludeTypes(
bool b )
00064 {
00065
m_includeTypes = b;
00066 }
00067
00068 void CppCodeCompletionConfig::setIncludeEnums(
bool b )
00069 {
00070
m_includeEnums = b;
00071 }
00072
00073 void CppCodeCompletionConfig::setIncludeTypedefs(
bool b )
00074 {
00075
m_includeTypedefs = b;
00076 }
00077
00078 void CppCodeCompletionConfig::setAutomaticCodeCompletion(
bool b )
00079 {
00080
m_automaticCodeCompletion = b;
00081 }
00082
00083 void CppCodeCompletionConfig::setAutomaticArgumentsHint(
bool b )
00084 {
00085
m_automaticArgumentsHint = b;
00086 }
00087
00088 void CppCodeCompletionConfig::setCodeCompletionDelay(
int delay )
00089 {
00090
m_codeCompletionDelay = delay;
00091 }
00092
00093 void CppCodeCompletionConfig::setArgumentsHintDelay(
int delay )
00094 {
00095
m_argumentsHintDelay = delay;
00096 }
00097
00098 void CppCodeCompletionConfig::setIncludeGlobalFunctions(
bool b )
00099 {
00100
m_includeGlobalFunctions = b;
00101 }
00102
00103 void CppCodeCompletionConfig::setHeaderCompletionDelay(
int delay )
00104 {
00105
m_headerCompletionDelay = delay;
00106 }
00107
00108 void CppCodeCompletionConfig::setAutomaticHeaderCompletion(
bool b )
00109 {
00110
m_automaticHeaderCompletion = b;
00111 }
00112
00113
#include "cppcodecompletionconfig.moc"
This file is part of the documentation for KDevelop Version 3.0.4.