kdevqtimporter.cpp
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2003 by Roberto Raggi * 00003 * roberto@kdevelop.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 ***************************************************************************/ 00011 00012 #include "kdevqtimporter.h" 00013 #include "kdevqtimporter.moc" 00014 #include "settingsdialog.h" 00015 00016 #include <kgenericfactory.h> 00017 00018 #include <qlabel.h> 00019 #include <qdir.h> 00020 00021 K_EXPORT_COMPONENT_FACTORY( libkdevqtimporter, KGenericFactory<KDevQtImporter>( "kdevqtimporter" ) ) 00022 00023 KDevQtImporter::KDevQtImporter( QObject * parent, const char * name, const QStringList& ) 00024 : KDevPCSImporter( parent, name ) 00025 { 00026 } 00027 00028 KDevQtImporter::~KDevQtImporter() 00029 { 00030 } 00031 00032 QStringList KDevQtImporter::fileList() 00033 { 00034 if( !m_settings ) 00035 return QStringList(); 00036 00037 QDir dir( m_settings->qtDir() + "/include" ); 00038 QStringList lst = dir.entryList( "*.h" ); 00039 QStringList fileList; 00040 for( QStringList::Iterator it=lst.begin(); it!=lst.end(); ++it ) 00041 { 00042 if( (*it).startsWith("qconfig-") ){ 00043 if( (*it).endsWith(m_settings->configuration() + ".h" ) ) 00044 fileList.prepend( dir.absPath() + "/" + (*it) ); 00045 } else { 00046 fileList.push_back( dir.absPath() + "/" + (*it) ); 00047 } 00048 } 00049 return fileList; 00050 } 00051 00052 QStringList KDevQtImporter::includePaths() 00053 { 00054 if( !m_settings ) 00055 return QStringList(); 00056 00057 QStringList includePaths; 00058 includePaths.push_back( m_settings->qtDir() + "/include" ); 00059 includePaths.push_back( m_settings->qtDir() + "/include/private" ); 00060 includePaths.push_back( m_settings->qtDir() + "/mkspecs/default" ); 00061 00063 return includePaths; 00064 } 00065 00066 QWidget * KDevQtImporter::createSettingsPage( QWidget * parent, const char * name ) 00067 { 00068 m_settings = new SettingsDialog( parent, name ); 00069 return m_settings; 00070 } 00071