diff options
Diffstat (limited to 'buildtools/autotools/autosubprojectview.cpp')
-rw-r--r-- | buildtools/autotools/autosubprojectview.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/buildtools/autotools/autosubprojectview.cpp b/buildtools/autotools/autosubprojectview.cpp index 9e1f9735..e1d15d90 100644 --- a/buildtools/autotools/autosubprojectview.cpp +++ b/buildtools/autotools/autosubprojectview.cpp @@ -13,7 +13,7 @@ *************************************************************************** */ -/** Qt */ +/** TQt */ #include <tqregexp.h> #include <tqcheckbox.h> #include <tqstringlist.h> @@ -60,7 +60,7 @@ namespace AutoProjectPrivate bool isHeader( const TQString& fileName ) { - return TQStringList::split( ";", "h;H;hh;hxx;hpp;tcc;h++" ).contains( TQFileInfo(fileName).extension(false) ); + return TQStringList::split( ";", "h;H;hh;hxx;hpp;tcc;h++" ).tqcontains( TQFileInfo(fileName).extension(false) ); } static TQString cleanWhitespace( const TQString &str ) @@ -81,11 +81,11 @@ static TQString cleanWhitespace( const TQString &str ) static void removeDir( const TQString& dirName ) { TQDir d( dirName ); - const QFileInfoList* fileList = d.entryInfoList(); + const TQFileInfoList* fileList = d.entryInfoList(); if( !fileList ) return; - QFileInfoListIterator it( *fileList ); + TQFileInfoListIterator it( *fileList ); while( it.current() ){ const TQFileInfo* fileInfo = it.current(); ++it; @@ -107,8 +107,8 @@ static void removeDir( const TQString& dirName ) } -AutoSubprojectView::AutoSubprojectView(AutoProjectWidget* widget, AutoProjectPart* part, TQWidget *parent, const char *name) -: AutoProjectViewBase(parent, name) +AutoSubprojectView::AutoSubprojectView(AutoProjectWidget* widget, AutoProjectPart* part, TQWidget *tqparent, const char *name) +: AutoProjectViewBase(tqparent, name) { m_widget = widget; @@ -116,7 +116,7 @@ AutoSubprojectView::AutoSubprojectView(AutoProjectWidget* widget, AutoProjectPar m_listView->setSorting(-1); m_listView->header()->hide(); - m_listView->addColumn( TQString::null ); + m_listView->addColumn( TQString() ); connect( m_listView, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ), this, TQT_SLOT( slotSelectionChanged( TQListViewItem* ) ) ); @@ -173,7 +173,7 @@ void AutoSubprojectView::initActions() KActionCollection * actions = new KActionCollection( this ); subProjectOptionsAction = new AutoToolsAction( i18n( "Options..." ), "configure", 0, - this, TQT_SLOT( slotSubprojectOptions() ), actions, "subproject options" ); + TQT_TQOBJECT(this), TQT_SLOT( slotSubprojectOptions() ), actions, "subproject options" ); subProjectOptionsAction->setWhatsThis(i18n("<qt><b>Options</b><p>Shows subproject options dialog " "that provides settings for compiler, include paths, " "prefixes and build order.</qt>")); @@ -181,24 +181,24 @@ void AutoSubprojectView::initActions() TQToolTip::add( m_button1, tr2i18n( "Add new subproject...")); addSubprojectAction = new AutoToolsAction( i18n( "Add new subproject..." ), "folder_new", 0, - this, TQT_SLOT( slotAddSubproject() ), actions, "add subproject" ); + TQT_TQOBJECT(this), TQT_SLOT( slotAddSubproject() ), actions, "add subproject" ); addSubprojectAction->setWhatsThis(i18n("<qt><b>Add new subproject</b><p>Creates a new " "subproject in currently selected subproject.</qt>")); addSubprojectAction->plug( m_button1 ); removeSubprojectAction = new KAction( i18n( "Remove Subproject..." ), "remove_subdir", 0, - this, TQT_SLOT( slotRemoveSubproject() ), actions, "remove subproject" ); + TQT_TQOBJECT(this), TQT_SLOT( slotRemoveSubproject() ), actions, "remove subproject" ); removeSubprojectAction->setWhatsThis(i18n("<qt><b>Remove subproject</b><p>Removes the subproject. Asks if the " "subproject should be also removed from disk. Only subprojects " "which do not hold other subprojects can be removed.</qt>")); addExistingSubprojectAction = new KAction( i18n( "Add Existing Subprojects..." ), "fileimport", 0, - this, TQT_SLOT( slotAddExistingSubproject() ), actions, "add existing subproject" ); + TQT_TQOBJECT(this), TQT_SLOT( slotAddExistingSubproject() ), actions, "add existing subproject" ); addExistingSubprojectAction->setWhatsThis(i18n("<qt><b>Add existing subprojects</b><p>Imports existing " "subprojects containing Makefile.am.</qt>")); TQToolTip::add( m_button2, tr2i18n( "Add Target...")); addTargetAction = new AutoToolsAction( i18n( "Add Target..." ), "targetnew_kdevelop", 0, - this, TQT_SLOT( slotAddTarget() ), actions, "add target" ); + TQT_TQOBJECT(this), TQT_SLOT( slotAddTarget() ), actions, "add target" ); addTargetAction->setWhatsThis(i18n( "<qt><b>Add target</b><p>Adds a new target to " "the currently selected subproject. Target can be a " "binary program, library, script, also a collection of " @@ -206,19 +206,19 @@ void AutoSubprojectView::initActions() addTargetAction->plug( m_button2 ); TQToolTip::add( m_button3, tr2i18n( "Add Service...")); - addServiceAction = new AutoToolsAction( i18n( "Add Service..." ), "servicenew_kdevelop", 0, this, + addServiceAction = new AutoToolsAction( i18n( "Add Service..." ), "servicenew_kdevelop", 0, TQT_TQOBJECT(this), TQT_SLOT( slotAddService() ), actions, "add service" ); addServiceAction->setWhatsThis(i18n("<qt><b>Add service</b><p>Creates a .desktop file describing the service.</qt>")); addServiceAction->plug( m_button3 ); TQToolTip::add( m_button4, tr2i18n( "Add Application...")); - addApplicationAction = new AutoToolsAction( i18n( "Add Application..." ), "window_new", 0, this, + addApplicationAction = new AutoToolsAction( i18n( "Add Application..." ), "window_new", 0, TQT_TQOBJECT(this), TQT_SLOT( slotAddApplication() ), actions, "add application" ); addApplicationAction->setWhatsThis(i18n("<qt><b>Add application</b><p>Creates an application .desktop file.</qt>")); addApplicationAction->plug( m_button4 ); TQToolTip::add( m_button5, tr2i18n( "Build")); - buildSubprojectAction = new AutoToolsAction( i18n( "Build" ), "launch", 0, this, + buildSubprojectAction = new AutoToolsAction( i18n( "Build" ), "launch", 0, TQT_TQOBJECT(this), TQT_SLOT( slotBuildSubproject() ), actions, "build subproject" ); buildSubprojectAction->setWhatsThis(i18n("<qt><b>Build</b><p>Runs <b>make</b> from the directory of " "the selected subproject.<br> Environment variables and " @@ -226,11 +226,11 @@ void AutoSubprojectView::initActions() "dialog, <b>Make Options</b> tab.</qt>")); buildSubprojectAction->plug( m_button5 ); - forceReeditSubprojectAction = new KAction( i18n( "Force Reedit" ), 0, 0, this, + forceReeditSubprojectAction = new KAction( i18n( "Force Reedit" ), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( slotForceReeditSubproject() ), actions, "force-reedit subproject" ); forceReeditSubprojectAction->setWhatsThis(i18n("<qt><b>Force Reedit</b><p>Runs <b>make force-reedit</b> " "from the directory of the selected subproject.<br>This " - "recreates makefile (tip: and solves most of .moc related " + "recreates makefile (tip: and solves most of .tqmoc related " "problems)<br>Environment variables and make arguments can " "be specified in the project settings dialog, " "<b>Make Options</b> tab.</qt>")); @@ -238,21 +238,21 @@ void AutoSubprojectView::initActions() if (!m_part->isKDE()) forceReeditSubprojectAction->setEnabled(false); - cleanSubprojectAction = new KAction( i18n( "Clean" ), 0, 0, this, + cleanSubprojectAction = new KAction( i18n( "Clean" ), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( slotCleanSubproject() ), actions, "clean subproject" ); cleanSubprojectAction->setWhatsThis(i18n("<qt><b>Clean</b><p>Runs <b>make clean</b> from the directory of " "the selected subproject.<br> Environment variables and make " "arguments can be specified in the project settings dialog, " "<b>Make Options</b> tab.</qt>")); - installSubprojectAction = new KAction( i18n( "Install" ), 0, 0, this, + installSubprojectAction = new KAction( i18n( "Install" ), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( slotInstallSubproject() ), actions, "install subproject" ); installSubprojectAction->setWhatsThis(i18n("<qt><b>Install</b><p>Runs <b>make install</b> from the directory " "of the selected subproject.<br> Environment variables and " "make arguments can be specified in the project settings " "dialog, <b>Make Options</b> tab.</qt>")); installSuSubprojectAction = new KAction( i18n( "Install (as root user)" ), 0, 0, - this, TQT_SLOT( slotInstallSuSubproject() ), actions, "install subproject as root" ); + TQT_TQOBJECT(this), TQT_SLOT( slotInstallSuSubproject() ), actions, "install subproject as root" ); installSuSubprojectAction->setWhatsThis(i18n("<qt><b>Install as root user</b><p>Runs <b>make install</b> " "command from the directory of the selected subproject " "with root privileges.<br> It is executed via kdesu " @@ -260,12 +260,12 @@ void AutoSubprojectView::initActions() "can be specified in the project settings dialog, " "<b>Make Options</b> tab.</qt>")); - expandAction = new KAction( i18n( "Expand Subtree" ), 0, 0, this, + expandAction = new KAction( i18n( "Expand Subtree" ), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotExpandTree()), actions, "expandAction" ); - collapseAction = new KAction( i18n( "Collapse Subtree" ), 0, 0, this, + collapseAction = new KAction( i18n( "Collapse Subtree" ), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotCollapseTree()), actions, "collapseAction" ); - otherAction = new KAction( i18n( "Manage Custom Commands..." ), 0, 0, this, + otherAction = new KAction( i18n( "Manage Custom Commands..." ), 0, 0, TQT_TQOBJECT(this), TQT_SLOT( slotManageBuildCommands() ), actions, "manage custom commands" ); otherAction->setWhatsThis(i18n("<qt><b>Manage custom commands</b><p>Allows to create, edit and " "delete custom build commands which appears in the subproject " @@ -280,7 +280,7 @@ void AutoSubprojectView::slotContextMenu( KListView *, TQListViewItem *item, con if ( !item ) return ; - KPopupMenu popup( i18n( "Subproject: %1" ).arg( item->text( 0 ) ), this ); + KPopupMenu popup( i18n( "Subproject: %1" ).tqarg( item->text( 0 ) ), this ); subProjectOptionsAction->plug( &popup ); popup.insertSeparator(); @@ -317,7 +317,7 @@ void AutoSubprojectView::slotContextMenu( KListView *, TQListViewItem *item, con } int id = popup.insertItem(it.key(), this, TQT_SLOT(slotCustomBuildCommand(int))); m_commandList.append(it.data()); - popup.setItemParameter(id, m_commandList.findIndex(it.data())); + popup.setItemParameter(id, m_commandList.tqfindIndex(it.data())); } popup.insertSeparator(); @@ -422,7 +422,7 @@ void AutoSubprojectView::slotBuildSubproject() TQString relpath = "/" + URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + spitem->path.mid( m_part->projectDirectory().length() ); - m_part->startMakeCommand( m_part->buildDirectory() + relpath, TQString::fromLatin1( "" ) ); + m_part->startMakeCommand( m_part->buildDirectory() + relpath, TQString::tqfromLatin1( "" ) ); } void AutoSubprojectView::slotRemoveSubproject() @@ -433,28 +433,28 @@ void AutoSubprojectView::slotRemoveSubproject() if( !spitem ) return; - SubprojectItem* parent = static_cast<SubprojectItem*>( spitem->parent() ); - if( !parent || !parent->listView() || spitem->childCount() != 0 ){ + SubprojectItem* tqparent = static_cast<SubprojectItem*>( spitem->tqparent() ); + if( !tqparent || !tqparent->listView() || spitem->childCount() != 0 ){ KMessageBox::error( 0, i18n("This item cannot be removed"), i18n("Automake Manager") ); return; } - TQStringList list = TQStringList::split( TQRegExp("[ \t]"), parent->variables["SUBDIRS"] ); - TQStringList::Iterator it = list.find( spitem->subdir ); + TQStringList list = TQStringList::split( TQRegExp("[ \t]"), tqparent->variables["SUBDIRS"] ); + TQStringList::Iterator it = list.tqfind( spitem->subdir ); TQString subdirToRemove = spitem->subdir; bool topsubdirs = true; - if ((parent->variables["SUBDIRS"].find("$(TOPSUBDIRS)") == -1) - && (parent->variables["SUBDIRS"].find("$(AUTODIRS)") == -1)) + if ((tqparent->variables["SUBDIRS"].tqfind("$(TOPSUBDIRS)") == -1) + && (tqparent->variables["SUBDIRS"].tqfind("$(AUTODIRS)") == -1)) { topsubdirs = false; if( it == list.end() ){ - KMessageBox::sorry(this, i18n("There is no subproject %1 in SUBDIRS").arg(spitem->subdir)); + KMessageBox::sorry(this, i18n("There is no subproject %1 in SUBDIRS").tqarg(spitem->subdir)); return; } } - RemoveSubprojectDialog dlg(i18n("Remove Subproject %1").arg(spitem->text(0)), - i18n("Do you really want to remove subproject %1 with all targets and files?").arg(spitem->text(0))); + RemoveSubprojectDialog dlg(i18n("Remove Subproject %1").tqarg(spitem->text(0)), + i18n("Do you really want to remove subproject %1 with all targets and files?").tqarg(spitem->text(0))); if( dlg.exec() ){ bool removeSources = dlg.removeFromDisk(); @@ -462,11 +462,11 @@ void AutoSubprojectView::slotRemoveSubproject() if (!topsubdirs) { list.remove( it ); - parent->variables[ "SUBDIRS" ] = list.join( " " ); + tqparent->variables[ "SUBDIRS" ] = list.join( " " ); } - parent->listView()->setSelected( parent, true ); - kapp->processEvents( 500 ); + tqparent->listView()->setSelected( tqparent, true ); + kapp->tqprocessEvents( 500 ); if( removeSources ){ @@ -483,7 +483,7 @@ void AutoSubprojectView::slotRemoveSubproject() TQString projroot = m_part->projectDirectory() + "/"; TQString subdirectory = spitem->path; - TQString relpath = subdirectory.replace(0, projroot.length(),""); + TQString relpath = subdirectory.tqreplace(0, projroot.length(),""); TQString configureFile = m_part->getAutoConfFile(projroot); @@ -511,9 +511,9 @@ void AutoSubprojectView::slotRemoveSubproject() // Adjust SUBDIRS variable in containing Makefile.am - if (parent->variables["SUBDIRS"].find("$(TOPSUBDIRS)") != -1) + if (tqparent->variables["SUBDIRS"].tqfind("$(TOPSUBDIRS)") != -1) { - TQFile subdirsfile( parent->path + "/subdirs" ); + TQFile subdirsfile( tqparent->path + "/subdirs" ); TQStringList topdirs; if ( subdirsfile.open( IO_ReadOnly ) ) { @@ -534,9 +534,9 @@ void AutoSubprojectView::slotRemoveSubproject() TQMap<TQString,TQString> replaceMap; replaceMap.insert( "SUBDIRS", subdirToRemove ); - AutoProjectTool::removeFromMakefileam( parent->path + "/Makefile.am", replaceMap ); + AutoProjectTool::removeFromMakefileam( tqparent->path + "/Makefile.am", replaceMap ); - TQString relmakefile = ( parent->path + "/Makefile" ).mid( m_part->projectDirectory().length()+1 ); + TQString relmakefile = ( tqparent->path + "/Makefile" ).mid( m_part->projectDirectory().length()+1 ); kdDebug(9020) << "Relative makefile path: " << relmakefile << endl; // check for config.status @@ -563,7 +563,7 @@ void AutoSubprojectView::parsePrimary( SubprojectItem *item, { // Parse line foo_bar = bla bla - int pos = lhs.findRev( '_' ); + int pos = lhs.tqfindRev( '_' ); TQString prefix = lhs.left( pos ); TQString primary = lhs.right( lhs.length() - pos - 1 ); // kdDebug(9020) << "Prefix:" << prefix << ",Primary:" << primary << endl; @@ -707,7 +707,7 @@ void AutoSubprojectView::parseKDEICON( SubprojectItem *item, { // Parse a line foo_ICON = bla bla - int pos = lhs.find( "_ICON" ); + int pos = lhs.tqfind( "_ICON" ); TQString prefix = lhs.left( pos ); if ( prefix == "KDE" ) prefix = "kde_icon"; @@ -766,7 +766,7 @@ void AutoSubprojectView::parseSUBDIRS( SubprojectItem *item, // Take care of KDE hacks: // TOPSUBDIRS is an alias for all directories // listed in the subdirs file - if ( subdirs.find( "$(TOPSUBDIRS)" ) != -1 ) + if ( subdirs.tqfind( "$(TOPSUBDIRS)" ) != -1 ) { TQStringList dirs; TQFile subdirsfile( item->path + "/subdirs" ); @@ -795,18 +795,18 @@ void AutoSubprojectView::parseSUBDIRS( SubprojectItem *item, } } - subdirs.replace( TQRegExp( "\\$\\(TOPSUBDIRS\\)" ), dirs.join( " " ) ); + subdirs.tqreplace( TQRegExp( "\\$\\(TOPSUBDIRS\\)" ), dirs.join( " " ) ); } // AUTODIRS is an alias for all subdirectories - if ( subdirs.find( "$(AUTODIRS)" ) != -1 ) + if ( subdirs.tqfind( "$(AUTODIRS)" ) != -1 ) { TQDir d( item->path ); TQStringList dirs = d.entryList( TQDir::Dirs ); dirs.remove( "." ); dirs.remove( ".." ); dirs.remove( "CVS" ); - subdirs.replace( TQRegExp( "\\$\\(AUTODIRS\\)" ), dirs.join( " " ) ); + subdirs.tqreplace( TQRegExp( "\\$\\(AUTODIRS\\)" ), dirs.join( " " ) ); } // If there are any variables in the subdirs line then search @@ -822,7 +822,7 @@ void AutoSubprojectView::parseSUBDIRS( SubprojectItem *item, // Search the whole Makefile(.am?) // Note that if the variable isn't found it just disappears // (Perhaps we should add it back in this case?) - TQMap<TQString, TQString>::ConstIterator varit = item->variables.find( varname ); + TQMap<TQString, TQString>::ConstIterator varit = item->variables.tqfind( varname ); if ( varit != item->variables.end() ) { kdDebug( 9020 ) << "Found Makefile var " << varname << ", adding dirs <" << varit.data() << ">" << endl; @@ -832,7 +832,7 @@ void AutoSubprojectView::parseSUBDIRS( SubprojectItem *item, { kdDebug( 9020 ) << "Not found Makefile var " << varname << endl; } - subdirs.replace( TQRegExp( "\\$\\(\\s*" + varname + "\\s*\\)" ), varvalue ); + subdirs.tqreplace( TQRegExp( "\\$\\(\\s*" + varname + "\\s*\\)" ), varvalue ); } //search for AC_SUBST variables and try to replace them with variables @@ -847,7 +847,7 @@ void AutoSubprojectView::parseSUBDIRS( SubprojectItem *item, // Search the whole Makefile(.am?) // Note that if the variable isn't found it just disappears // (Perhaps we should add it back in this case?) - TQMap<TQString, TQString>::ConstIterator varit = item->variables.find( varname ); + TQMap<TQString, TQString>::ConstIterator varit = item->variables.tqfind( varname ); if ( varit != item->variables.end() ) { kdDebug( 9020 ) << "Found Makefile var " << varname << ", adding dirs <" << varit.data() << ">" << endl; @@ -857,7 +857,7 @@ void AutoSubprojectView::parseSUBDIRS( SubprojectItem *item, { kdDebug( 9020 ) << "Not found Makefile var " << varname << endl; } - subdirs.replace( TQRegExp( "\\@" + varname + "\\@" ), varvalue ); + subdirs.tqreplace( TQRegExp( "\\@" + varname + "\\@" ), varvalue ); } TQStringList l = TQStringList::split( TQRegExp( "[ \t]" ), subdirs ); @@ -879,14 +879,14 @@ void AutoSubprojectView::parseSUBDIRS( SubprojectItem *item, open = false; if ( newitem->subdir == "pics" ) open = false; - if ( newitem && static_cast<SubprojectItem*>( newitem->parent() ) + if ( newitem && static_cast<SubprojectItem*>( newitem->tqparent() ) ->subdir == "doc" ) open = false; if ( newitem && static_cast<SubprojectItem*> - ( newitem->parent() ) ->subdir == "po" ) + ( newitem->tqparent() ) ->subdir == "po" ) open = false; if ( newitem && static_cast<SubprojectItem*> - ( newitem->parent() ) ->subdir == "pics" ) + ( newitem->tqparent() ) ->subdir == "pics" ) open = false; newitem->setOpen( open ); @@ -914,7 +914,7 @@ void AutoSubprojectView::parse( SubprojectItem *item ) parseKDEDOCS( item, lhs, rhs ); else if ( lhs.right( 5 ) == "_ICON" ) parseKDEICON( item, lhs, rhs ); - else if ( lhs.find( '_' ) > 0 ) + else if ( lhs.tqfind( '_' ) > 0 ) parsePrimary( item, lhs, rhs ); else if ( lhs.right( 3 ) == "dir" ) parsePrefix( item, lhs, rhs ); @@ -937,7 +937,7 @@ void AutoSubprojectView::parse( SubprojectItem *item ) TQString fname = *fileIt; ++fileIt; - if( AutoProjectPrivate::isHeader(fname) && !headers.contains(fname) ){ + if( AutoProjectPrivate::isHeader(fname) && !headers.tqcontains(fname) ){ FileItem *fitem = m_widget->createFileItem( fname, item ); noinst_HEADERS_item->sources.append( fitem ); } @@ -1045,7 +1045,7 @@ void AutoSubprojectView::slotManageBuildCommands( ) { config->writeEntry(widget->commandsTable->text(i, 0), widget->commandsTable->text(i, 1)+":::"+ - TQString("%1").arg(static_cast<TQComboTableItem*>(widget-> + TQString("%1").tqarg(static_cast<TQComboTableItem*>(widget-> commandsTable->item(i, 2))->currentItem())); } config->sync(); |