[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/kdevelop/3.4 [POSSIBLY UNSAFE]
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2007-01-07 2:09:50
Message-ID: 1168135790.567394.13621.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 620704 by apaku:

Improve the plugin-paths configuration for Qt4 designer. Now we don't use some \
obscure "prefix", but only provide the ability to set the plugin path for Qt4 \
designer.


 M  +17 -6     languages/cpp/ccconfigwidget.cpp  
 M  +2 -0      languages/cpp/ccconfigwidget.h  
 M  +20 -38    languages/cpp/ccconfigwidgetbase.ui  
 M  +4 -4      languages/cpp/qtbuildconfig.cpp  
 M  +4 -3      languages/cpp/qtbuildconfig.h  
 M  +11 -3     src/partcontroller.cpp   [POSSIBLY UNSAFE: KRun::runCommand]


--- branches/kdevelop/3.4/languages/cpp/ccconfigwidget.cpp #620703:620704
@@ -22,6 +22,7 @@
 #include <qheader.h>
 #include <qcolor.h>
 #include <qlabel.h>
+#include <qlayout.h>
 
 // kde includes
 #include <kdevproject.h>
@@ -32,6 +33,7 @@
 #include <kstandarddirs.h>
 #include <kfileitem.h>
 #include <kurlrequester.h>
+#include <keditlistbox.h>
 #include <klistview.h>
 #include <knuminput.h>
 #include <kmainwindow.h>
@@ -61,6 +63,17 @@
 CCConfigWidget::CCConfigWidget( CppSupportPart* part, QWidget* parent, const char* \
name )  : CCConfigWidgetBase( parent, name )
 {
+    KURLRequester * req = new KURLRequester( this );
+    req->setMode( KFile::Directory );
+    KEditListBox::CustomEditor pCustomEditor;
+    pCustomEditor = req->customEditor();
+    m_designerPluginPaths = new KEditListBox( i18n( "Qt4 Designer Plugin Paths" ), \
pCustomEditor, m_designerBox ); +
+    m_designerBox->layout()->add( m_designerPluginPaths );
+    m_designerPluginPaths->show();
+
+    connect( m_versionQt4, SIGNAL( toggled( bool ) ), m_designerPluginPaths, SLOT(  \
setEnabled( bool ) ) ); +
 	m_pPart = part;
 	connect( m_pPart->codeRepository(), SIGNAL( catalogRegistered( Catalog* ) ),
 	         this, SLOT( catalogRegistered( Catalog* ) ) );
@@ -408,7 +421,7 @@
 		m_kdevexternal->setEnabled( false );
 		m_qtStyleVersion4->setEnabled( true );
         m_designerPath->setEnabled( true );
-        m_designerPrefix->setEnabled( true );
+        m_designerPluginPaths->setEnabled( true );
         m_qmakePath->setEnabled( true );
         m_qtDir->setEnabled( false );
         m_txtQtDir->setEnabled( false );
@@ -421,7 +434,7 @@
 		m_kdevexternal->setEnabled( true );
 		m_qtStyleVersion4->setEnabled( false );
         m_designerPath->setEnabled( true );
-        m_designerPrefix->setEnabled( false );
+        m_designerPluginPaths->setEnabled( false );
         m_qmakePath->setEnabled( true );
         m_qtDir->setEnabled( true );
         m_txtQtDir->setEnabled( true );
@@ -450,7 +463,7 @@
 	}else
 	{
 		m_qtdesigner->setChecked( true );
-        m_designerPrefix->setText( c->designerPrefix() );
+        m_designerPluginPaths->insertStringList( c->designerPluginPaths() );
 	}
 }
 
@@ -506,7 +519,7 @@
 	c->setRoot( m_qtDir->url() );
     c->setQMakePath( m_qmakePath->url() );
     c->setDesignerPath( m_designerPath->url() );
