summaryrefslogtreecommitdiffstats
path: root/buildtools/qmake/trollprojectwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools/qmake/trollprojectwidget.cpp')
-rw-r--r--buildtools/qmake/trollprojectwidget.cpp118
1 files changed, 51 insertions, 67 deletions
diff --git a/buildtools/qmake/trollprojectwidget.cpp b/buildtools/qmake/trollprojectwidget.cpp
index 3c35cb94..bc5c850c 100644
--- a/buildtools/qmake/trollprojectwidget.cpp
+++ b/buildtools/qmake/trollprojectwidget.cpp
@@ -32,7 +32,7 @@
#include <tqptrstack.h>
#include <tqtextstream.h>
#include <tqcombobox.h>
-#include <kprocess.h>
+#include <tdeprocess.h>
#include <tqtimer.h>
#include <tqdir.h>
#include <tqregexp.h>
@@ -51,7 +51,6 @@
#include <iostream>
#include <tdeparts/part.h>
#include <tdeaction.h>
-#include <kprocess.h>
#include <kinputdialog.h>
#include <tdeversion.h>
#include <kdirwatch.h>
@@ -84,7 +83,7 @@ TrollProjectWidget::TrollProjectWidget( TrollProjectPart *part )
m_rootScope ( 0 ), m_part ( part ), m_configDlg( 0 ), m_filesCached(false)
{
- TQSplitter * splitter = new TQSplitter(Qt::Vertical, this );
+ TQSplitter * splitter = new TQSplitter(TQt::Vertical, this );
//////////////////
// PROJECT VIEW //
@@ -156,16 +155,16 @@ TrollProjectWidget::TrollProjectWidget( TrollProjectPart *part )
"external libraries,<br>build order,<br>intermediate files locations,<br>compiler options." ) );
// Project button connections
- connect ( addSubdirButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotAddSubproject () ) );
- connect ( createScopeButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotCreateScope () ) );
+ connect ( addSubdirButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotAddSubproject () ) );
+ connect ( createScopeButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotCreateScope () ) );
- connect ( buildProjectButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotBuildProject () ) );
- connect ( rebuildProjectButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotRebuildProject () ) );
- connect ( executeProjectButton, TQT_SIGNAL ( clicked () ), m_part, TQT_SLOT ( slotBuildAndExecuteProject () ) );
+ connect ( buildProjectButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotBuildProject () ) );
+ connect ( rebuildProjectButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotRebuildProject () ) );
+ connect ( executeProjectButton, TQ_SIGNAL ( clicked () ), m_part, TQ_SLOT ( slotBuildAndExecuteProject () ) );
- connect ( projectconfButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotConfigureProject () ) );
+ connect ( projectconfButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotConfigureProject () ) );
// Project tree
overview = new TrollListView( this, overviewContainer, SubprojectView, "project overview widget" );
@@ -175,10 +174,10 @@ TrollProjectWidget::TrollProjectWidget( TrollProjectPart *part )
overview->addColumn( TQString() );
// Project tree connections
- connect( overview, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ),
- this, TQT_SLOT( slotOverviewSelectionChanged( TQListViewItem* ) ) );
- connect( overview, TQT_SIGNAL( contextMenu( TDEListView*, TQListViewItem*, const TQPoint& ) ),
- this, TQT_SLOT( slotOverviewContextMenu( TDEListView*, TQListViewItem*, const TQPoint& ) ) );
+ connect( overview, TQ_SIGNAL( selectionChanged( TQListViewItem* ) ),
+ this, TQ_SLOT( slotOverviewSelectionChanged( TQListViewItem* ) ) );
+ connect( overview, TQ_SIGNAL( contextMenu( TDEListView*, TQListViewItem*, const TQPoint& ) ),
+ this, TQ_SLOT( slotOverviewContextMenu( TDEListView*, TQListViewItem*, const TQPoint& ) ) );
/////////////////
@@ -284,30 +283,30 @@ TrollProjectWidget::TrollProjectWidget( TrollProjectPart *part )
details->header() ->hide();
details->addColumn( TQString() );
// Detail button connections
- connect ( addfilesButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotAddFiles () ) );
- connect ( newfileButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotNewFile () ) );
- connect ( removefileButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotRemoveFile () ) );
- connect ( buildFileButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotBuildSelectedFile () ) );
- connect ( excludeFileFromScopeButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotExcludeFileFromScopeButton() ) );
+ connect ( addfilesButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotAddFiles () ) );
+ connect ( newfileButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotNewFile () ) );
+ connect ( removefileButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotRemoveFile () ) );
+ connect ( buildFileButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotBuildSelectedFile () ) );
+ connect ( excludeFileFromScopeButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotExcludeFileFromScopeButton() ) );
// Detail tree connections
- connect( details, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ),
- this, TQT_SLOT( slotDetailsSelectionChanged( TQListViewItem* ) ) );
- connect( details, TQT_SIGNAL( executed( TQListViewItem* ) ),
- this, TQT_SLOT( slotDetailsExecuted( TQListViewItem* ) ) );
- connect( details, TQT_SIGNAL( contextMenu( TDEListView*, TQListViewItem*, const TQPoint& ) ),
- this, TQT_SLOT( slotDetailsContextMenu( TDEListView*, TQListViewItem*, const TQPoint& ) ) );
-
- connect ( buildTargetButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotBuildTarget () ) );
- connect ( rebuildTargetButton, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( slotRebuildTarget () ) );
- connect ( executeTargetButton, TQT_SIGNAL ( clicked () ), m_part, TQT_SLOT ( slotBuildAndExecuteTarget () ) );
+ connect( details, TQ_SIGNAL( selectionChanged( TQListViewItem* ) ),
+ this, TQ_SLOT( slotDetailsSelectionChanged( TQListViewItem* ) ) );
+ connect( details, TQ_SIGNAL( executed( TQListViewItem* ) ),
+ this, TQ_SLOT( slotDetailsExecuted( TQListViewItem* ) ) );
+ connect( details, TQ_SIGNAL( contextMenu( TDEListView*, TQListViewItem*, const TQPoint& ) ),
+ this, TQ_SLOT( slotDetailsContextMenu( TDEListView*, TQListViewItem*, const TQPoint& ) ) );
+
+ connect ( buildTargetButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotBuildTarget () ) );
+ connect ( rebuildTargetButton, TQ_SIGNAL ( clicked () ), this, TQ_SLOT ( slotRebuildTarget () ) );
+ connect ( executeTargetButton, TQ_SIGNAL ( clicked () ), m_part, TQ_SLOT ( slotBuildAndExecuteTarget () ) );
buildTargetButton->setEnabled( false );
rebuildTargetButton->setEnabled( false );
executeTargetButton->setEnabled( false );
m_configDlg = new ProjectConfigurationDlg( overview, this, this );
- connect( m_part->dirWatch(), TQT_SIGNAL( dirty(const TQString&) ), this, TQT_SLOT( slotProjectDirty(const TQString&) ) );
+ connect( m_part->dirWatch(), TQ_SIGNAL( dirty(const TQString&) ), this, TQ_SLOT( slotProjectDirty(const TQString&) ) );
}
@@ -680,7 +679,7 @@ void TrollProjectWidget::slotExecuteTarget()
m_part->appFrontend()->stopApplication();
while(m_part->appFrontend()->isRunning())
{
- TDEApplication::kApplication()->processEvents();
+ tdeApp->processEvents();
usleep(100);
}
}
@@ -715,7 +714,7 @@ void TrollProjectWidget::slotExecuteTarget()
void TrollProjectWidget::slotBuildProject()
{
- if ( m_part->partController() ->saveAllFiles() == false )
+ if ( !m_part->partController() ->saveAllFiles() )
return ; //user cancelled
TQString dir = projectDirectory();
@@ -733,7 +732,7 @@ void TrollProjectWidget::slotBuildProject()
void TrollProjectWidget::slotInstallProject()
{
- if ( m_part->partController() ->saveAllFiles() == false )
+ if ( !m_part->partController() ->saveAllFiles() )
return ; //user cancelled
TQString dir = projectDirectory();
@@ -1301,7 +1300,7 @@ void TrollProjectWidget::slotAddFiles()
case AddFilesDialog::Link:
{
// Link selected files to current subproject folder
- TDEProcess *proc = new TDEProcess( TQT_TQOBJECT(this) );
+ TDEProcess *proc = new TDEProcess( this );
*proc << "ln";
*proc << "-s";
*proc << files[ i ];
@@ -1371,7 +1370,7 @@ void TrollProjectWidget::slotNewFile()
if ( gitem->groupType == GroupItem::InstallObject )
{
// TQString relpath = m_shownSubproject->path.mid(projectDirectory().length());
- bool ok = FALSE;
+ bool ok = false;
TQString filepattern = KInputDialog::getText(
i18n( "Insert New Filepattern" ),
i18n( "Please enter a filepattern relative the current "
@@ -1387,7 +1386,7 @@ void TrollProjectWidget::slotNewFile()
if ( gitem->groupType == GroupItem::InstallRoot )
{
// TQString relpath = m_shownSubproject->path.mid(projectDirectory().length());
- bool ok = FALSE;
+ bool ok = false;
TQString install_obj = KInputDialog::getText(
i18n( "Insert New Install Object" ),
i18n( "Please enter a name for the new object:" ),
@@ -1416,10 +1415,7 @@ void TrollProjectWidget::slotNewFile()
fcext = "h";
break;
case GroupItem::Forms:
- if ( !m_part->isTQt4Project() )
- fcext = "ui-widget";
- else
- fcext = "ui-widget-qt4";
+ fcext = "ui-widget";
break;
case GroupItem::Translations:
fcext = "ts";
@@ -1599,7 +1595,7 @@ void TrollProjectWidget::slotDetailsContextMenu( TDEListView *, TQListViewItem *
}
else if ( r == idInsNewFilepatternItem )
{
- bool ok = FALSE;
+ bool ok = false;
TQString filepattern = KInputDialog::getText(
i18n( "Add Pattern of Files to Install" ),
i18n( "Enter a pattern relative to the current "
@@ -1645,7 +1641,7 @@ void TrollProjectWidget::slotDetailsContextMenu( TDEListView *, TQListViewItem *
case AddFilesDialog::Link:
{
// Link selected files to current subproject folder
- TDEProcess *proc = new TDEProcess( TQT_TQOBJECT(this) );
+ TDEProcess *proc = new TDEProcess( this );
*proc << "ln";
*proc << "-s";
*proc << files[ i ];
@@ -1694,10 +1690,7 @@ void TrollProjectWidget::slotDetailsContextMenu( TDEListView *, TQListViewItem *
fcext = "h";
break;
case GroupItem::Forms:
- if ( !m_part->isTQt4Project() )
- fcext = "ui-widget";
- else
- fcext = "ui-widget-qt4";
+ fcext = "ui-widget";
break;
case GroupItem::Translations:
fcext = "ts";
@@ -1720,7 +1713,7 @@ void TrollProjectWidget::slotDetailsContextMenu( TDEListView *, TQListViewItem *
}
else if ( r == idInsInstallObject )
{
- bool ok = FALSE;
+ bool ok = false;
TQString install_obj = KInputDialog::getText(
i18n( "Add Install Object" ),
i18n( "Enter a name for the new object:" ),
@@ -1782,11 +1775,8 @@ void TrollProjectWidget::slotDetailsContextMenu( TDEListView *, TQListViewItem *
popup.setWhatsThis( idSubclassWidget, i18n( "<b>Subclass widget</b><p>Launches <b>Subclassing</b> wizard. "
"It allows to create a subclass from the class defined in .ui file. "
"There is also possibility to implement slots and functions defined in the base class." ) );
- if ( !m_part->isTQt4Project() )
- {
- idViewUIH = popup.insertItem( SmallIconSet( "qmake_ui_h" ), i18n( "Open ui.h File" ) );
- popup.setWhatsThis( idViewUIH, i18n( "<b>Open ui.h file</b><p>Opens .ui.h file associated with the selected .ui." ) );
- }
+ idViewUIH = popup.insertItem( SmallIconSet( "qmake_ui_h" ), i18n( "Open ui.h File" ) );
+ popup.setWhatsThis( idViewUIH, i18n( "<b>Open ui.h file</b><p>Opens .ui.h file associated with the selected .ui." ) );
idUISubclasses = popup.insertItem( SmallIconSet( "qmake_subclass" ), i18n( "List of Subclasses..." ) );
popup.setWhatsThis( idUISubclasses, i18n( "<b>List of subclasses</b><p>Shows subclasses list editor. "
"There is possibility to add or remove subclasses from the list." ) );
@@ -1900,7 +1890,7 @@ void TrollProjectWidget::slotDetailsContextMenu( TDEListView *, TQListViewItem *
{
GroupItem * titem = static_cast<GroupItem*>( item->parent() );
- bool ok = FALSE;
+ bool ok = false;
TQString filepattern = KInputDialog::getText(
i18n( "Edit Pattern" ),
i18n( "Enter a pattern relative to the current "
@@ -2062,7 +2052,7 @@ void TrollProjectWidget::slotExecuteProject()
m_part->appFrontend()->stopApplication();
while(m_part->appFrontend()->isRunning())
{
- TDEApplication::kApplication()->processEvents();
+ tdeApp->processEvents();
usleep(100);
}
}
@@ -2340,21 +2330,15 @@ void TrollProjectWidget::setLastFocusedView( TrollProjectView view )
void TrollProjectWidget::runTQMakeRecursive( QMakeScopeItem* proj )
{
- if( m_part->isTQt4Project() )
+ if ( proj->scope->scopeType() == Scope::ProjectScope )
{
- m_part->startTQMakeCommand( proj->scope->projectDir(), true );
- }else
+ m_part->startTQMakeCommand( proj->scope->projectDir() );
+ }
+ QMakeScopeItem* item = static_cast<QMakeScopeItem*>( proj->firstChild() );
+ while ( item )
{
- if ( proj->scope->scopeType() == Scope::ProjectScope )
- {
- m_part->startTQMakeCommand( proj->scope->projectDir() );
- }
- QMakeScopeItem* item = static_cast<QMakeScopeItem*>( proj->firstChild() );
- while ( item )
- {
- runTQMakeRecursive( item );
- item = static_cast<QMakeScopeItem*>( item->nextSibling() );
- }
+ runTQMakeRecursive( item );
+ item = static_cast<QMakeScopeItem*>( item->nextSibling() );
}
}
@@ -2533,7 +2517,7 @@ TQMap<TQString,TQString> TrollProjectWidget::qmakeEnvironment() const
map[(*it).first] = (*it).second;
}
- if( !hasTQtDir && !m_part->isTQt4Project() && !DomUtil::readEntry(*m_part->projectDom(), "/kdevcppsupport/qt/root", "").isEmpty() )
+ if( !hasTQtDir && !DomUtil::readEntry(*m_part->projectDom(), "/kdevcppsupport/qt/root", "").isEmpty() )
{
map["TQTDIR="] = DomUtil::readEntry(*m_part->projectDom(), "/kdevcppsupport/qt/root", "");
map["PATH"] = map["PATH"].prepend( DomUtil::readEntry(*m_part->projectDom(), "/kdevcppsupport/qt/root", "") +"/bin" );