Blob Blame History Raw
From ba44c32b266c598c764447a8411e9000e7ec7dd9 Mon Sep 17 00:00:00 2001
From: Luca Beltrame <lbeltrame@kde.org>
Date: Mon, 19 Nov 2012 19:35:30 +0100
Subject: [PATCH] Fix Python3 and Python2 text handling.

Somehow when refactoring the CMakeLists and fixing the duplicated
definitions, the SIP options for Python 2 and Python 3 got swapped,
causing all sorts of subtle bugs (i18n() failing on Python3, encoding
errors from QString on Python 2). This patch fixes the behavior.

Thanks to Phil Thompson for finding out the cause.

This fix will also be forward-ported to master.

CCMAIL: kde-packager@kde.org
---
 CMakeLists.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index af7a815..56249ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,16 +98,16 @@ SET(SIP_DISABLE_FEATURES VendorID PyQt_NoPrintRangeBug)
 IF (PYTHON_3)
     IF(PYQT4_VERSION STRGREATER "040904")  
 	# Disable for newer PyQt
-	SET(SIP_EXTRA_OPTIONS -g -x PyKDE_QVector -x Py_v3)
+	set(SIP_EXTRA_OPTIONS -g -x PyKDE_QVector)
     ELSE (PYQT4_VERSION STRGREATER "040904")
-	SET(SIP_EXTRA_OPTIONS -g -x Py_v3)
+	set(SIP_EXTRA_OPTIONS -g)
     ENDIF(PYQT4_VERSION STRGREATER "040904")
 ELSE (PYTHON_3)
     IF(PYQT4_VERSION STRGREATER "040904")  
 	# Disable for newer PyQt
-	SET(SIP_EXTRA_OPTIONS -g -x PyKDE_QVector)
+	set(SIP_EXTRA_OPTIONS -g -x PyKDE_QVector -x Py_v3)
     ELSE (PYQT4_VERSION STRGREATER "040904")
-	SET(SIP_EXTRA_OPTIONS -g)
+	set(SIP_EXTRA_OPTIONS -g -x Py_v3)
     ENDIF(PYQT4_VERSION STRGREATER "040904")
 ENDIF (PYTHON_3)
 
-- 
1.8.0