Beispiel #1
0
void ConfigProject::configProjects(QString projectsdir)
{
	QDir dir(projectsdir);
	if(!dir.exists())
	{
		return;
	}
	dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
	dir.setSorting(QDir::DirsFirst);
	QFileInfoList list=dir.entryInfoList();
	int i,n=list.size();
	for(i=0;i<n;i++)
	{
		QFileInfo fileinfo=list.at(i);
		QString filename=fileinfo.absoluteFilePath();
		if(fileinfo.isDir()&&ui.Recursive->isChecked())
		{
			configProjects(filename);
		}
		else if(fileinfo.fileName().endsWith(".vcxproj"))
		{
			configProject(filename);
		}
		else if(fileinfo.fileName().endsWith(".sln"))
		{
			configSolution(filename);
		}
        else if(fileinfo.fileName().endsWith(".pro"))
        {
            configQtPro(filename);
        }
	}
}
Beispiel #2
0
bool MConfig::readFile( const WFileName& filename, bool reqd )
{
    WTokenFile fil;
    WFileName tmp_name( filename );

    _ok = false;
    if( tmp_name.addPath( _include_path ) ) {
        _ok = fil.open( tmp_name, OStyleRead );
    }
    if( !_ok ) {
        _ok = fil.open( filename, "PATH" );
    }
    if( !_ok ) {
        _ok = !reqd;
        if( !_ok ) {
            _errMsg.printf( "Unable to open '%s'", (const char*)filename );
        }
    } else {
        _filename = fil.filename();
        WString tok;
        fil.token( tok );
        for(; !fil.eof(); ) {
            if( tok == "Tool" ) {
                _tools.add( new MTool( fil, tok ) );
            } else if( tok == "Rule" ) {
                _rules.add( new MRule( fil, tok ) );
            } else if( tok == "Project" ) {
                configProject( fil, tok );
            } else if( tok == "MsgLog" ) {
                configMsgLog( fil, tok );
            } else if( tok == "IncludeFile" ) {
                WFileName fn;
                fil.token( fn );
                if( !readFile( fn, false ) ) break;
                fil.token( tok );
            } else if( tok == "HostMask" ) {
                fil.token( _hostMask );
                fil.token( tok );
            } else if( tok == "Version" ) {
                _version = (int)fil.token( tok );
                if( _version > CUR_CFG_VERSION ) {
                    _ok = false;
                    _errMsg.printf( "Configuration file '%s' format is too new.  "
                                    "you must use a newer version of the IDE.",
                                    (const char*)filename );
                    break;
                }
                fil.token( tok );
            } else if( tok == "rem" ) {
                fil.flushLine( tok );
                fil.token( tok );
            } else if( _version < 5 && tok == "Compat" ) {
                WString good;
                WString bad;
                fil.token( good );
                fil.token( bad );
                AddTypo( good, bad );
                fil.token( tok );
            } else {
                _ok = false;
                _errMsg.printf( "Error in '%s', line %d, at '%s'", (const char*)filename, fil.lineCount(), (const char*)tok );
                break;
            }
        }
        fil.close();
    }
    buildTargetOSList();
    return( _ok );
}