obconf-qt: update to 0.11.0

This commit is contained in:
Alessio Sergi 2016-09-29 11:57:11 +02:00
parent 12970ba8ed
commit ecee5c3c69
3 changed files with 9 additions and 286 deletions

View file

@ -1,138 +0,0 @@
commit 49a4067c58711130848cf4a30a0c4eedead405ac
Author: Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Date: Sat Jun 21 05:55:22 2014 +0100
Support Qt5.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f32926..3824bd9 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -4,7 +4,23 @@ cmake_minimum_required(VERSION 2.8.6)
find_program(SED_PROGRAM sed)
-find_package(Qt4 REQUIRED QtCore QtGui) # Qt
+# Support Qt5
+option(USE_QT5 "Build with Qt5." $ENV{USE_QT5})
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMAKE_AUTOMOC ON)
+if(USE_QT5)
+ cmake_minimum_required(VERSION 2.8.11)
+ find_package(Qt5Widgets REQUIRED)
+ find_package(Qt5X11Extras REQUIRED)
+ find_package(Qt5LinguistTools REQUIRED QUIET)
+ message(STATUS "Building with Qt${Qt5Core_VERSION_STRING}")
+else()
+ find_package(Qt4 REQUIRED QtCore QtGui) # Qt
+ include(${QT_USE_FILE})
+ message(STATUS "Building with Qt${QTVERSION}")
+endif()
+
find_package(PkgConfig)
pkg_check_modules(GLIB REQUIRED
glib-2.0
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 218b72e..4057097 100644
--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -1,17 +1,21 @@
# set visibility to hidden to hide symbols, unlesss they're exporeted manually in the code
set(CMAKE_CXX_FLAGS "-DQT_NO_KEYWORDS -fno-exceptions")
+if(USE_QT5)
+ set(QTX_INCLUDE_DIRS "")
+ set(QTX_LIBRARIES Qt5::Widgets Qt5::X11Extras)
+else()
+ set(QTX_INCLUDE_DIRS ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTDBUS_DIR})
+ set(QTX_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY})
+endif()
+
include_directories(
- ${QT_INCLUDES}
+ ${QTX_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${OPENBOX_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
-
)
-set(CMAKE_AUTOMOC TRUE)
-
set(obconf-qt_SRCS
obconf-qt.cpp
maindialog.cpp
@@ -32,9 +36,11 @@ set(obconf-qt_UIS
obconf.ui
)
-qt4_wrap_ui(obconf-qt_UI_H
- ${obconf-qt_UIS}
-)
+if(USE_QT5)
+ qt5_wrap_ui(obconf-qt_UI_H ${obconf-qt_UIS})
+else()
+ qt4_wrap_ui(obconf-qt_UI_H ${obconf-qt_UIS})
+endif()
# The ui code generated by Qt uic contains QMetaObject::connectSlotsByName()
# but we don't want that. Fix it with sed.
@@ -51,14 +57,25 @@ add_custom_command(
# add translation for obconf-qt
option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts files")
-if (UPDATE_TRANSLATIONS)
- qt4_create_translation(QM_FILES
- ${obconf-qt_SRCS}
- ${obconf-qt_UI_H}
- ${TS_FILES})
-else (UPDATE_TRANSLATIONS)
- qt4_add_translation(QM_FILES ${TS_FILES})
-endif (UPDATE_TRANSLATIONS)
+if(USE_QT5)
+ if (UPDATE_TRANSLATIONS)
+ qt5_create_translation(QM_FILES
+ ${obconf-qt_SRCS}
+ ${obconf-qt_UI_H}
+ ${TS_FILES})
+ else (UPDATE_TRANSLATIONS)
+ qt5_add_translation(QM_FILES ${TS_FILES})
+ endif (UPDATE_TRANSLATIONS)
+else(USE_QT5) # use qt4
+ if (UPDATE_TRANSLATIONS)
+ qt4_create_translation(QM_FILES
+ ${obconf-qt_SRCS}
+ ${obconf-qt_UI_H}
+ ${TS_FILES})
+ else (UPDATE_TRANSLATIONS)
+ qt4_add_translation(QM_FILES ${TS_FILES})
+ endif (UPDATE_TRANSLATIONS)
+endif(USE_QT5)
add_custom_target (obconf-qt_translations DEPENDS ${QM_FILES})
install(FILES ${QM_FILES} DESTINATION share/obconf-qt/translations)
# prevent the generated files from being deleted during make clean
@@ -78,8 +95,7 @@ add_definitions(
)
target_link_libraries(obconf-qt
- ${QT_QTCORE_LIBRARY}
- ${QT_QTGUI_LIBRARY}
+ ${QTX_LIBRARIES}
${GLIB_LIBRARIES}
${OPENBOX_LIBRARIES}
)
diff --git a/src/appearance.cpp b/src/appearance.cpp
index 316455c..64d1cf3 100644
--- src/appearance.cpp
+++ src/appearance.cpp
@@ -79,7 +79,7 @@ void MainDialog::on_title_layout_textChanged(const QString& text) {
QByteArray layout;
// omit unknown chars
for(int i = 0; i < text.length(); ++i) {
- char ch = text.at(i).toUpper().toAscii();
+ char ch = text.at(i).toUpper().toLatin1();
if(strchr("NDSLIMC", ch))
layout += ch;
}

View file

@ -1,138 +0,0 @@
commit 49a4067c58711130848cf4a30a0c4eedead405ac
Author: Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Date: Sat Jun 21 05:55:22 2014 +0100
Support Qt5.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f32926..3824bd9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,23 @@ cmake_minimum_required(VERSION 2.8.6)
find_program(SED_PROGRAM sed)
-find_package(Qt4 REQUIRED QtCore QtGui) # Qt
+# Support Qt5
+option(USE_QT5 "Build with Qt5." $ENV{USE_QT5})
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMAKE_AUTOMOC ON)
+if(USE_QT5)
+ cmake_minimum_required(VERSION 2.8.11)
+ find_package(Qt5Widgets REQUIRED)
+ find_package(Qt5X11Extras REQUIRED)
+ find_package(Qt5LinguistTools REQUIRED QUIET)
+ message(STATUS "Building with Qt${Qt5Core_VERSION_STRING}")
+else()
+ find_package(Qt4 REQUIRED QtCore QtGui) # Qt
+ include(${QT_USE_FILE})
+ message(STATUS "Building with Qt${QTVERSION}")
+endif()
+
find_package(PkgConfig)
pkg_check_modules(GLIB REQUIRED
glib-2.0
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 218b72e..4057097 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,17 +1,21 @@
# set visibility to hidden to hide symbols, unlesss they're exporeted manually in the code
set(CMAKE_CXX_FLAGS "-DQT_NO_KEYWORDS -fno-exceptions")
+if(USE_QT5)
+ set(QTX_INCLUDE_DIRS "")
+ set(QTX_LIBRARIES Qt5::Widgets Qt5::X11Extras)
+else()
+ set(QTX_INCLUDE_DIRS ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTDBUS_DIR})
+ set(QTX_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY})
+endif()
+
include_directories(
- ${QT_INCLUDES}
+ ${QTX_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${OPENBOX_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
-
)
-set(CMAKE_AUTOMOC TRUE)
-
set(obconf-qt_SRCS
obconf-qt.cpp
maindialog.cpp
@@ -32,9 +36,11 @@ set(obconf-qt_UIS
obconf.ui
)
-qt4_wrap_ui(obconf-qt_UI_H
- ${obconf-qt_UIS}
-)
+if(USE_QT5)
+ qt5_wrap_ui(obconf-qt_UI_H ${obconf-qt_UIS})
+else()
+ qt4_wrap_ui(obconf-qt_UI_H ${obconf-qt_UIS})
+endif()
# The ui code generated by Qt uic contains QMetaObject::connectSlotsByName()
# but we don't want that. Fix it with sed.
@@ -51,14 +57,25 @@ add_custom_command(
# add translation for obconf-qt
option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts files")
-if (UPDATE_TRANSLATIONS)
- qt4_create_translation(QM_FILES
- ${obconf-qt_SRCS}
- ${obconf-qt_UI_H}
- ${TS_FILES})
-else (UPDATE_TRANSLATIONS)
- qt4_add_translation(QM_FILES ${TS_FILES})
-endif (UPDATE_TRANSLATIONS)
+if(USE_QT5)
+ if (UPDATE_TRANSLATIONS)
+ qt5_create_translation(QM_FILES
+ ${obconf-qt_SRCS}
+ ${obconf-qt_UI_H}
+ ${TS_FILES})
+ else (UPDATE_TRANSLATIONS)
+ qt5_add_translation(QM_FILES ${TS_FILES})
+ endif (UPDATE_TRANSLATIONS)
+else(USE_QT5) # use qt4
+ if (UPDATE_TRANSLATIONS)
+ qt4_create_translation(QM_FILES
+ ${obconf-qt_SRCS}
+ ${obconf-qt_UI_H}
+ ${TS_FILES})
+ else (UPDATE_TRANSLATIONS)
+ qt4_add_translation(QM_FILES ${TS_FILES})
+ endif (UPDATE_TRANSLATIONS)
+endif(USE_QT5)
add_custom_target (obconf-qt_translations DEPENDS ${QM_FILES})
install(FILES ${QM_FILES} DESTINATION share/obconf-qt/translations)
# prevent the generated files from being deleted during make clean
@@ -78,8 +95,7 @@ add_definitions(
)
target_link_libraries(obconf-qt
- ${QT_QTCORE_LIBRARY}
- ${QT_QTGUI_LIBRARY}
+ ${QTX_LIBRARIES}
${GLIB_LIBRARIES}
${OPENBOX_LIBRARIES}
)
diff --git a/src/appearance.cpp b/src/appearance.cpp
index 316455c..64d1cf3 100644
--- a/src/appearance.cpp
+++ b/src/appearance.cpp
@@ -79,7 +79,7 @@ void MainDialog::on_title_layout_textChanged(const QString& text) {
QByteArray layout;
// omit unknown chars
for(int i = 0; i < text.length(); ++i) {
- char ch = text.at(i).toUpper().toAscii();
+ char ch = text.at(i).toUpper().toLatin1();
if(strchr("NDSLIMC", ch))
layout += ch;
}

View file

@ -1,16 +1,15 @@
# Template file for 'obconf-qt'
pkgname=obconf-qt
version=0.1.0
revision=2
create_wrksrc=yes
version=0.11.0
revision=1
build_style=cmake
configure_args="-DUSE_QT5=1"
hostmakedepends="cmake pkg-config"
makedepends="qt5-x11extras-devel qt5-tools-devel libSM-devel openbox-devel"
configure_args="-DPULL_TRANSLATIONS=0"
hostmakedepends="pkg-config"
makedepends="qt5-x11extras-devel qt5-tools-devel liblxqt-devel openbox-devel"
depends="desktop-file-utils"
short_desc="LXQT Openbox configuration UI"
short_desc="LXQt Openbox configuration tool"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="LGPL-2.1"
license="GPL-2"
homepage="http://lxqt.org/"
distfiles="http://downloads.lxqt.org/${pkgname}/${version}/${pkgname}-${version}.tar.xz"
checksum=4831bfc06eff0529697a51196c1d7866cb12e3b19a0724e8201dbdfd2bca082b
distfiles="https://github.com/lxde/obconf-qt/releases/download/${version}/obconf-qt-${version}.tar.xz"
checksum=a7fdfa0ce2da8310b6ff5e3c7375efb18a99316335853af2c8624ca2faa13182