Make it possible to disable the build of okularkirigami

Summary:
Some distros seem to have the option.

BUG: 393119

Test Plan: Still builds, can disable build

Reviewers: #okular, mart, aacid, lbeltrame

Tags: #okular

Differential Revision: https://phabricator.kde.org/D12352
remotes/offline-stg/wilder
Aleix Pol 8 years ago
parent 33a2eaf3c4
commit 1fb77446a7
  1. 5
      CMakeLists.txt
  2. 35
      mobile/app/package/contents/ui/Documents.qml

@ -124,7 +124,10 @@ add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${PHONON_INCLUDES} core/synctex ${ZLIB_INCLUDE_DIR} ${CMAKE_BINARY_DIR}/core)
add_subdirectory( mobile )
option(BUILD_OKULARKIRIGAMI "Builds the touch-friendly frontend" ON)
if (BUILD_OKULARKIRIGAMI)
add_subdirectory( mobile )
endif()
option(BUILD_COVERAGE "Build the project with gcov support" OFF)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

@ -18,10 +18,13 @@
*/
import QtQuick 2.1
import QtQuick.Dialogs 1.3
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.0 as QQC2
import org.kde.kirigami 2.0 as Kirigami
import Qt.labs.folderlistmodel 2.1
import Qt.labs.platform 1.0
Item {
id: root
@ -43,17 +46,24 @@ Item {
}
}
Kirigami.Label {
ColumnLayout {
z: 2
visible: filesView.count == 0
anchors {
fill: parent
margins: Kirigami.Units.gridUnit
}
text: i18n("No Documents found. To start to read, put some files in the Documents folder of your device.")
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Kirigami.Label {
text: i18n("No Documents found. To start to read, put some files in the Documents folder of your device.")
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
Button {
text: i18n("Open")
// FileDialog {}
// onClicked:
}
}
ScrollView {
@ -67,11 +77,17 @@ Item {
id: filesView
anchors.fill: parent
header: Kirigami.Label {
Layout.fillWidth: true
text: folderModel.folder
}
model: FolderListModel {
id: folderModel
folder: userPaths.documents
folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
nameFilters: ["*.pdf", "*.txt", "*.chm", "*.epub"]
showDirs: false
showDotAndDotDot: true
// showDirs: false
}
delegate: Kirigami.BasicListItem {
@ -79,6 +95,11 @@ Item {
visible: model.fileName.indexOf(searchField.text) !== -1
height: visible ? implicitHeight : 0
onClicked: {
if (fileIsDir) {
ListView.view.model.folder = fileURL
return;
}
documentItem.path = model.filePath;
globalDrawer.close();
applicationWindow().controlsVisible = false;

Loading…
Cancel
Save