-    c->setDesignerPrefix( m_designerPrefix->text() );
+    c->setDesignerPluginPaths( m_designerPluginPaths->items() );
 	if( m_kdevembedded->isChecked() )
 	{
 		c->setDesignerIntegration( "EmbeddedKDevDesigner" );
@@ -543,7 +556,6 @@
     m_qtStyleVersion3->setChecked( true );
     m_kdevembedded->setEnabled( true );
     m_kdevexternal->setEnabled( true );
-    m_designerPrefix->setEnabled( false );
   }
   if ( m_versionQt4->isChecked() )
   {
@@ -551,7 +563,6 @@
     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/ccconfigwidget.h #620703:620704
@@ -18,6 +18,7 @@
 class CppSupportPart;
 class Catalog;
 class QCheckListItem;
+class KEditListBox;
 
 class CCConfigWidget : public CCConfigWidgetBase
 {
@@ -64,6 +65,7 @@
 private:
 	CppSupportPart* m_pPart;
 	QMap<QCheckListItem*, Catalog*> m_catalogs;
+    KEditListBox* m_designerPluginPaths;
 };
 
 #endif
--- branches/kdevelop/3.4/languages/cpp/ccconfigwidgetbase.ui #620703:620704
@@ -8,18 +8,18 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>544</width>
-            <height>659</height>
+            <width>608</width>
+            <height>815</height>
         </rect>
     </property>
     <property name="caption">
         <string>C++ Options</string>
     </property>
-    <grid>
+    <vbox>
         <property name="name">
             <cstring>unnamed</cstring>
         </property>
-        <widget class="QTabWidget" row="0" column="0">
+        <widget class="QTabWidget">
             <property name="name">
                 <cstring>cpp_options</cstring>
             </property>
@@ -1465,39 +1465,16 @@
                                     </widget>
                                 </hbox>
                             </widget>
-                            <widget class="QLayoutWidget">
+                            <widget class="QLabel">
                                 <property name="name">
-                                    <cstring>layout10</cstring>
+                                    <cstring>textLabel1_4</cstring>
                                 </property>
-                                <hbox>
-                                    <property name="name">
-                                        <cstring>unnamed</cstring>
-                                    </property>
-                                    <widget class="QLabel">
-                                        <property name="name">
-                                            <cstring>textLabel1_4</cstring>
-                                        </property>
-                                        <property name="text">
-                                            <string>Prefix to Designer</string>
-                                        </property>
-                                        <property name="buddy" stdset="0">
-                                            <cstring>m_designerPrefix</cstring>
-                                        </property>
-                                    </widget>
-                                    <widget class="KLineEdit">
-                                        <property name="name">
-                                            <cstring>m_designerPrefix</cstring>
-                                        </property>
-                                        <property name="toolTip" stdset="0">
-                                            <string>Prefix the call for external \
                designer with this</string>
-                                        </property>
-                                        <property name="whatsThis" stdset="0">
-                                            <string>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.
-Example:
-QT_PLUGIN_PATH=/where/kde4/is/lib/kde4/plugins</string>
-                                        </property>
-                                    </widget>
-                                </hbox>
+                                <property name="text">
+                                    <string>Extra Plugin Paths for Qt4 \
Designer:</string> +                                </property>
+                                <property name="buddy" stdset="0">
+                                    <cstring>m_designerPrefix</cstring>
+                                </property>
                             </widget>
                         </vbox>
                     </widget>
@@ -1514,14 +1491,14 @@
                         <property name="sizeHint">
                             <size>
                                 <width>20</width>
-                                <height>270</height>
+                                <height>70</height>
                             </size>
                         </property>
                     </spacer>
                 </vbox>
             </widget>
         </widget>
-    </grid>
+    </vbox>
 </widget>
 <customwidgets>
 </customwidgets>
@@ -1724,6 +1701,12 @@
         <receiver>CCConfigWidgetBase</receiver>
         <slot>isDesignerExecutable(const QString&amp;)</slot>
     </connection>
+    <connection>
+        <sender>m_versionQt4</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>textLabel1_4</receiver>
+        <slot>setEnabled(bool)</slot>
+    </connection>
 </connections>
 <tabstops>
     <tabstop>cpp_options</tabstop>
@@ -1786,6 +1769,5 @@
     <includehint>kurlrequester.h</includehint>
     <includehint>klineedit.h</includehint>
     <includehint>kpushbutton.h</includehint>
-    <includehint>klineedit.h</includehint>
 </includehints>
 </UI>
--- branches/kdevelop/3.4/languages/cpp/qtbuildconfig.cpp #620703:620704
@@ -53,7 +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", \
""); +    m_designerPluginPaths = DomUtil::readListEntry(*m_dom, m_configRoot + \
"/designerpluginpaths", "path" );  
     if( m_root.isEmpty() || !isValidQtDir( m_root ) )
     {
@@ -167,7 +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 \
); +    DomUtil::writeListEntry(*m_dom, m_configRoot + "/designerpluginpaths", \
"path",  m_designerPluginPaths );  
 	emit stored();
 }
