diff options
author | Christian Tismer <ctismer@gmail.com> | 2015-06-10 13:01:02 +0200 |
---|---|---|
committer | Christian Tismer <ctismer@gmail.com> | 2015-06-10 13:01:02 +0200 |
commit | d7f2a9bc3d228884235f19e1e73d132e7db39deb (patch) | |
tree | d06820e9cedd724807d087ff64db5f3a83535a98 | |
parent | edcad2b4f3c7c6dc12b8774c931600bf11363707 (diff) |
successfully adjusted to qt5
The most work was to adjust for the new languages in CLDR 22.1
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | pylupdate/CMakeLists.txt | 25 | ||||
-rw-r--r-- | pylupdate/main.cpp | 8 | ||||
-rw-r--r-- | pylupdate/metatranslator.cpp | 8 | ||||
-rw-r--r-- | pylupdate/translator.h | 18 | ||||
-rw-r--r-- | pyrcc/CMakeLists.txt | 11 |
6 files changed, 45 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ade68e5..830dcb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,13 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.0) project(pyside-tools) -find_package(Shiboken 1.1.1 REQUIRED) -find_package(Qt4 4.5.0 REQUIRED) -find_package(PySide 1.0.6 REQUIRED) +find_package(Shiboken 2.0.0 REQUIRED) +find_package(Qt5 REQUIRED Core) +find_package(PySide 1.1.0 REQUIRED) -set(pyside_tools_MAJOR_VERSION "0") -set(pyside_tools_MINOR_VERSION "2") -set(pyside_tools_MICRO_VERSION "15") +set(pyside_tools_MAJOR_VERSION "2") +set(pyside_tools_MINOR_VERSION "0") +set(pyside_tools_MICRO_VERSION "0") set(pyside_tools_VERSION "${pyside_tools_MAJOR_VERSION}.${pyside_tools_MINOR_VERSION}.${pyside_tools_MICRO_VERSION}") configure_file("pysideuic/__init__.py.in" "__init__.py" @ONLY) diff --git a/pylupdate/CMakeLists.txt b/pylupdate/CMakeLists.txt index bc1bd88..72cdf7d 100644 --- a/pylupdate/CMakeLists.txt +++ b/pylupdate/CMakeLists.txt @@ -11,22 +11,29 @@ simtexth.cpp translator.cpp ) +find_package(Qt5Core) +find_package(Qt5Gui) +find_package(Qt5Xml) +find_package(Qt5Widgets) + set(lupdate_MOC_HEADERS translator.h) -qt4_wrap_cpp(lupdate_MOC_OUTFILES ${lupdate_MOC_HEADERS}) +qt5_wrap_cpp(lupdate_MOC_OUTFILES ${lupdate_MOC_HEADERS}) add_executable(pyside-lupdate ${lupdate_SRC} ${lupdate_MOC_OUTFILES}) include_directories(pyside-lupdate ${CMAKE_CURRENT_SOURCE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} - ${QT_QTGUI_INCLUDE_DIR}) + ${Qt5Xml_INCLUDE_DIRS} + ${Qt5Core_INCLUDE_DIRS} + ${Qt5Gui_INCLUDE_DIRS} + ${Qt5Widgets_INCLUDE_DIRS} + ) target_link_libraries(pyside-lupdate - ${QT_QTCORE_LIBRARY} - ${QT_QTXML_LIBRARY} - ${QT_QTGUI_LIBRARY}) + ${Qt5Core_LIBRARIES} + ${Qt5Xml_LIBRARIES} + ${Qt5Gui_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ) install(TARGETS pyside-lupdate RUNTIME DESTINATION bin) diff --git a/pylupdate/main.cpp b/pylupdate/main.cpp index 453f41e..1f4d3ce 100644 --- a/pylupdate/main.cpp +++ b/pylupdate/main.cpp @@ -185,7 +185,7 @@ int main( int argc, char **argv ) for ( t = toks.begin(); t != toks.end(); ++t ) { if ( it.key() == "SOURCES" ) { - fetchtr_py( (*t).toAscii(), &fetchedTor, defaultContext.toAscii(), true, codecForSource ); + fetchtr_py( (*t).toUtf8(), &fetchedTor, defaultContext.toUtf8(), true, codecForSource ); metSomething = true; } else if ( it.key() == "TRANSLATIONS" ) { tsFileNames.append( *t ); @@ -198,7 +198,7 @@ int main( int argc, char **argv ) } else if ( it.key() == "CODECFORSRC" ) { codecForSource = (*t).toLatin1(); } else if ( it.key() == "FORMS" ) { - fetchtr_ui( (*t).toAscii(), &fetchedTor, defaultContext.toAscii(), true); + fetchtr_ui( (*t).toUtf8(), &fetchedTor, defaultContext.toUtf8(), true); } } } @@ -236,9 +236,9 @@ int main( int argc, char **argv ) } else { QFileInfo fi(argv[i]); if ( fi.suffix() == "py" || fi.suffix() == "pyw" ) { - fetchtr_py( fi.fileName().toAscii(), &fetchedTor, defaultContext.toAscii(), true, codecForSource ); + fetchtr_py( fi.fileName().toUtf8(), &fetchedTor, defaultContext.toUtf8(), true, codecForSource ); } else { - fetchtr_ui( fi.fileName().toAscii(), &fetchedTor, defaultContext.toAscii(), true); + fetchtr_ui( fi.fileName().toUtf8(), &fetchedTor, defaultContext.toUtf8(), true); } } } diff --git a/pylupdate/metatranslator.cpp b/pylupdate/metatranslator.cpp index afa6fda..f610333 100644 --- a/pylupdate/metatranslator.cpp +++ b/pylupdate/metatranslator.cpp @@ -164,9 +164,9 @@ bool TsHandler::endElement( const QString& /* namespaceURI */, QStringList(), true, MetaTranslatorMessage::Unfinished) ); else - tor->insert( MetaTranslatorMessage(context.toAscii(), + tor->insert( MetaTranslatorMessage(context.toUtf8(), ContextComment, - accum.toAscii(), QString(), 0, + accum.toUtf8(), QString(), 0, QStringList(), false, MetaTranslatorMessage::Unfinished) ); } @@ -182,8 +182,8 @@ bool TsHandler::endElement( const QString& /* namespaceURI */, comment.toUtf8(), m_fileName, m_lineNumber, translations, true, type, m_isPlural) ); else - tor->insert( MetaTranslatorMessage(context.toAscii(), source.toAscii(), - comment.toAscii(), m_fileName, m_lineNumber, + tor->insert( MetaTranslatorMessage(context.toUtf8(), source.toUtf8(), + comment.toUtf8(), m_fileName, m_lineNumber, translations, false, type, m_isPlural) ); inMessage = false; } diff --git a/pylupdate/translator.h b/pylupdate/translator.h index 8b26941..89e684e 100644 --- a/pylupdate/translator.h +++ b/pylupdate/translator.h @@ -179,7 +179,7 @@ static const QLocale::Language japaneseStyleLanguages[] = { QLocale::Bislama, QLocale::Burmese, QLocale::Chinese, - QLocale::FijiLanguage, + QLocale::Fijian, QLocale::Guarani, QLocale::Hungarian, QLocale::Indonesian, @@ -246,7 +246,7 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Kirghiz, QLocale::Kurdish, QLocale::Kurundi, - QLocale::Laothian, + QLocale::Lao, QLocale::Latin, // Missing: Letzeburgesch, QLocale::Lingala, @@ -256,9 +256,9 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Mongolian, // Missing: Nahuatl, QLocale::Nepali, - // Missing: Northern Sotho, + QLocale::NorthernSotho, QLocale::Norwegian, - QLocale::Nynorsk, + QLocale::NorwegianNynorsk, QLocale::Occitan, QLocale::Oriya, QLocale::Pashto, @@ -266,12 +266,12 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Punjabi, QLocale::Quechua, QLocale::RhaetoRomance, - QLocale::Sesotho, - QLocale::Setswana, + QLocale::SouthernSotho, + QLocale::Tswana, QLocale::Shona, QLocale::Sindhi, - QLocale::Singhalese, - QLocale::Siswati, + QLocale::Sinhala, + QLocale::Swati, QLocale::Somali, QLocale::Spanish, QLocale::Swahili, @@ -281,7 +281,7 @@ static const QLocale::Language englishStyleLanguages[] = { QLocale::Tamil, QLocale::Tatar, QLocale::Telugu, - QLocale::TongaLanguage, + QLocale::Tongan, QLocale::Tsonga, QLocale::Turkish, QLocale::Turkmen, diff --git a/pyrcc/CMakeLists.txt b/pyrcc/CMakeLists.txt index c804bd5..85094a5 100644 --- a/pyrcc/CMakeLists.txt +++ b/pyrcc/CMakeLists.txt @@ -1,14 +1,13 @@ +find_package(Qt5Xml) add_executable(pyside-rcc main.cpp rcc.cpp) include_directories(pyside-rcc - ${QT_INCLUDE_DIR} - ${QT_QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR}) + ${Qt5Xml_INCLUDE_DIRS} + ${Qt5Core_INCLUDE_DIRS}) target_link_libraries(pyside-rcc - ${QT_QTCORE_LIBRARY} - ${QT_QTXML_LIBRARY}) + ${Qt5Core_LIBRARIES} + ${Qt5Xml_LIBRARIES}) install(TARGETS pyside-rcc RUNTIME DESTINATION bin) |