diff options
Diffstat (limited to 'buildtools/custommakefiles/customprojectpart.cpp')
-rw-r--r-- | buildtools/custommakefiles/customprojectpart.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/buildtools/custommakefiles/customprojectpart.cpp b/buildtools/custommakefiles/customprojectpart.cpp index b25a69d7..da6ce3cd 100644 --- a/buildtools/custommakefiles/customprojectpart.cpp +++ b/buildtools/custommakefiles/customprojectpart.cpp @@ -65,8 +65,8 @@ typedef KDevGenericFactory<CustomProjectPart> CustomProjectFactory; static const KDevPluginInfo data( "kdevcustomproject" ); K_EXPORT_COMPONENT_FACTORY( libkdevcustomproject, CustomProjectFactory( data ) ) -CustomProjectPart::CustomProjectPart( TQObject *parent, const char *name, const TQStringList & ) - : KDevBuildTool( &data, parent, name ? name : "CustomProjectPart" ) +CustomProjectPart::CustomProjectPart( TQObject *tqparent, const char *name, const TQStringList & ) + : KDevBuildTool( &data, tqparent, name ? name : "CustomProjectPart" ) , m_lastCompilationFailed( false ), m_recursive( false ), m_first_recursive( false ) { setInstance( CustomProjectFactory::instance() ); @@ -231,7 +231,7 @@ void CustomProjectPart::contextMenu( TQPopupMenu *popup, const Context *context TQString popupstr = fcontext->urls().first().fileName(); - if ( popupstr == TQString::null ) + if ( popupstr == TQString() ) popupstr = "."; if ( fcontext->urls().size() == 1 && URLUtil::isDirectory( fcontext->urls().first() ) && !isInBlacklist( fcontext->urls().first().path() ) ) @@ -242,7 +242,7 @@ void CustomProjectPart::contextMenu( TQPopupMenu *popup, const Context *context m_contextDirName = m_contextDirName.mid( project()->projectDirectory().length() + 1 ); int id = popup->insertItem( i18n( "Make Active Directory" ), this, TQT_SLOT( slotChooseActiveDirectory() ) ); - popup->setWhatsThis( id, i18n( "<b>Make active directory</b><p>" + popup->tqsetWhatsThis( id, i18n( "<b>Make active directory</b><p>" "Chooses this directory as the destination for new files created using wizards " "like the <i>New Class</i> wizard." ) ); } @@ -258,7 +258,7 @@ void CustomProjectPart::contextMenu( TQPopupMenu *popup, const Context *context { id = popup->insertItem( i18n( "Remove from blacklist" ), this, TQT_SLOT( slotChangeBlacklist() ) ); - popup->setWhatsThis( id, i18n( "<b>Remove from blacklist</b><p>" + popup->tqsetWhatsThis( id, i18n( "<b>Remove from blacklist</b><p>" "Removes the given file or directory from the " "blacklist if it is already in it.<br>The blacklist contains files and" " directories that should be ignored even if they match a project filetype " @@ -268,7 +268,7 @@ void CustomProjectPart::contextMenu( TQPopupMenu *popup, const Context *context { id = popup->insertItem( i18n( "Add to blacklist" ), this, TQT_SLOT( slotChangeBlacklist() ) ); - popup->setWhatsThis( id, i18n( "<b>Add to blacklist</b><p>" + popup->tqsetWhatsThis( id, i18n( "<b>Add to blacklist</b><p>" "Adds the given file or directory to the blacklist.<br>The blacklist contains files and" " directories that should be ignored even if they match a project filetype " "pattern" ) ); @@ -318,13 +318,13 @@ void CustomProjectPart::contextMenu( TQPopupMenu *popup, const Context *context { int id = popup->insertItem( i18n( "Add Selected File/Dir(s) to Project" ), this, TQT_SLOT( slotAddToProject() ) ); - popup->setWhatsThis( id, i18n( "<b>Add to project</b><p>Adds selected file/dir(s) to the list of files in the project. " + popup->tqsetWhatsThis( id, i18n( "<b>Add to project</b><p>Adds selected file/dir(s) to the list of files in the project. " "Note that the files should be manually added to the corresponding makefile or build.xml." ) ); if ( dirAddRecursive ) { int id = popup->insertItem( i18n( "Add Selected Dir(s) to Project (recursive)" ), this, TQT_SLOT( slotAddToProjectRecursive() ) ); - popup->setWhatsThis( id, i18n( "<b>Add to project</b><p>Recursively adds selected dir(s) to the list of files in the project. " + popup->tqsetWhatsThis( id, i18n( "<b>Add to project</b><p>Recursively adds selected dir(s) to the list of files in the project. " "Note that the files should be manually added to the corresponding makefile or build.xml." ) ); } } @@ -333,14 +333,14 @@ void CustomProjectPart::contextMenu( TQPopupMenu *popup, const Context *context { int id = popup->insertItem( i18n( "Remove Selected File/Dir(s) From Project" ), this, TQT_SLOT( slotRemoveFromProject() ) ); - popup->setWhatsThis( id, i18n( "<b>Remove from project</b><p>Removes selected file/dir(s) from the list of files in the project. " + popup->tqsetWhatsThis( id, i18n( "<b>Remove from project</b><p>Removes selected file/dir(s) from the list of files in the project. " "Note that the files should be manually excluded from the corresponding makefile or build.xml." ) ); if ( dirDelRecursive ) { int id = popup->insertItem( i18n( "Remove Selected Dir(s) From Project (recursive)" ), this, TQT_SLOT( slotRemoveFromProjectRecursive() ) ); - popup->setWhatsThis( id, i18n( "<b>Remove from project</b><p>Recursively removes selected dir(s) from the list of files in the project. " + popup->tqsetWhatsThis( id, i18n( "<b>Remove from project</b><p>Recursively removes selected dir(s) from the list of files in the project. " "Note that the files should be manually excluded from the corresponding makefile or build.xml." ) ); } } @@ -460,7 +460,7 @@ void CustomProjectPart::openProject( const TQString &dirName, const TQString &pr int r = KMessageBox::questionYesNo( mainWindow()->main(), i18n( "This project does not contain any files yet.\n" "Populate it with all C/C++/Java files below " - "the project directory?" ), TQString::null, i18n( "Populate" ), i18n( "Do Not Populate" ) ); + "the project directory?" ), TQString(), i18n( "Populate" ), i18n( "Do Not Populate" ) ); if ( r == KMessageBox::Yes ) populateProject(); } @@ -512,7 +512,7 @@ void CustomProjectPart::findNewFiles( const TQString& dir, TQStringList& filelis // If the entry is blacklisted, proceed to next one. // Note that by using generic isInBlacklist(), // we are actually wasting resources, - // because it also tests whether any parent directory of relativeEntry is blacklisted. + // because it also tests whether any tqparent directory of relativeEntry is blacklisted. // But by the order we are traversing and processing the directories, // we know it is not the case, ever. if ( isInBlacklist( relativeEntry ) ) @@ -568,7 +568,7 @@ void CustomProjectPart::populateProject() setFiletypes( lb->items() ); } - TQApplication::setOverrideCursor( Qt::waitCursor ); + TQApplication::setOverrideCursor( TQt::waitCursor ); removeFiles( allFiles() ); updateBlacklist( TQStringList() ); @@ -910,7 +910,7 @@ void CustomProjectPart::startMakeCommand( const TQString &dir, const TQString &t cmdline = DomUtil::readEntry( dom, "/kdevcustomproject/other/otherbin" ); if ( cmdline.isEmpty() ) cmdline = "echo"; - else if ( cmdline.find( "/" ) == -1 ) + else if ( cmdline.tqfind( "/" ) == -1 ) cmdline = "./" + cmdline; cmdline += " " + DomUtil::readEntry( dom, "/kdevcustomproject/other/otheroptions" ); } @@ -944,7 +944,7 @@ void CustomProjectPart::startMakeCommand( const TQString &dir, const TQString &t TQString nice; if ( prio != 0 ) { - nice = TQString( "nice -n%1 " ).arg( prio ); + nice = TQString( "nice -n%1 " ).tqarg( prio ); } cmdline.prepend( nice ); @@ -1013,12 +1013,12 @@ void CustomProjectPart::slotCompileFile() void CustomProjectPart::slotInstallActiveDir() { - startMakeCommand( buildDirectory() + "/" + activeDirectory(), TQString::fromLatin1( "install" ) ); + startMakeCommand( buildDirectory() + "/" + activeDirectory(), TQString::tqfromLatin1( "install" ) ); } void CustomProjectPart::slotInstall() { - startMakeCommand( buildDirectory(), TQString::fromLatin1( "install" ) ); + startMakeCommand( buildDirectory(), TQString::tqfromLatin1( "install" ) ); } @@ -1029,12 +1029,12 @@ void CustomProjectPart::slotInstallWithKdesu() slotBuild(); // After that issue "make install" with the root user - startMakeCommand( buildDirectory(), TQString::fromLatin1( "install" ), true ); + startMakeCommand( buildDirectory(), TQString::tqfromLatin1( "install" ), true ); } void CustomProjectPart::slotClean() { - startMakeCommand( buildDirectory(), TQString::fromLatin1( "clean" ) ); + startMakeCommand( buildDirectory(), TQString::tqfromLatin1( "clean" ) ); } @@ -1056,7 +1056,7 @@ void CustomProjectPart::slotExecute() // Use kdesu?? if ( DomUtil::readBoolEntry( *projectDom(), "/kdevcustomproject/run/autokdesu", false ) ) //slotInstallWithKdesu assumes that it hasn't just been build... - _auto ? slotInstallWithKdesu() : startMakeCommand( buildDirectory(), TQString::fromLatin1( "install" ), true ); + _auto ? slotInstallWithKdesu() : startMakeCommand( buildDirectory(), TQString::tqfromLatin1( "install" ), true ); else slotInstall(); _auto = true; @@ -1186,7 +1186,7 @@ void CustomProjectPart::putEnvVarsInVarMap() void CustomProjectPart::parseMakefile( const TQString& filename ) { - if ( m_parsedMakefiles.contains( filename ) ) + if ( m_parsedMakefiles.tqcontains( filename ) ) return; m_parsedMakefiles.insert( filename, 1 ); @@ -1218,9 +1218,9 @@ void CustomProjectPart::parseMakefile( const TQString& filename ) while (( offset = variablesRe.search( str, offset + 1 ) ) != -1 ) { TQString variableName = variablesRe.cap( 1 ).simplifyWhiteSpace(); - if ( m_makefileVars.contains( variableName ) ) + if ( m_makefileVars.tqcontains( variableName ) ) { - str.replace( variablesRe.cap( 0 ), m_makefileVars[variableName] ); + str.tqreplace( variablesRe.cap( 0 ), m_makefileVars[variableName] ); } } @@ -1245,17 +1245,17 @@ void CustomProjectPart::parseMakefile( const TQString& filename ) TQString tmpTarget = targetRe.cap( 1 ).simplifyWhiteSpace(); if ( tmpTarget.endsWith( ".o" ) ) { - if ( m_targetsObjectFiles.find( tmpTarget ) == m_targetsObjectFiles.end() ) + if ( m_targetsObjectFiles.tqfind( tmpTarget ) == m_targetsObjectFiles.end() ) m_targetsObjectFiles += tmpTarget; } - else if ( tmpTarget.contains( '.' ) ) + else if ( tmpTarget.tqcontains( '.' ) ) { - if ( m_targetsOtherFiles.find( tmpTarget ) == m_targetsOtherFiles.end() ) + if ( m_targetsOtherFiles.tqfind( tmpTarget ) == m_targetsOtherFiles.end() ) m_targetsOtherFiles += tmpTarget; } else { - if ( m_targets.find( tmpTarget ) == m_targets.end() ) + if ( m_targets.tqfind( tmpTarget ) == m_targets.end() ) m_targets += tmpTarget; } } @@ -1289,7 +1289,7 @@ void CustomProjectPart::updateMakeEnvironmentsMenu() { TQStringList l = allMakeEnvironments(); m_makeEnvironmentsSelector->setItems( l ); - m_makeEnvironmentsSelector->setCurrentItem( l.findIndex( currentMakeEnvironment() ) ); + m_makeEnvironmentsSelector->setCurrentItem( l.tqfindIndex( currentMakeEnvironment() ) ); } else { @@ -1322,7 +1322,7 @@ void CustomProjectPart::slotCommandFinished( const TQString& command ) if ( m_buildCommand != command ) return; - m_buildCommand = TQString::null; + m_buildCommand = TQString(); m_timestamp.clear(); TQStringList fileList = allFiles(); @@ -1361,7 +1361,7 @@ bool CustomProjectPart::isDirty() TQString fileName = *it; ++it; - TQMap<TQString, TQDateTime>::Iterator it = m_timestamp.find( fileName ); + TQMap<TQString, TQDateTime>::Iterator it = m_timestamp.tqfind( fileName ); TQDateTime t = TQFileInfo( projectDirectory(), fileName ).lastModified(); if ( it == m_timestamp.end() || *it != t ) { @@ -1401,7 +1401,7 @@ TQString CustomProjectPart::currentMakeEnvironment() const TQStringList allEnvs = allMakeEnvironments(); TQDomDocument &dom = *projectDom(); TQString environment = DomUtil::readEntry( dom, "/kdevcustomproject/make/selectedenvironment" ); - if ( environment.isEmpty() || !allEnvs.contains( environment ) ) + if ( environment.isEmpty() || !allEnvs.tqcontains( environment ) ) environment = allEnvs[0]; return environment; } @@ -1510,11 +1510,11 @@ bool CustomProjectPart::isProjectFileType( const TQString& filename ) const re.setPattern( *it ); int pos = re.search( filename ); uint len = re.matchedLength(); - if ((( *it ).find( "*" ) != -1 || ( *it ).find( "?" ) != -1 ) && pos + len == filename.length() ) + if ((( *it ).tqfind( "*" ) != -1 || ( *it ).tqfind( "?" ) != -1 ) && pos + len == filename.length() ) return true; - else if ( filename.find( "/" ) != -1 && filename.find( *it ) != -1 ) + else if ( filename.tqfind( "/" ) != -1 && filename.tqfind( *it ) != -1 ) return true; - else if ( filename.find( "/" ) == -1 && filename == *it ) + else if ( filename.tqfind( "/" ) == -1 && filename == *it ) return true; } return false; @@ -1555,16 +1555,16 @@ bool CustomProjectPart::isInBlacklist( const TQString& path ) const TQStringList blacklist = this->blacklist(); if ( !TQFileInfo( relpath ).isRelative() ) relpath = relativeToProject( path ); - if ( blacklist.find( relpath ) != blacklist.end() ) + if ( blacklist.tqfind( relpath ) != blacklist.end() ) return true; TQStringList paths = TQStringList::split( "/", relpath ); - TQString parentpath; + TQString tqparentpath; for ( TQStringList::const_iterator it = paths.begin(); it != paths.end(); ++it ) { - parentpath += *it; - if ( blacklist.find( parentpath ) != blacklist.end() ) + tqparentpath += *it; + if ( blacklist.tqfind( tqparentpath ) != blacklist.end() ) return true; - parentpath = parentpath + "/"; + tqparentpath = tqparentpath + "/"; } return false; } @@ -1607,7 +1607,7 @@ void CustomProjectPart::addNewFilesToProject( const TQStringList& filelist ) { for ( ProjectFilesSet::ConstIterator it2 = m_sourceFilesSet.constBegin(); it2 != m_sourceFilesSet.constEnd(); ++it2 ) { - if ( it2.key().find( *it ) != -1 ) + if ( it2.key().tqfind( *it ) != -1 ) { removeFromExcludes << *it; } @@ -1637,7 +1637,7 @@ void CustomProjectPart::setFiletypes( const TQStringList& l ) */ bool CustomProjectPart::isInProject( const TQString& fileName ) const { - return m_sourceFilesSet.contains( fileName ); + return m_sourceFilesSet.tqcontains( fileName ); } |