@@ -197,9 +197,9 @@
     m_qmakePath = path;
 }
 
-void QtBuildConfig::setDesignerPrefix( const QString& pfx )
+void QtBuildConfig::setDesignerPluginPaths( const QStringList& pfx )
 {
-    m_designerPrefix = pfx;
+    m_designerPluginPaths = pfx;
 }
 
 void QtBuildConfig::setDesignerPath( const QString& path )
--- branches/kdevelop/3.4/languages/cpp/qtbuildconfig.h #620703:620704
@@ -19,6 +19,7 @@
 #define QTBUILDCONFIG_H
 
 #include <qobject.h>
+#include <qstringlist.h>
 
 class CppSupportPart;
 class QDomDocument;
@@ -42,7 +43,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 QStringList& designerPluginPaths() const { return \
m_designerPluginPaths; }  inline const QString& designerIntegration() const { return \
m_designerIntegration; }  
 	void setUsed( bool used );
@@ -50,7 +51,7 @@
 	void setIncludeStyle( int style );
 	void setRoot( const QString& root );
     void setDesignerPath( const QString& path );
-    void setDesignerPrefix( const QString& pfx );
+    void setDesignerPluginPaths( const QStringList& pfx );
     void setQMakePath( const QString& path );
 	void setDesignerIntegration( const QString& designerIntegration );
 	void init();
@@ -78,7 +79,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
+    QStringList m_designerPluginPaths; ///< 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 #620703:620704
@@ -26,6 +26,7 @@
 #include <kfiledialog.h>
 #include <kmainwindow.h>
 #include <kaction.h>
+#include <kmessagebox.h>
 #include <kstatusbar.h>
 #include <khtml_part.h>
 #include <kpopupmenu.h>
@@ -387,7 +388,7 @@
 	{
 		QString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" \
);  QString designerExec = "designer";
-		QString designerPrefix = "";
+		QStringList designerPluginPaths;
 		QDomDocument* dom = API::getInstance()->projectDom();
 		if ( dom != 0 )
 		{
@@ -395,11 +396,13 @@
 			// has no setting or no project is open. However for Qt4
 			// projects we want to use ExternalDesigner in any case.
 			if ( DomUtil::readIntEntry( *dom, "/kdevcppsupport/qt/version", 3 ) == 4 )
+			{
+				designerPluginPaths = DomUtil::readListEntry(*dom, \
"/kdevcppsupport/qt/designerpluginpaths", "path" );  DesignerSetting = \
"ExternalDesigner"; +			}
 
 			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" )
 		{
@@ -425,7 +428,12 @@
 				return;
 			}
 		}
-		KRun::runCommand( designerPrefix+" "+designerExec+" "+url.pathOrURL() );
+    KMessageBox::warningYesNo(0, \
"QT_PLUGIN_PATH=\""+designerPluginPaths.join(":")+"\" "+designerExec, \
designerPluginPaths.join(" ") ); +		if( designerPluginPaths.isEmpty() )
+			KRun::runCommand( designerExec+" "+url.pathOrURL() );
+		else
+			KRun::runCommand( "QT_PLUGIN_PATH=\""+designerPluginPaths.join(":")+"\" \
"+designerExec+" "+url.pathOrURL() ); +
 		return;
 	}
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic