From kde-commits Sat Jan 06 04:33:05 2007 From: Andreas Pakulat Date: Sat, 06 Jan 2007 04:33:05 +0000 To: kde-commits Subject: branches/kdevelop/3.4 [POSSIBLY UNSAFE] Message-Id: <1168057985.436159.24095.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=116805799505325 SVN commit 620454 by apaku: Allow to set simple environment settings for external designer so we can use KDE4 widgets in it. M +6 -0 languages/cpp/ccconfigwidget.cpp M +40 -2 languages/cpp/ccconfigwidgetbase.ui M +8 -0 languages/cpp/qtbuildconfig.cpp M +3 -0 languages/cpp/qtbuildconfig.h M +3 -1 src/partcontroller.cpp [POSSIBLY UNSAFE: KRun::runCommand] --- branches/kdevelop/3.4/languages/cpp/ccconfigwidget.cpp #620453:620454 @@ -408,6 +408,7 @@ m_kdevexternal->setEnabled( false ); m_qtStyleVersion4->setEnabled( true ); m_designerPath->setEnabled( true ); + m_designerPrefix->setEnabled( true ); m_qmakePath->setEnabled( true ); m_qtDir->setEnabled( false ); m_txtQtDir->setEnabled( false ); @@ -420,6 +421,7 @@ m_kdevexternal->setEnabled( true ); m_qtStyleVersion4->setEnabled( false ); m_designerPath->setEnabled( true ); + m_designerPrefix->setEnabled( false ); m_qmakePath->setEnabled( true ); m_qtDir->setEnabled( true ); m_txtQtDir->setEnabled( true ); @@ -448,6 +450,7 @@ }else { m_qtdesigner->setChecked( true ); + m_designerPrefix->setText( c->designerPrefix() ); } } @@ -503,6 +506,7 @@ c->setRoot( m_qtDir->url() ); c->setQMakePath( m_qmakePath->url() ); c->setDesignerPath( m_designerPath->url() ); + c->setDesignerPrefix( m_designerPrefix->text() ); if( m_kdevembedded->isChecked() ) { c->setDesignerIntegration( "EmbeddedKDevDesigner" ); @@ -539,6 +543,7 @@ m_qtStyleVersion3->setChecked( true ); m_kdevembedded->setEnabled( true ); m_kdevexternal->setEnabled( true ); + m_designerPrefix->setEnabled( false ); } if ( m_versionQt4->isChecked() ) { @@ -546,6 +551,7 @@ m_qtdesigner->setChecked( true ); m_kdevembedded->setEnabled( false ); m_kdevexternal->setEnabled( false ); + m_designerPrefix->setEnabled( true ); } isValidQtDir( m_qtDir->url() ); isQMakeExecutable( m_qmakePath->url() ); --- branches/kdevelop/3.4/languages/cpp/ccconfigwidgetbase.ui #620453:620454 @@ -8,8 +8,8 @@ 0 0 - 519 - 640 + 544 + 659 @@ -1451,6 +1451,9 @@ Designer Binary: + + m_designerPath + @@ -1462,6 +1465,38 @@ + + + layout10 + + + + unnamed + + + + textLabel1_4 + + + Prefix to Designer + + + m_designerPrefix + + + + + m_designerPrefix + + + Prefix the call for external designer with this + + + Anything written here will be put in front of the designer executable when running the external Qt designer. This can be useful to set Environment variables for running the Qt4 designer so it picks up KDE4 widgets + + + + @@ -1486,6 +1521,8 @@ + + newPCSButton @@ -1747,5 +1784,6 @@ kurlrequester.h klineedit.h kpushbutton.h + klineedit.h --- branches/kdevelop/3.4/languages/cpp/qtbuildconfig.cpp #620453:620454 @@ -53,6 +53,7 @@ m_root = DomUtil::readEntry( *m_dom, m_configRoot + "/root", "" ); m_qmakePath = DomUtil::readEntry(*m_dom, m_configRoot + "/qmake", ""); m_designerPath = DomUtil::readEntry(*m_dom, m_configRoot + "/designer", ""); + m_designerPrefix = DomUtil::readEntry(*m_dom, m_configRoot + "/designerprefix", ""); if( m_root.isEmpty() || !isValidQtDir( m_root ) ) { @@ -71,6 +72,7 @@ m_designerPath = findExecutable( "designer" ); } + m_designerIntegration = DomUtil::readEntry( *m_dom, m_configRoot + "/designerintegration" ); if( m_designerIntegration.isEmpty() ) { @@ -165,6 +167,7 @@ DomUtil::writeEntry( *m_dom, m_configRoot + "/designerintegration", m_designerIntegration ); DomUtil::writeEntry(*m_dom, m_configRoot + "/qmake", m_qmakePath ); DomUtil::writeEntry(*m_dom, m_configRoot + "/designer", m_designerPath ); + DomUtil::writeEntry(*m_dom, m_configRoot + "/designerprefix", m_designerPrefix ); emit stored(); } @@ -194,6 +197,11 @@ m_qmakePath = path; } +void QtBuildConfig::setDesignerPrefix( const QString& pfx ) +{ + m_designerPrefix = pfx; +} + void QtBuildConfig::setDesignerPath( const QString& path ) { m_designerPath = path; --- branches/kdevelop/3.4/languages/cpp/qtbuildconfig.h #620453:620454 @@ -42,6 +42,7 @@ inline const QString& root() const { return m_root; } inline const QString& qmakePath() const { return m_qmakePath; } inline const QString& designerPath() const { return m_designerPath; } + inline const QString& designerPrefix() const { return m_designerPrefix; } inline const QString& designerIntegration() const { return m_designerIntegration; } void setUsed( bool used ); @@ -49,6 +50,7 @@ void setIncludeStyle( int style ); void setRoot( const QString& root ); void setDesignerPath( const QString& path ); + void setDesignerPrefix( const QString& pfx ); void setQMakePath( const QString& path ); void setDesignerIntegration( const QString& designerIntegration ); void init(); @@ -76,6 +78,7 @@ QString m_root; ///< The root directory of the used qt installation for Qt3 QString m_designerPath; ///< The path including the binary name of Qt Designer QString m_qmakePath; ///< The path including the binary name of QMake + QString m_designerPrefix; ///< The Prefix for Designer QString m_designerIntegration; ///< The type of designer used, kdevdesigner or qt designer static const QString m_configRoot; ///< The root path of the configuration --- branches/kdevelop/3.4/src/partcontroller.cpp #620453:620454 @@ -387,6 +387,7 @@ { QString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" ); QString designerExec = "designer"; + QString designerPrefix = ""; QDomDocument* dom = API::getInstance()->projectDom(); if ( dom != 0 ) { @@ -398,6 +399,7 @@ DesignerSetting = DomUtil::readEntry(*dom, "/kdevcppsupport/qt/designerintegration", DesignerSetting ); designerExec = DomUtil::readEntry(*dom, "/kdevcppsupport/qt/designer", designerExec ); + designerPrefix = DomUtil::readEntry(*dom, "/kdevcppsupport/qt/designerprefix", designerPrefix ); } if ( DesignerSetting == "ExternalKDevDesigner" ) { @@ -423,7 +425,7 @@ return; } } - KRun::run( designerExec, url ); + KRun::runCommand( designerPrefix+" "+designerExec+" "+url.pathOrURL() ); return; }