phpconfigdata.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 #include "phpconfigdata.h"
00019 #include "domutil.h"
00020 #include <iostream>
00021
00022 PHPConfigData::PHPConfigData(QDomDocument* dom){
00023
00024
00025 document = dom;
00026 invocationMode = (InvocationMode) DomUtil::readIntEntry(*dom, "/kdevphpsupport/general/invocationMode");
00027
00028 webURL = DomUtil::readEntry(*document, "/kdevphpsupport/webInvocation/weburl");
00029 webFileMode = (WebFileMode)DomUtil::readIntEntry(*document, "/kdevphpsupport/webInvocation/webFileMode");
00030 webDefaultFile = DomUtil::readEntry(*document, "/kdevphpsupport/webInvocation/defaultFile");
00031
00032 phpExePath = DomUtil::readEntry(*document, "/kdevphpsupport/shell/phpexe");
00033
00034 m_codeCompletion = DomUtil::readBoolEntry(*document,"kdevphpsupport/codeHelp/codeCompletion");
00035 m_codeHinting = DomUtil::readBoolEntry(*document,"kdevphpsupport/codeHelp/codeHinting");;
00036 m_realtimeParsing = DomUtil::readBoolEntry(*document,"kdevphpsupport/codeHelp/realtimeParsing");
00037
00038 }
00039 PHPConfigData::~PHPConfigData(){
00040 }
00041
00042 void PHPConfigData::storeConfig(){
00043 DomUtil::writeIntEntry(*document, "/kdevphpsupport/general/invocationMode",(int) invocationMode);
00044
00045 DomUtil::writeEntry(*document, "/kdevphpsupport/webInvocation/weburl",webURL);
00046 DomUtil::writeIntEntry(*document, "/kdevphpsupport/webInvocation/webFileMode",(int) webFileMode);
00047 DomUtil::writeEntry(*document, "/kdevphpsupport/webInvocation/defaultFile",webDefaultFile);
00048
00049 DomUtil::writeEntry(*document, "/kdevphpsupport/shell/phpexe",phpExePath);
00050 DomUtil::writeBoolEntry(*document,"kdevphpsupport/codeHelp/codeCompletion",m_codeCompletion);
00051 DomUtil::writeBoolEntry(*document,"kdevphpsupport/codeHelp/codeHinting",m_codeHinting);
00052 DomUtil::writeBoolEntry(*document,"kdevphpsupport/codeHelp/realtimeParsing",m_realtimeParsing);
00053 emit configStored();
00054
00055 }
00056
00057 bool PHPConfigData::validateConfig(){
00058 bool valid = false;
00059 if(invocationMode == Web || invocationMode == Shell) {
00060 valid = true;
00061 }
00062 if(valid){
00063 if(invocationMode == Web){
00064 if(!(!webURL.isEmpty() && (webFileMode == Default || webFileMode == Current))){
00065 valid = false;
00066 }
00067 }
00068 if(invocationMode == Shell){
00069 if(phpExePath.isEmpty()){
00070 valid = false;
00071 }
00072 }
00073 }
00074 return valid;
00075 }
00076 #include "phpconfigdata.moc"
This file is part of the documentation for KDevelop Version 3.1.2.