[En-Nut-Discussion] qnutconf

Marcin Trendota moonwolf.ethernut at gmail.com
Wed Oct 2 08:15:06 CEST 2013


Lately i was trying to add implementation for "first / last include
dir" fields in configuration dialog. It works for me (on Linux), but
i think it needs some more work and tests. Anyway here is the patch
(hope formatting will stay intact):

Index: nutcomponentmodel.cpp
===================================================================
--- nutcomponentmodel.cpp	(revision 5370)
+++ nutcomponentmodel.cpp	(working copy)
@@ -422,11 +422,13 @@
 	if ( CreateMakeFiles( d->repository, d->rootComponent, Settings::instance()->buildPath().toLocal8Bit(),
 		Settings::instance()->sourceDir().toLocal8Bit(), Settings::instance()->targetPlatform().toLocal8Bit(),
 #ifdef Q_OS_WIN32
-		Settings::instance()->includePath().join(";").toLocal8Bit(),
+		Settings::instance()->includePath()[0].toLocal8Bit(),
+		Settings::instance()->includePath()[1].toLocal8Bit(),
 #else
-		Settings::instance()->includePath().join(":").toLocal8Bit(),
+		Settings::instance()->includePath()[0].toLocal8Bit(),
+		Settings::instance()->includePath()[1].toLocal8Bit(),
 #endif
-		0, qPrintable(instDir)) )
+		qPrintable(instDir)) )
 	{
 		return false;
 	}
Index: settingsdialog.cpp
===================================================================
--- settingsdialog.cpp	(revision 5370)
+++ settingsdialog.cpp	(working copy)
@@ -51,6 +51,19 @@
 	ui.e_SourceDirectory->setText( Settings::instance()->sourceDir() );
 	ui.e_BuildDirectory->setText( Settings::instance()->buildPath() );
 	ui.e_InstallDirectory->setText( Settings::instance()->installPath() );
+	QStringList list = Settings::instance()->includePath();
+	QString includeFirst;
+	QString includeLast;
+	if (list.size() > 1)
+	{
+		includeLast = list[1];
+	}
+	if (list.size() > 0)
+	{
+		includeFirst = list[0];
+	}
+	ui.e_IncludeFirst->setText( includeFirst );
+	ui.e_IncludeLast->setText( includeLast );
 	populatePlatform();
 
 	// Tools tab
@@ -136,6 +149,8 @@
 	Settings::instance()->setBuildPath( ui.e_BuildDirectory->text() );
 	Settings::instance()->setInstallPath( ui.e_InstallDirectory->text() );
 	Settings::instance()->setTargetPlatform( ui.cb_Platform->currentText() );
+	QStringList list = QStringList() << ui.e_IncludeFirst->text() << ui.e_IncludeLast->text();
+	Settings::instance()->setIncludePath( list );
 
 	// Tools tab
 	Settings::instance()->setToolPath( ui.e_ToolPath->text() );

-- 
Best regards
Marcin Trendota



More information about the En-Nut-Discussion mailing list