We are currently not able to build Ubuntu 12.04 packages as those use Qt4
and setCurrentText is not supported there. Would this patch be OK or should
we use more elegant way for Qt4 support?

(I am actually not able to test this properly, as generated uic files have
also one call to setCurrentText and my compiles fail due to that. Dirk's
packaging/ubuntu/0001-Make-build-with-Qt4.patch is not included in the
sources and I assume that should take care of the uic generation as he has
been able to build the packages properly before.)

miika
From 5f4edb1a8232b714f9d2b7133c3de297a57d194b Mon Sep 17 00:00:00 2001
From: Miika Turkia <[email protected]>
Date: Sat, 24 Jan 2015 06:03:35 +0200
Subject: [PATCH] Workaround for missing setCurrentText on qt4

Signed-off-by: Miika Turkia <[email protected]>
---
 qt-ui/divelogimportdialog.cpp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index 08e5dd1..14f22c5 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -361,6 +361,7 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
 	bool matchedSome = false;
 	bool seabear = false;
 	bool xp5 = false;
+	int index;
 
 	// reset everything
 	ColumnNameProvider *provider = new ColumnNameProvider(this);
@@ -375,14 +376,16 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
 		seabear = true;
 		firstLine = "Sample time;Sample depth;Sample ndl;Sample tts;Sample stopdepth;Sample temperature;Sample pressure";
 		blockSignals(true);
-		ui->knownImports->setCurrentText("Seabear CSV");
+		index = ui->knownImports->findText("Seabear CSV");
+		ui->knownImports->setCurrentIndex(index);
 		blockSignals(false);
 	} else if (firstLine.contains("Tauchgangs-Nr.:")) {
 		xp5 = true;
 		//"Abgelaufene Tauchzeit (Std:Min.)\tTiefe\tStickstoff Balkenanzeige\tSauerstoff Balkenanzeige\tAufstiegsgeschwindigkeit\tRestluftzeit\tRestliche Tauchzeit\tDekompressionszeit (Std:Min)\tDekostopp-Tiefe\tTemperatur\tPO2\tPressluftflasche\tLesen des Druckes\tStatus der Verbindung\tTauchstatus";
 		firstLine = "Sample time\tSample depth\t\t\t\t\t\t\t\tSample temperature\t";
 		blockSignals(true);
-		ui->knownImports->setCurrentText("XP5");
+		index = ui->knownImports->findText("XP5");
+		ui->knownImports->setCurrentIndex(index);
 		blockSignals(false);
 	}
 	QString separator = ui->CSVSeparator->currentText() == tr("Tab") ? "\t" : ui->CSVSeparator->currentText();
@@ -400,7 +403,8 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
 			separator = ";";
 		if (ui->CSVSeparator->currentText() != separator) {
 			blockSignals(true);
-			ui->CSVSeparator->setCurrentText(separator);
+			index = ui->CSVSeparator->findText(separator);
+			ui->CSVSeparator->setCurrentIndex(index);
 			blockSignals(false);
 			currColumns = firstLine.split(separator);
 		}
@@ -434,7 +438,8 @@ void DiveLogImportDialog::loadFileContents(int value, whatChanged triggeredBy)
 		separator = CSVApps[value].separator;
 		if (ui->CSVSeparator->currentText() != separator) {
 			blockSignals(true);
-			ui->CSVSeparator->setCurrentText(separator);
+			index = ui->CSVSeparator->findText(separator);
+			ui->CSVSeparator->setCurrentIndex(index);
 			blockSignals(false);
 			if (separator == "Tab")
 				separator = "\t";
-- 
1.9.1

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to