Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[qt] dropping qt4 support
Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
  • Loading branch information
Denis Zalevskiy committed Jul 24, 2013
1 parent a0157e4 commit 67d8aa0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 134 deletions.
47 changes: 36 additions & 11 deletions examples/ShowContextKitProperty.qml
@@ -1,20 +1,45 @@
import Qt 4.7
import QtQuick 1.1
import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Silica.theme 1.0
import org.freedesktop.contextkit 1.0

Rectangle {
color: "navy"
width: 320
height: 200
width: 480
height: 480

ContextProperty {
key: "Battery.ChargePercentage"
id: percentage
value: 0 // default
Column {
width: parent.width
Repeater {
model : ["Battery.ChargePercentage"
, "Battery.IsCharging"
, "Battery.OnBattery"
, "Battery.TimeUntilFull"
, "Battery.TimeUntilLow"
, "Bluetooth.Enabled"
, "Bluetooth.Connected"
, "Bluetooth.Visible"
, "System.OfflineMode"
]
Row {
spacing: 10
ContextProperty {
key: modelData
id: src
value: ""
onValueChanged: console.log(key + "->" + value + "/" + typeof(value))
}
Label {
color: Theme.highlightColor
text: src.key
}

Label {
text: src.value
}
}
}

Text {
anchors { centerIn: parent }
text: "Battery level: " + percentage.value + "%"
}

}
34 changes: 0 additions & 34 deletions rpm/nemo-qml-plugin-contextkit.spec

This file was deleted.

48 changes: 2 additions & 46 deletions src/CMakeLists.txt
@@ -1,50 +1,9 @@
set(QMLPKG org/freedesktop/contextkit)

if(${USEQT} STREQUAL "4")

set(NAME contextkit)

find_package(Qt4 4.7.0 REQUIRED)
include(${QT_USE_FILE})
add_definitions(-DQT_SHARED)
include_directories(${QT_INCLUDE_DIR})

find_package(PkgConfig REQUIRED)
pkg_check_modules(STATEFS contextkit-statefs-qt4 REQUIRED)
pkg_check_modules(CONTEXTSUBSCRIBER contextsubscriber-1.0)

include_directories(
${QT_INCLUDE_DIR}
${QT_QTDECLARATIVE_INCLUDE_DIR}
${CONTEXTSUBSCRIBER_INCLUDE_DIRS}
)

link_directories(
${QT_LIBRARY_DIR}
${CONTEXTSUBSCRIBER_LIBRARY_DIRS}
)

#-Wno-psabi is to remove next g++ warning/note:
#the mangling of 'va_list' has changed in GCC 4.4
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -fPIC -W -Wall -Wextra -Werror -Wno-psabi -g -O2")

qt4_wrap_cpp(MOC_SRC plugin.cpp ck_property.hpp)
set(SRC plugin.cpp ck_property.cpp)
add_library(${NAME} MODULE ${SRC} ${MOC_SRC})

target_link_libraries(${NAME}
${QT_QTCORE_LIBRARY}
${QT_DECLARATIVE_LIBRARY}
${STATEFS_LIBRARIES}
)

install(TARGETS ${NAME} DESTINATION lib/qt4/imports/${QMLPKG})
install(FILES qmldir DESTINATION lib/qt4/imports/${QMLPKG})

elseif(${USEQT} STREQUAL "5")

set(NAME contextkit-qt5)
set(CMAKE_AUTOMOC TRUE)

if(Qt5_POSITION_INDEPENDENT_CODE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down Expand Up @@ -77,7 +36,6 @@ set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -fPIC -W -Wall -Wextra -Werror -Wno-psabi -g -O2")

set(SRC plugin-qt5.cpp ck_property.cpp)
qt5_wrap_cpp(MOC_SRC plugin-qt5.hpp ck_property.hpp)
add_library(${NAME} MODULE ${SRC} ${MOC_SRC})

target_link_libraries(${NAME}
Expand All @@ -86,7 +44,5 @@ target_link_libraries(${NAME}
${STATEFS_LIBRARIES}
)

install(PROGRAMS libcontextkit-qt5.so DESTINATION lib/qt5/qml/${QMLPKG} RENAME libcontextkit.so)
install(PROGRAMS libcontextkit.so DESTINATION lib/qt5/qml/${QMLPKG})
install(FILES qmldir DESTINATION lib/qt5/qml/${QMLPKG})

endif(${USEQT} STREQUAL "4")
43 changes: 0 additions & 43 deletions src/plugin.cpp

This file was deleted.

0 comments on commit 67d8aa0

Please sign in to comment.