diff options
Diffstat (limited to 'tqtinterface/qt4/qmake/generators/win32/msvc_dsp.cpp')
-rw-r--r-- | tqtinterface/qt4/qmake/generators/win32/msvc_dsp.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/tqtinterface/qt4/qmake/generators/win32/msvc_dsp.cpp b/tqtinterface/qt4/qmake/generators/win32/msvc_dsp.cpp index e50c136..52fa2af 100644 --- a/tqtinterface/qt4/qmake/generators/win32/msvc_dsp.cpp +++ b/tqtinterface/qt4/qmake/generators/win32/msvc_dsp.cpp @@ -81,7 +81,7 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) } if (dspfile.startsWith("\"") && dspfile.endsWith("\"")) dspfile = dspfile.mid(1, dspfile.length() - 2); - TQString dspfile_loc = tqfindTemplate(dspfile); + TQString dspfile_loc = findTemplate(dspfile); TQFile file(dspfile_loc); if(!file.open(IO_ReadOnly)) { @@ -101,11 +101,11 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) if (usePCH) { // Created files TQString origTarget = project->first("TQMAKE_ORIG_TARGET"); - origTarget.tqreplace(TQRegExp("-"), "_"); + origTarget.replace(TQRegExp("-"), "_"); precompObj = "\"$(IntDir)\\" + origTarget + Option::obj_ext + "\""; precompPch = "\"$(IntDir)\\" + origTarget + ".pch\""; // Add PRECOMPILED_HEADER to HEADERS - if (!project->variables()["HEADERS"].tqcontains(precompH)) + if (!project->variables()["HEADERS"].contains(precompH)) project->variables()["HEADERS"] += precompH; // Add precompile compiler options project->variables()["PRECOMPILED_FLAGS_REL"] = TQString("/Yu\"" + namePCH + "\" /FI\"" + namePCH + "\" "); @@ -118,8 +118,8 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) TQString line; while ( !dsp.eof() ) { line = dsp.readLine(); - while((rep = line.tqfind(TQRegExp("\\$\\$[a-zA-Z0-9_-]*"))) != -1) { - TQString torep = line.mid(rep, line.tqfind(TQRegExp("[^\\$a-zA-Z0-9_-]"), rep) - rep); + while((rep = line.find(TQRegExp("\\$\\$[a-zA-Z0-9_-]*"))) != -1) { + TQString torep = line.mid(rep, line.find(TQRegExp("[^\\$a-zA-Z0-9_-]"), rep) - rep); TQString variable = torep.right(torep.length()-2); t << line.left(rep); //output the left side @@ -129,7 +129,7 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) continue; TQString tqmocpath = var( "TQMAKE_TQMOC" ); - tqmocpath = tqmocpath.tqreplace( TQRegExp( "\\..*$" ), "" ) + " "; + tqmocpath = tqmocpath.replace( TQRegExp( "\\..*$" ), "" ) + " "; TQStringList list = project->variables()["SOURCES"] + project->variables()["DEF_FILE"]; if(!project->isActiveConfig("flat")) @@ -142,16 +142,16 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) t << "# SUBTRACT CPP /FI\"" << namePCH << "\" /Yu\"" << namePCH << "\" /Fp" << endl; if ( project->isActiveConfig("tqmoc") && (*it).endsWith(Option::cpp_tqmoc_ext)) { TQString base = (*it); - TQT_TQSTRING(base.tqreplace(TQRegExp("\\..*$"), "")).upper(); - base.tqreplace(TQRegExp("[^a-zA-Z]"), "_"); + TQT_TQSTRING(base.replace(TQRegExp("\\..*$"), "")).upper(); + base.replace(TQRegExp("[^a-zA-Z]"), "_"); - TQString build = "\n\n# Begin Custom Build - Moc'ing " + tqfindMocSource((*it)) + + TQString build = "\n\n# Begin Custom Build - Moc'ing " + findMocSource((*it)) + "...\n" "InputPath=.\\" + (*it) + "\n\n" "\"" + (*it) + "\"" " : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n" - "\t" + tqmocpath + tqfindMocSource((*it)) + " -o " + + "\t" + tqmocpath + findMocSource((*it)) + " -o " + (*it) + "\n\n" "# End Custom Build\n\n"; - t << "USERDEP_" << base << "=\".\\" << tqfindMocSource((*it)) << "\" \"$(TQTDIR)\\bin\\tqmoc.exe\"" << endl << endl; + t << "USERDEP_" << base << "=\".\\" << findMocSource((*it)) << "\" \"$(TQTDIR)\\bin\\tqmoc.exe\"" << endl << endl; t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Release\"" << build << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Debug\"" @@ -183,8 +183,8 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) // Create unique baseID TQString base = (*it); { - TQT_TQSTRING(base.tqreplace(TQRegExp("\\..*$"), "")).upper(); - base.tqreplace(TQRegExp("[^a-zA-Z]"), "_"); + TQT_TQSTRING(base.replace(TQRegExp("\\..*$"), "")).upper(); + base.replace(TQRegExp("[^a-zA-Z]"), "_"); } if (usePCH && precompH.endsWith(*it)) { TQString basicBuildCmd = TQString("\tcl.exe /TP /W3 /FD /c /D \"WIN32\" /Yc /Fp\"%1\" /Fo\"%2\" %3 %4 %5 %6 %7 %8 %9 /D \"") @@ -218,15 +218,15 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) compilePCH = precompPch + " : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n $(BuildCmds)\n\n"; - TQStringList &tmp = tqfindDependencies(precompH); + TQStringList &tmp = findDependencies(precompH); if(!tmp.isEmpty()) // Got Deps for PCH customDependencies += tmp; } - if (project->isActiveConfig("tqmoc") && !tqfindMocDestination((*it)).isEmpty()) { + if (project->isActiveConfig("tqmoc") && !findMocDestination((*it)).isEmpty()) { TQString tqmocpath = var( "TQMAKE_TQMOC" ); - tqmocpath = tqmocpath.tqreplace( TQRegExp( "\\..*$" ), "" ) + " "; - buildCmds += "\t" + tqmocpath + (*it) + " -o " + tqfindMocDestination((*it)) + " \\\n"; - createTQMOC = "\"" + tqfindMocDestination((*it)) + "\" : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n $(BuildCmds)\n\n"; + tqmocpath = tqmocpath.replace( TQRegExp( "\\..*$" ), "" ) + " "; + buildCmds += "\t" + tqmocpath + (*it) + " -o " + findMocDestination((*it)) + " \\\n"; + createTQMOC = "\"" + findMocDestination((*it)) + "\" : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n $(BuildCmds)\n\n"; customDependencies += "\"$(TQTDIR)\\bin\\tqmoc.exe\""; } if (!createTQMOC.isEmpty() || !compilePCH.isEmpty()) { @@ -276,11 +276,11 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) TQString ext = variable == "MSVCDSP_FORMSOURCES" ? ".cpp" : ".h"; for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it) { TQString base = (*it); - int dot = base.tqfindRev("."); - base.tqreplace( dot, base.length() - dot, ext ); + int dot = base.findRev("."); + base.replace( dot, base.length() - dot, ext ); TQString fname = base; - int lbs = fname.tqfindRev( "\\" ); + int lbs = fname.findRev( "\\" ); TQString fpath; if ( lbs != -1 ) fpath = fname.left( lbs + 1 ); @@ -309,10 +309,10 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) list.sort(); for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it) { TQString sify = *it; - sify.tqreplace('/', '\\' ); + sify.replace('/', '\\' ); TQString base = (*it); - TQT_TQSTRING(base.tqreplace(TQRegExp("\\..*$"), "")).upper(); - base.tqreplace(TQRegExp("[^a-zA-Z]"), "_"); + TQT_TQSTRING(base.replace(TQRegExp("\\..*$"), "")).upper(); + base.replace(TQRegExp("[^a-zA-Z]"), "_"); // beginGroupForFile(sify, t); t << "# Begin Source File\n\nSOURCE=" << sify << endl; @@ -325,7 +325,7 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) continue; TQString tqmocpath = var( "TQMAKE_TQMOC" ); - tqmocpath = tqmocpath.tqreplace( TQRegExp( "\\..*$" ), "" ) + " "; + tqmocpath = tqmocpath.replace( TQRegExp( "\\..*$" ), "" ) + " "; TQStringList list = project->variables()["SRCTQMOC"]; if(!project->isActiveConfig("flat")) @@ -335,16 +335,16 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) t << "# Begin Source File\n\nSOURCE=" << (*it) << endl; if ( project->isActiveConfig("tqmoc") && (*it).endsWith(Option::cpp_tqmoc_ext)) { TQString base = (*it); - TQT_TQSTRING(base.tqreplace(TQRegExp("\\..*$"), "")).upper(); - base.tqreplace(TQRegExp("[^a-zA-Z]"), "_"); + TQT_TQSTRING(base.replace(TQRegExp("\\..*$"), "")).upper(); + base.replace(TQRegExp("[^a-zA-Z]"), "_"); - TQString build = "\n\n# Begin Custom Build - Moc'ing " + tqfindMocSource((*it)) + + TQString build = "\n\n# Begin Custom Build - Moc'ing " + findMocSource((*it)) + "...\n" "InputPath=.\\" + (*it) + "\n\n" "\"" + (*it) + "\"" " : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\n" - "\t" + tqmocpath + tqfindMocSource((*it)) + " -o " + + "\t" + tqmocpath + findMocSource((*it)) + " -o " + (*it) + "\n\n" "# End Custom Build\n\n"; - t << "USERDEP_" << base << "=\".\\" << tqfindMocSource((*it)) << "\" \"$(TQTDIR)\\bin\\tqmoc.exe\"" << endl << endl; + t << "USERDEP_" << base << "=\".\\" << findMocSource((*it)) << "\" \"$(TQTDIR)\\bin\\tqmoc.exe\"" << endl << endl; t << "!IF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Release\"" << build << "!ELSEIF \"$(CFG)\" == \"" << var("MSVCDSP_PROJECT") << " - " << platform << " Debug\"" @@ -381,7 +381,7 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) TQString base = (*it); TQString uicpath = var("TQMAKE_UIC"); - uicpath = uicpath.tqreplace(TQRegExp("\\..*$"), "") + " "; + uicpath = uicpath.replace(TQRegExp("\\..*$"), "") + " "; if ( !imagesBuildDone ) { imagesBuildDone = TRUE; @@ -420,9 +420,9 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) << "# Prop Default_Filter \"ui\"\n"; TQString uicpath = var("TQMAKE_UIC"); - uicpath = uicpath.tqreplace(TQRegExp("\\..*$"), "") + " "; + uicpath = uicpath.replace(TQRegExp("\\..*$"), "") + " "; TQString tqmocpath = var( "TQMAKE_TQMOC" ); - tqmocpath = tqmocpath.tqreplace( TQRegExp( "\\..*$" ), "" ) + " "; + tqmocpath = tqmocpath.replace( TQRegExp( "\\..*$" ), "" ) + " "; TQStringList list = project->variables()["FORMS"]; if(!project->isActiveConfig("flat")) @@ -433,8 +433,8 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) t << "# Begin Source File\n\nSOURCE=" << base << endl; TQString fname = base; - fname.tqreplace(".ui", ""); - int lbs = fname.tqfindRev( "\\" ); + fname.replace(".ui", ""); + int lbs = fname.findRev( "\\" ); TQString fpath; if ( lbs != -1 ) fpath = fname.left( lbs + 1 ); @@ -502,7 +502,7 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) TQString fname = (*it); // beginGroupForFile(fname, t); t << "# Begin Source File\n\nSOURCE=" << fname << endl; - fname.tqreplace(".l", Option::lex_mod + Option::cpp_ext.first()); + fname.replace(".l", Option::lex_mod + Option::cpp_ext.first()); TQString build = "\n\n# Begin Custom Build - Lex'ing " + (*it) + "...\n" "InputPath=.\\" + (*it) + "\n\n" @@ -535,7 +535,7 @@ DspMakefileGenerator::writeDspParts(TQTextStream &t) TQString fname = (*it); // beginGroupForFile(fname, t); t << "# Begin Source File\n\nSOURCE=" << fname << endl; - fname.tqreplace(".y", Option::yacc_mod); + fname.replace(".y", Option::yacc_mod); TQString build = "\n\n# Begin Custom Build - Yacc'ing " + (*it) + "...\n" "InputPath=.\\" + (*it) + "\n\n" @@ -630,11 +630,11 @@ DspMakefileGenerator::init() if (project->isActiveConfig("shared")) project->variables()["DEFINES"].append("TQT_DLL"); if (project->isActiveConfig("qt_dll")) - if(configs.tqfindIndex("qt") == -1) configs.append("qt"); + if(configs.findIndex("qt") == -1) configs.append("qt"); if ( project->isActiveConfig("qtopia") ) { - if(configs.tqfindIndex("qtopialib") == -1) + if(configs.findIndex("qtopialib") == -1) configs.append("qtopialib"); - if(configs.tqfindIndex("qtopiainc") == -1) + if(configs.findIndex("qtopiainc") == -1) configs.append("qtopiainc"); } if ( project->isActiveConfig("qt") ) { @@ -642,9 +642,9 @@ DspMakefileGenerator::init() project->variables()["CONFIG"].append("dll"); project->variables()["DEFINES"].append("TQT_PLUGIN"); } - if ( (project->variables()["DEFINES"].tqfindIndex("TQT_NODLL") == -1) && - ((project->variables()["DEFINES"].tqfindIndex("TQT_MAKEDLL") != -1 || - project->variables()["DEFINES"].tqfindIndex("TQT_DLL") != -1) || + if ( (project->variables()["DEFINES"].findIndex("TQT_NODLL") == -1) && + ((project->variables()["DEFINES"].findIndex("TQT_MAKEDLL") != -1 || + project->variables()["DEFINES"].findIndex("TQT_DLL") != -1) || (getenv("TQT_DLL") && !getenv("TQT_NODLL"))) ) { project->variables()["TQMAKE_TQT_DLL"].append("1"); if ( is_qt && !project->variables()["TQMAKE_LIB_FLAG"].isEmpty() ) @@ -663,10 +663,10 @@ DspMakefileGenerator::init() } if ( !project->variables()["VERSION"].isEmpty() ) { TQString version = project->variables()["VERSION"][0]; - int firstDot = version.tqfind( "." ); + int firstDot = version.find( "." ); TQString major = version.left( firstDot ); TQString minor = version.right( version.length() - firstDot - 1 ); - minor.tqreplace( ".", "" ); + minor.replace( ".", "" ); project->variables()["MSVCDSP_VERSION"].append( "/VERSION:" + major + "." + minor ); } @@ -694,15 +694,15 @@ DspMakefileGenerator::init() else project->variables()["TQMAKE_LIBS"] += project->variables()["TQMAKE_LIBS_QT"]; if ( !project->variables()["TQMAKE_TQT_DLL"].isEmpty() ) { - int hver = tqfindHighestVersion(project->first("TQMAKE_LIBDIR_QT"), "qt"); + int hver = findHighestVersion(project->first("TQMAKE_LIBDIR_QT"), "qt"); if ( hver == -1 ) - hver = tqfindHighestVersion(project->first("TQMAKE_LIBDIR_QT"), "qt-mt"); + hver = findHighestVersion(project->first("TQMAKE_LIBDIR_QT"), "qt-mt"); if(hver != -1) { TQString ver; ver.sprintf("qt%s" TQTDLL_POSTFIX "%d.lib", (thread ? "-mt" : ""), hver); TQStringList &libs = project->variables()["TQMAKE_LIBS"]; for(TQStringList::Iterator libit = libs.begin(); libit != libs.end(); ++libit) - (*libit).tqreplace(TQRegExp("qt(-mt)?\\.lib"), ver); + (*libit).replace(TQRegExp("qt(-mt)?\\.lib"), ver); } } if ( project->isActiveConfig( "activeqt" ) ) { @@ -757,7 +757,7 @@ DspMakefileGenerator::init() project->variables()["MSVCDSP_MTDEFD"] += project->variables()["TQMAKE_CXXFLAGS_MT_DBG"]; project->variables()["MSVCDSP_MTDEF"] += project->variables()["TQMAKE_CXXFLAGS_MT"]; } - if ( !project->variables()["DEFINES"].tqcontains("TQT_DLL") && is_qt + if ( !project->variables()["DEFINES"].contains("TQT_DLL") && is_qt && project->first("TARGET") != "qtmain" ) project->variables()["TQMAKE_LFLAGS"].append("/NODEFAULTLIB:\"libc\""); } @@ -775,7 +775,7 @@ DspMakefileGenerator::init() project->variables()["TQMAKE_LFLAGS_WINDOWS_ANY"] = project->variables()["TQMAKE_LFLAGS_WINDOWS_DLL"]; if ( !project->variables()["TQMAKE_LIB_FLAG"].isEmpty() ) { TQString ver_xyz(project->first("VERSION")); - ver_xyz.tqreplace(".", ""); + ver_xyz.replace(".", ""); project->variables()["TARGET_EXT"].append(ver_xyz + ".dll"); } else { project->variables()["TARGET_EXT"].append(".dll"); @@ -840,15 +840,15 @@ DspMakefileGenerator::init() if ( msvcdsp_project.isEmpty() ) msvcdsp_project = Option::output.name(); - msvcdsp_project = msvcdsp_project.right( msvcdsp_project.length() - msvcdsp_project.tqfindRev( "\\" ) - 1 ); - msvcdsp_project = msvcdsp_project.left( msvcdsp_project.tqfindRev( "." ) ); - msvcdsp_project.tqreplace("-", ""); + msvcdsp_project = msvcdsp_project.right( msvcdsp_project.length() - msvcdsp_project.findRev( "\\" ) - 1 ); + msvcdsp_project = msvcdsp_project.left( msvcdsp_project.findRev( "." ) ); + msvcdsp_project.replace("-", ""); project->variables()["MSVCDSP_PROJECT"].append(msvcdsp_project); TQStringList &proj = project->variables()["MSVCDSP_PROJECT"]; for(it = proj.begin(); it != proj.end(); ++it) - (*it).tqreplace(TQRegExp("\\.[a-zA-Z0-9_]*$"), ""); + (*it).replace(TQRegExp("\\.[a-zA-Z0-9_]*$"), ""); if ( !project->variables()["TQMAKE_APP_FLAG"].isEmpty() ) { project->variables()["MSVCDSP_TEMPLATE"].append("win32app" + project->first( "DSP_EXTENSION" ) ); @@ -901,14 +901,14 @@ DspMakefileGenerator::init() TQStringList &libs = project->variables()["TQMAKE_LIBS"]; for(TQStringList::Iterator libit = libs.begin(); libit != libs.end(); ++libit) { TQString lib = (*libit); - lib.tqreplace(TQRegExp("\""), ""); + lib.replace(TQRegExp("\""), ""); project->variables()["MSVCDSP_LIBS"].append(" \"" + lib + "\""); } TQStringList &incs = project->variables()["INCLUDEPATH"]; for(TQStringList::Iterator incit = incs.begin(); incit != incs.end(); ++incit) { TQString inc = (*incit); - inc.tqreplace("\"", ""); + inc.replace("\"", ""); if(inc.endsWith("\\")) // Remove trailing \'s from paths inc.truncate(inc.length()-1); if (inc.startsWith("\"") && inc.endsWith("\"")) @@ -941,12 +941,12 @@ DspMakefileGenerator::init() Option::fixPathToTargetOS(project->first("TARGET")); dest = project->first("TARGET"); if ( project->first("TARGET").startsWith("$(TQTDIR)") ) - dest.tqreplace( "$(TQTDIR)", getenv("TQTDIR") ); + dest.replace( "$(TQTDIR)", getenv("TQTDIR") ); project->variables()["MSVCDSP_TARGET"].append( TQString("/out:\"") + dest + "\""); if ( project->isActiveConfig("dll") ) { TQString imp = dest; - imp.tqreplace(".dll", ".lib"); + imp.replace(".dll", ".lib"); project->variables()["MSVCDSP_TARGET"].append(TQString(" /implib:\"") + imp + "\""); } } @@ -1028,7 +1028,7 @@ DspMakefileGenerator::init() TQString -DspMakefileGenerator::tqfindTemplate(const TQString &file) +DspMakefileGenerator::findTemplate(const TQString &file) { TQString ret; if(!TQFile::exists((ret = file)) && @@ -1046,7 +1046,7 @@ DspMakefileGenerator::processPrlVariable(const TQString &var, const TQStringList if(var == "TQMAKE_PRL_DEFINES") { TQStringList &out = project->variables()["MSVCDSP_DEFINES"]; for(TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it) { - if(out.tqfindIndex((*it)) == -1) + if(out.findIndex((*it)) == -1) out.append((" /D \"" + *it + "\"")); } } else { @@ -1076,11 +1076,11 @@ DspMakefileGenerator::beginGroupForFile(TQString file, TQTextStream &t, TQString tempFile = file; if(tempFile.startsWith(currentGroup)) tempFile = tempFile.mid(currentGroup.length()); - int dirSep = currentGroup.tqfindRev( Option::dir_sep ); + int dirSep = currentGroup.findRev( Option::dir_sep ); while( !tempFile.startsWith( currentGroup ) && dirSep != -1 ) { currentGroup.truncate( dirSep ); - dirSep = currentGroup.tqfindRev( Option::dir_sep ); + dirSep = currentGroup.findRev( Option::dir_sep ); if ( !tempFile.startsWith( currentGroup ) && dirSep != -1 ) t << "\n# End Group\n"; } @@ -1129,14 +1129,14 @@ DspMakefileGenerator::openOutput(TQFile &file) const if(TQDir::isRelativePath(file.name())) { TQString ofile; ofile = file.name(); - int slashtqfind = ofile.tqfindRev('\\'); - if (slashtqfind == -1) { - ofile = ofile.tqreplace(TQRegExp("-"), "_"); + int slashfind = ofile.findRev('\\'); + if (slashfind == -1) { + ofile = ofile.replace(TQRegExp("-"), "_"); } else { - int hypentqfind = ofile.tqfind('-', slashtqfind); - while (hypentqfind != -1 && slashtqfind < hypentqfind) { - ofile = ofile.tqreplace(hypentqfind, 1, "_"); - hypentqfind = ofile.tqfind('-', hypentqfind + 1); + int hypenfind = ofile.find('-', slashfind); + while (hypenfind != -1 && slashfind < hypenfind) { + ofile = ofile.replace(hypenfind, 1, "_"); + hypenfind = ofile.find('-', hypenfind + 1); } } file.setName(Option::fixPathToLocalOS(TQDir::currentDirPath() + Option::dir_sep + ofile)); |