KDevelop API Documentation

languages/php/phpconfigdata.cpp

Go to the documentation of this file.
00001 /*************************************************************************** 00002 phpconfigdata.cpp - description 00003 ------------------- 00004 begin : Thu Jun 14 2001 00005 copyright : (C) 2001 by 00006 email : 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include "phpconfigdata.h" 00019 #include "domutil.h" 00020 #include <iostream> 00021 00022 PHPConfigData::PHPConfigData(QDomDocument* dom){ 00023 // cerr << endl << "kdevelop (phpsupport): enter PHPConfigData::PHPConfigData"; 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(); // inform all others 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"
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:05 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003