diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /buildtools/autotools/autodetailsview.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'buildtools/autotools/autodetailsview.cpp')
-rw-r--r-- | buildtools/autotools/autodetailsview.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/buildtools/autotools/autodetailsview.cpp b/buildtools/autotools/autodetailsview.cpp index 26255fd3..d3cf3864 100644 --- a/buildtools/autotools/autodetailsview.cpp +++ b/buildtools/autotools/autodetailsview.cpp @@ -16,11 +16,11 @@ #include "autodetailsview.h" /** Qt */ -#include <qregexp.h> -#include <qlistview.h> -#include <qwidget.h> -#include <qheader.h> -#include <qlayout.h> +#include <tqregexp.h> +#include <tqlistview.h> +#include <tqwidget.h> +#include <tqheader.h> +#include <tqlayout.h> /** KDE Libs */ #include <kxmlguiclient.h> @@ -57,21 +57,21 @@ #include "subclassesdlg.h" -AutoDetailsView::AutoDetailsView(AutoProjectWidget* widget, AutoProjectPart* part, QWidget *parent, const char *name) +AutoDetailsView::AutoDetailsView(AutoProjectWidget* widget, AutoProjectPart* part, TQWidget *parent, const char *name) : AutoProjectViewBase(parent, name) { m_widget = widget; m_part = part; initActions(); - QDomDocument dom = *(m_part->projectDom()); + TQDomDocument dom = *(m_part->projectDom()); m_subclasslist = DomUtil::readPairListEntry(dom, "/kdevautoproject/subclassing", "subclass","sourcefile", "uifile"); m_listView->setAllColumnsShowFocus( true ); m_listView->setRootIsDecorated( true ); - m_listView->setResizeMode( QListView::LastColumn ); - m_listView->addColumn( QString::null ); + m_listView->setResizeMode( TQListView::LastColumn ); + m_listView->addColumn( TQString::null ); m_listView->header()->hide(); targetOptionsAction->setEnabled( false ); addNewFileAction->setEnabled( false ); @@ -79,10 +79,10 @@ AutoDetailsView::AutoDetailsView(AutoProjectWidget* widget, AutoProjectPart* par buildTargetAction->setEnabled( false ); executeTargetAction->setEnabled( false ); removeDetailAction->setEnabled(false); - connect( m_listView, SIGNAL( selectionChanged( QListViewItem* ) ), - this, SLOT( slotSelectionChanged( QListViewItem* ) ) ); - connect( m_listView, SIGNAL( selectionChanged() ), - this, SLOT( slotSelectionChanged( ) ) ); + connect( m_listView, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ), + this, TQT_SLOT( slotSelectionChanged( TQListViewItem* ) ) ); + connect( m_listView, TQT_SIGNAL( selectionChanged() ), + this, TQT_SLOT( slotSelectionChanged( ) ) ); } @@ -110,7 +110,7 @@ void AutoDetailsView::slotSelectionChanged( ){ * This is never called if nothing is selected.. * @param item */ -void AutoDetailsView::slotSelectionChanged( QListViewItem* item ) +void AutoDetailsView::slotSelectionChanged( TQListViewItem* item ) { bool isTarget = false; bool isRegularTarget = false; @@ -128,7 +128,7 @@ void AutoDetailsView::slotSelectionChanged( QListViewItem* item ) { titem = static_cast <TargetItem*> ( pvitem->parent() ); - QString primary = titem->primary; + TQString primary = titem->primary; if ( primary == "PROGRAMS" || primary == "LIBRARIES" || primary == "LTLIBRARIES" || primary == "JAVA" ) { @@ -142,7 +142,7 @@ void AutoDetailsView::slotSelectionChanged( QListViewItem* item ) isTarget = true; } - QString primary = titem->primary; + TQString primary = titem->primary; if ( primary == "PROGRAMS" || primary == "LIBRARIES" || primary == "LTLIBRARIES" || primary == "JAVA" ) { @@ -177,7 +177,7 @@ void AutoDetailsView::initActions() KActionCollection * actions = new KActionCollection( this ); targetOptionsAction = new AutoToolsAction( i18n( "Options..." ), "configure", 0, - this, SLOT( slotTargetOptions() ), actions, + this, TQT_SLOT( slotTargetOptions() ), actions, "target options" ); targetOptionsAction->setWhatsThis(i18n("<b>Options</b><p>Target options dialog that " "provides settings for linker flags and lists " @@ -186,18 +186,18 @@ void AutoDetailsView::initActions() targetOptionsAction->plug( m_optionsButton ); targetOptionsAction->setEnabled( false ); - QToolTip::add( m_button1, tr2i18n( "Create New File..." ) ); + TQToolTip::add( m_button1, tr2i18n( "Create New File..." ) ); addNewFileAction = new AutoToolsAction( i18n( "Create New File..." ), "filenew", 0, - this, SLOT( slotAddNewFile() ), actions, + this, TQT_SLOT( slotAddNewFile() ), actions, "add new file" ); addNewFileAction->setWhatsThis(i18n("<b>Create new file</b><p>Creates a new file and " "adds it to a currently selected target.")); addNewFileAction->plug( m_button1 ); addNewFileAction->setEnabled( false ); - QToolTip::add( m_button2, tr2i18n( "Add Existing Files..." ) ); + TQToolTip::add( m_button2, tr2i18n( "Add Existing Files..." ) ); addExistingFileAction = new AutoToolsAction( i18n( "Add Existing Files..." ), "fileimport", 0, - this, SLOT( slotAddExistingFile() ), actions, + this, TQT_SLOT( slotAddExistingFile() ), actions, "add existing file" ); addExistingFileAction->setWhatsThis(i18n("<b>Add existing files</b><p>Adds existing " "file to a currently selected target. Header " @@ -208,12 +208,12 @@ void AutoDetailsView::initActions() addExistingFileAction->setEnabled( false ); addIconAction = new KAction( i18n( "Add Icon..." ), "iconadd_kdevelop", 0, - this, SLOT( slotAddIcon() ), actions, "add icon" ); + this, TQT_SLOT( slotAddIcon() ), actions, "add icon" ); addIconAction->setWhatsThis(i18n("<b>Add icon</b><p>Adds an icon to a KDEICON target.")); - QToolTip::add( m_button4, tr2i18n( "Build Target")); + TQToolTip::add( m_button4, tr2i18n( "Build Target")); buildTargetAction = new AutoToolsAction( i18n( "Build Target..." ), "launch", 0, - this, SLOT( slotBuildTarget() ), actions, + this, TQT_SLOT( slotBuildTarget() ), actions, "build target" ); buildTargetAction->setWhatsThis(i18n("<b>Build target</b><p>Constructs a series of " "make commands to build the selected target. " @@ -221,9 +221,9 @@ void AutoDetailsView::initActions() buildTargetAction->plug( m_button4 ); buildTargetAction->setEnabled( false ); - QToolTip::add( m_button5, tr2i18n( "Execute Target...")); + TQToolTip::add( m_button5, tr2i18n( "Execute Target...")); executeTargetAction = new AutoToolsAction( i18n( "Execute Target..." ), "exec", 0, - this, SLOT( slotExecuteTarget() ), actions, + this, TQT_SLOT( slotExecuteTarget() ), actions, "execute target" ); executeTargetAction->setWhatsThis(i18n("<b>Execute target</b><p>Executes the target " "and tries to build in case it is not built.")); @@ -231,7 +231,7 @@ void AutoDetailsView::initActions() executeTargetAction->setEnabled( false ); setActiveTargetAction = new KAction( i18n( "Make Target Active" ), "", 0, - this, SLOT( slotSetActiveTarget() ), actions, + this, TQT_SLOT( slotSetActiveTarget() ), actions, "set active target" ); setActiveTargetAction->setWhatsThis(i18n("<b>Make target active</b><p>Marks the " "currently selected target as 'active'. New " @@ -240,9 +240,9 @@ void AutoDetailsView::initActions() "Using the <b>Build Active Target</b> menu " "command builds it.")); - QToolTip::add( m_button3, tr2i18n( "Remove")); + TQToolTip::add( m_button3, tr2i18n( "Remove")); removeDetailAction = new AutoToolsAction( i18n( "Remove" ), "editdelete", 0, this, - SLOT( slotRemoveDetail() ), actions, + TQT_SLOT( slotRemoveDetail() ), actions, "remove detail" ); removeDetailAction->setWhatsThis(i18n("<b>Remove</b><p>Shows a list of targets " "dependent on the selected target or file and " @@ -251,25 +251,25 @@ void AutoDetailsView::initActions() removeDetailAction->plug( m_button3 ); removeDetailAction->setEnabled( false ); - connect( m_listView, SIGNAL( executed( QListViewItem* ) ), - this, SLOT( slotDetailsExecuted( QListViewItem* ) ) ); - connect( m_listView, SIGNAL( returnPressed( QListViewItem* ) ), - this, SLOT( slotDetailsExecuted( QListViewItem* ) ) ); - connect( m_listView, SIGNAL( contextMenu( KListView*, QListViewItem*, const QPoint& ) ), - this, SLOT( slotDetailsContextMenu( KListView*, QListViewItem*, const QPoint& ) ) ); + connect( m_listView, TQT_SIGNAL( executed( TQListViewItem* ) ), + this, TQT_SLOT( slotDetailsExecuted( TQListViewItem* ) ) ); + connect( m_listView, TQT_SIGNAL( returnPressed( TQListViewItem* ) ), + this, TQT_SLOT( slotDetailsExecuted( TQListViewItem* ) ) ); + connect( m_listView, TQT_SIGNAL( contextMenu( KListView*, TQListViewItem*, const TQPoint& ) ), + this, TQT_SLOT( slotDetailsContextMenu( KListView*, TQListViewItem*, const TQPoint& ) ) ); } -QString AutoDetailsView::getUiFileLink(const QString& relpath, const QString& filename) +TQString AutoDetailsView::getUiFileLink(const TQString& relpath, const TQString& filename) { DomUtil::PairList::iterator it; for (it=m_subclasslist.begin(); it != m_subclasslist.end(); ++it) { - if ((*it).first == QString("/")+relpath+filename) + if ((*it).first == TQString("/")+relpath+filename) return (*it).second; } - return QString::null; + return TQString::null; } void AutoDetailsView::slotTargetOptions() @@ -298,7 +298,7 @@ void AutoDetailsView::slotAddNewFile() if (createFileSupport) { KDevCreateFile::CreatedFile crFile = - createFileSupport->createNewFile(QString::null, + createFileSupport->createNewFile(TQString::null, m_widget->selectedSubproject()->path); /* if (crFile.status == KDevCreateFile::CreatedFile::STATUS_OK) { @@ -310,7 +310,7 @@ void AutoDetailsView::slotAddNewFile() } else { AddFileDialog dlg( m_part, m_widget, m_widget->selectedSubproject(), titem, this, "add file dialog" ); - QString caption; + TQString caption; if ( titem->name.isEmpty() ) caption = i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix ); else @@ -332,7 +332,7 @@ void AutoDetailsView::slotAddExistingFile() AddExistingFilesDialog dlg( m_part, m_widget, m_widget->selectedSubproject(), titem, this, "add existing files" ); - QString caption; + TQString caption; if ( titem->name.isEmpty() ) caption = i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix ); else @@ -369,7 +369,7 @@ void AutoDetailsView::slotBuildTarget() else titem = static_cast <TargetItem*> ( m_listView->selectedItem() ); - QString relpath = URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + m_widget->selectedSubproject()->relativePath(); + TQString relpath = URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + m_widget->selectedSubproject()->relativePath(); m_part->buildTarget(relpath, titem); } @@ -387,8 +387,8 @@ void AutoDetailsView::slotExecuteTarget() else titem = static_cast <TargetItem*> ( m_listView->selectedItem() ); - QString relpath = URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + m_part->activeDirectory(); - m_part->executeTarget(QDir( DomUtil::readEntry( *m_part->projectDom(), "/kdevautoproject/run/cwd/"+titem->name )), titem); + TQString relpath = URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + m_part->activeDirectory(); + m_part->executeTarget(TQDir( DomUtil::readEntry( *m_part->projectDom(), "/kdevautoproject/run/cwd/"+titem->name )), titem); } void AutoDetailsView::slotRemoveDetail() @@ -404,7 +404,7 @@ void AutoDetailsView::slotRemoveDetail() return; } - QListViewItem* sibling = fitem->nextSibling(); + TQListViewItem* sibling = fitem->nextSibling(); if ( !fitem ) return; @@ -414,7 +414,7 @@ void AutoDetailsView::slotRemoveDetail() RemoveFileDialog dlg( m_widget, m_part, m_widget->selectedSubproject(), titem, fitem->text( 0 ), this, "remove file dialog" ); - QString caption; + TQString caption; if ( titem->name.isEmpty() ) caption = i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix ); else @@ -439,7 +439,7 @@ void AutoDetailsView::slotRemoveDetail() if ( pvitem && ( pvitem->type() == ProjectItem::Target ) ) { TargetItem* titem = static_cast <TargetItem*> ( m_listView->selectedItem() ); - QListViewItem* sibling = titem->nextSibling(); + TQListViewItem* sibling = titem->nextSibling(); if ( !titem ) return; @@ -469,7 +469,7 @@ void AutoDetailsView::slotRemoveDetail() } -void AutoDetailsView::slotDetailsContextMenu( KListView *, QListViewItem *item, const QPoint &p ) +void AutoDetailsView::slotDetailsContextMenu( KListView *, TQListViewItem *item, const TQPoint &p ) { if ( !item ) return; @@ -493,7 +493,7 @@ void AutoDetailsView::slotDetailsContextMenu( KListView *, QListViewItem *item, return; } - QString caption; + TQString caption; if ( titem->name.isEmpty() ) caption = i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix ); else @@ -587,7 +587,7 @@ void AutoDetailsView::slotDetailsContextMenu( KListView *, QListViewItem *item, popup.setWhatsThis(idViewUIH, i18n("<b>Open ui.h file</b><p>Opens .ui.h file " "associated with the selected .ui.")); - if (!fitem->name.contains(QRegExp("ui$")) || fitem->is_subst == true) + if (!fitem->name.contains(TQRegExp("ui$")) || fitem->is_subst == true) { popup.removeItem(idUISubclasses); popup.removeItem(idViewUIH); @@ -605,27 +605,27 @@ void AutoDetailsView::slotDetailsContextMenu( KListView *, QListViewItem *item, if(r == idViewUIH) { m_part->partController()->editDocument(KURL(m_widget->selectedSubproject()->path - + "/" + QString(fitem->name + ".h"))); + + "/" + TQString(fitem->name + ".h"))); } else if (r == idSubclassWidget) { - QStringList newFileNames; + TQStringList newFileNames; newFileNames = m_part->languageSupport()->subclassWidget(m_widget->selectedSubproject()->path + "/" + fitem->name); if (!newFileNames.empty()) { - QDomDocument &dom = *(m_part->projectDom()); + TQDomDocument &dom = *(m_part->projectDom()); for (uint i=0; i<newFileNames.count(); i++) { - QString srcfile_relpath = newFileNames[i]; + TQString srcfile_relpath = newFileNames[i]; srcfile_relpath.remove(0,m_part->projectDirectory().length()); - QString uifile_relpath = QString(m_widget->selectedSubproject()->path + "/" + fitem->name).remove(0,m_part->projectDirectory().length()); + TQString uifile_relpath = TQString(m_widget->selectedSubproject()->path + "/" + fitem->name).remove(0,m_part->projectDirectory().length()); DomUtil::PairList list = DomUtil::readPairListEntry(dom,"/kdevautoproject/subclassing", "subclass","sourcefile", "uifile"); list << DomUtil::Pair(srcfile_relpath,uifile_relpath); DomUtil::writePairListEntry(dom, "/kdevautoproject/subclassing", "subclass", "sourcefile", "uifile", list); - newFileNames[i] = newFileNames[i].replace(QRegExp(m_part->projectDirectory()+"/"),""); + newFileNames[i] = newFileNames[i].replace(TQRegExp(m_part->projectDirectory()+"/"),""); } m_subclasslist = DomUtil::readPairListEntry(dom,"/kdevautoproject/subclassing", "subclass","sourcefile", "uifile"); @@ -634,17 +634,17 @@ void AutoDetailsView::slotDetailsContextMenu( KListView *, QListViewItem *item, } else if (r == idUpdateWidgetclass) { - QString noext = m_widget->selectedSubproject()->path + "/" + fitem->name; + TQString noext = m_widget->selectedSubproject()->path + "/" + fitem->name; if (noext.findRev('.')>-1) noext = noext.left(noext.findRev('.')); - QStringList dummy; - QString uifile = fitem->uiFileLink; + TQStringList dummy; + TQString uifile = fitem->uiFileLink; if (uifile.findRev('/')>-1) { - QStringList uisplit = QStringList::split('/',uifile); + TQStringList uisplit = TQStringList::split('/',uifile); uifile=uisplit[uisplit.count()-1]; } @@ -653,16 +653,16 @@ void AutoDetailsView::slotDetailsContextMenu( KListView *, QListViewItem *item, } else if (r == idUISubclasses) { - QDomDocument &dom = *(m_part->projectDom()); + TQDomDocument &dom = *(m_part->projectDom()); DomUtil::PairList list = DomUtil::readPairListEntry(dom,"/kdevautoproject/subclassing", "subclass","sourcefile", "uifile"); - SubclassesDlg *sbdlg = new SubclassesDlg( QString(m_widget->selectedSubproject()->path + "/" +fitem->name).remove(0,m_part->projectDirectory().length()), + SubclassesDlg *sbdlg = new SubclassesDlg( TQString(m_widget->selectedSubproject()->path + "/" +fitem->name).remove(0,m_part->projectDirectory().length()), list, m_part->projectDirectory()); if (sbdlg->exec()) { - QDomElement el = DomUtil::elementByPath( dom, "/kdevautoproject"); - QDomElement el2 = DomUtil::elementByPath( dom, "/kdevautoproject/subclassing"); + TQDomElement el = DomUtil::elementByPath( dom, "/kdevautoproject"); + TQDomElement el2 = DomUtil::elementByPath( dom, "/kdevautoproject/subclassing"); if ( (!el.isNull()) && (!el2.isNull()) ) { el.removeChild(el2); @@ -679,7 +679,7 @@ void AutoDetailsView::slotDetailsContextMenu( KListView *, QListViewItem *item, } -void AutoDetailsView::slotDetailsExecuted( QListViewItem *item ) +void AutoDetailsView::slotDetailsExecuted( TQListViewItem *item ) { if ( !item ) return ; @@ -691,7 +691,7 @@ void AutoDetailsView::slotDetailsExecuted( QListViewItem *item ) if ( !m_widget->selectedSubproject() ) return; - QString dirName = m_widget->selectedSubproject()->path; + TQString dirName = m_widget->selectedSubproject()->path; FileItem *fitem = static_cast<FileItem*>( item ); if(fitem->is_subst) { @@ -710,15 +710,15 @@ void AutoDetailsView::slotSetActiveTarget() SubprojectItem * subpitem = m_widget->selectedSubproject(); if ( !subpitem ) return; - QString targetPath = subpitem->path + "/" + titem->name; + TQString targetPath = subpitem->path + "/" + titem->name; targetPath = targetPath.mid( m_part->projectDirectory().length() + 1 ); kdDebug( 9020 ) << "Setting active " << targetPath << endl; m_widget->setActiveTarget( targetPath ); - QDomDocument &dom = *m_part->projectDom(); + TQDomDocument &dom = *m_part->projectDom(); DomUtil::writeEntry( dom, "/kdevautoproject/general/activetarget", targetPath ); } -void AutoDetailsView::focusOutEvent(QFocusEvent */*e*/) +void AutoDetailsView::focusOutEvent(TQFocusEvent */*e*/) { m_widget->setLastFocusedView(AutoProjectWidget::DetailsView); } |