KDevelop API Documentation

src/core.cpp

Go to the documentation of this file.
00001 #include <qtimer.h> 00002 00003 00004 #include <kapplication.h> 00005 #include <kdebug.h> 00006 #include <kstatusbar.h> 00007 #include <kmainwindow.h> 00008 #include <kconfig.h> 00009 #include <kdeversion.h> 00010 00011 00012 #include "toplevel.h" 00013 #include "partcontroller.h" 00014 #include "api.h" 00015 #include "projectmanager.h" 00016 00017 00018 #include "core.h" 00019 00020 00021 Core *Core::s_instance = 0; 00022 00023 00024 Core *Core::getInstance() 00025 { 00026 if (!s_instance) 00027 s_instance = new Core; 00028 return s_instance; 00029 } 00030 00031 00032 Core::Core() 00033 : KDevCore() 00034 { 00035 } 00036 00037 00038 Core::~Core() 00039 { 00040 } 00041 00042 void Core::insertNewAction( KAction* action ) 00043 { 00044 Q_UNUSED( action ); 00045 } 00046 00047 00048 bool Core::queryClose() 00049 { 00050 // save the the project to open it automaticly on startup if needed 00051 KConfig* config = kapp->config(); 00052 config->setGroup("General Options"); 00053 #if defined(KDE_IS_VERSION) 00054 # if KDE_IS_VERSION(3,1,3) 00055 # ifndef _KDE_3_1_3_ 00056 # define _KDE_3_1_3_ 00057 # endif 00058 # endif 00059 #endif 00060 #if defined(_KDE_3_1_3_) 00061 config->writePathEntry("Last Project",ProjectManager::getInstance()->projectFile().url()); 00062 #else 00063 config->writeEntry("Last Project",ProjectManager::getInstance()->projectFile().url()); 00064 #endif 00065 00066 if ( ProjectManager::getInstance()->projectLoaded() 00067 && !ProjectManager::getInstance()->closeProject() ) 00068 return false; 00069 if ( !PartController::getInstance()->readyToClose() ) 00070 return false; 00071 return true; 00072 } 00073 00074 00075 void Core::running(KDevPlugin * which, bool runs) 00076 { 00077 emit activeProcessChanged( which, runs ); 00078 } 00079 00080 00081 void Core::fillContextMenu(QPopupMenu *popup, const Context *context) 00082 { 00083 emit contextMenu(popup, context); 00084 } 00085 00086 00087 void Core::openProject(const QString& projectFileName) 00088 { 00089 ProjectManager::getInstance()->loadProject(projectFileName); 00090 } 00091 00092 namespace MainWindowUtils{ 00093 QString beautifyToolTip(const QString& text) 00094 { 00095 QString temp = text; 00096 temp.replace(QRegExp("&"), ""); 00097 temp.replace(QRegExp("\\.\\.\\."), ""); 00098 return temp; 00099 } 00100 } 00101 00102 #include "core.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 Tue Oct 19 08:01:52 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003