Commit 65adde82 authored by Anupam Basak's avatar Anupam Basak
Browse files

Merge branch 'development'

parents 09fa4da9 31f07de5
---
# SPDX-License-Identifier: MIT
#
# Copyright (C) 2019 Christoph Cullmann <cullmann@kde.org>
# Copyright (C) 2019 Gernot Gebhard <gebhard@absint.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# SPDX-FileCopyrightText: 2019 Christoph Cullmann <cullmann@kde.org>
# SPDX-FileCopyrightText: 2019 Gernot Gebhard <gebhard@absint.com>
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# SPDX-License-Identifier: MIT
# Style for C++
Language: Cpp
......
......@@ -19,6 +19,8 @@ src/utils/editor/KSyntaxHighlighting/
# src/utils/editor/kquicksyntaxhighlighter/
src/utils/store/attica/
src/utils/syncing/openssl/
src/platforms/android/KI18n/
src/platforms/android/KcoreAddons/
#.*
*.*~
......
QT *= \
core \
QT *= core \
qml \
quick \
gui \
......@@ -14,14 +13,13 @@ DEFINES *= \
#set the version for static builds too
VERSION_MAJOR = 1
VERSION_MINOR = 1
VERSION_BUILD = 1
VERSION_MINOR = 2
VERSION_BUILD = 0
VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR}.$${VERSION_BUILD}
DEFINES += MAUIKIT_VERSION_STRING=\\\"$$VERSION\\\"
#REPO VARIABLES
LUV_REPO = https://github.com/Nitrux/luv-icon-theme
OPENSSL_REPO = https://github.com/mauikit/openssl
......@@ -29,6 +27,16 @@ ATTICA_REPO = https://github.com/mauikit/attica
KQUICKSYNTAXHIGHLIGHTER_REPO = https://github.com/mauikit/kquicksyntaxhighlighter.git
KSYNTAXHIGHLIGHTING_REPO = https://github.com/mauikit/KSyntaxHighlighting.git
KI18N_ANDROID_REPO = https://github.com/mauikit/KI18n-android
KI18N_MACOS_REPO = https://github.com/mauikit/KI18n-macos
KI18N_WINDOWS_REPO = https://github.com/mauikit/KI18n-windows
KCOREADDONS_ANDROID_REPO = https://github.com/mauikit/KCoreAddons-android
KCOREADDONS_MACOS_REPO = https://github.com/mauikit/KCoreAddons-macos
KCOREADDONS_WINDOWS_REPO = https://github.com/mauikit/KCoreAddons-windows
KIO_ANDROID_REPO = https://github.com/mauikit/KIO-android
#ANDROID FILES VALUES
ANDROID_FILES_DIR = $$_PRO_FILE_PWD_/android_files
ANDROID_FILES_MANIFEST = $$_PRO_FILE_PWD_/android_files/AndroidManifest.xml
......@@ -45,7 +53,6 @@ linux:unix:!android {
message(Building Maui helpers for Android or Windows or Mac or iOS)
android {
include($$PWD/src/android/android.pri)
contains(DEFINES, ANDROID_OPENSSL):{
exists($$PWD/src/utils/syncing/openssl/openssl.pri) {
......@@ -57,16 +64,15 @@ linux:unix:!android {
include($$PWD/src/utils/syncing/openssl/openssl.pri)
}
}
include($$PWD/src/platforms/android/android.pri)
}else:win32 {
message("Using OpenSSL for Windows")
LIBS += -L$$PWD/../../../../../../Qt/Tools/OpenSSL/Win_x64/lib/ -llibssl
LIBS += -L$$PWD/../../../../../../Qt/Tools/OpenSSL/Win_x64/lib/ -llibcrypto
include($$PWD/src/platforms/windows/windows.pri)
}else:macos {
message("Setting up components for Mac")
include($$PWD/src/macos/macos.pri)
include($$PWD/src/platforms/macos/macos.pri)
}else:ios {
message("Setting up components for iOS")
}
contains(DEFINES, COMPONENT_EDITOR):{
......@@ -115,11 +121,10 @@ contains(DEFINES, COMPONENT_EDITOR):{
$$PWD/src/utils/editor/documenthandler.h
SOURCES += \
$$PWD/src/utils//editor/documenthandler.cpp
$$PWD/src/utils/editor/documenthandler.cpp
INCLUDEPATH += $$PWD/src/utils/editor
} else {
warning("SKIPPING EDITOR COMPONENT")
}
......@@ -161,14 +166,14 @@ contains(DEFINES, COMPONENT_ACCOUNTS):{
QT *= sql
HEADERS += \
$$PWD/src/utils/accounts/mauiaccounts.h \
$$PWD/src/utils/accounts/accountsdb.h \
$$PWD/src/utils/accounts/accountsdb.h
SOURCES += \
$$PWD/src/utils/accounts/mauiaccounts.cpp\
$$PWD/src/utils/accounts/accountsdb.cpp
RESOURCES += $$PWD/src/utils/accounts/accounts.qrc
DISTFILES += $$PWD//src/utils/accounts/script.sql
DISTFILES += $$PWD/src/utils/accounts/script.sql
INCLUDEPATH += $$PWD/src/utils/accounts
DEPENDPATH += $$PWD/src/utils/accounts
......@@ -180,20 +185,24 @@ contains(DEFINES, COMPONENT_ACCOUNTS):{
contains(DEFINES, COMPONENT_FM):{
message("INCLUDING FM COMPONENT")
HEADERS += \
$$PWD/src/fm/fm.h \
$$PWD/src/fm/fmlist.h \
$$PWD/src/fm/placeslist.h \
$$PWD/src/fm/downloader.h
$$PWD/src/utils/fm/fm.h \
$$PWD/src/utils/fm/fmlist.h \
$$PWD/src/utils/fm/placeslist.h \
$$PWD/src/utils/fm/downloader.h \
$$PWD/src/utils/fm/fileloader.h \
$$PWD/src/utils/fm/thumbnailer.h
SOURCES += \
$$PWD/src/fm/fm.cpp \
$$PWD/src/fm/fmlist.cpp \
$$PWD/src/fm/placeslist.cpp \
$$PWD/src/fm/downloader.cpp
INCLUDEPATH += $$PWD/src/fm
DEPENDPATH += $$PWD/src/fm
$$PWD/src/utils/fm/fm.cpp \
$$PWD/src/utils/fm/fmlist.cpp \
$$PWD/src/utils/fm/placeslist.cpp \
$$PWD/src/utils/fm/downloader.cpp \
$$PWD/src/utils/fm/fileloader.cpp \
$$PWD/src/utils/fm/thumbnailer.cpp
INCLUDEPATH += $$PWD/src/utils/fm
DEPENDPATH += $$PWD/src/utils/fm
} else {
warning("SKIPPING FM COMPONENT")
}
......@@ -210,32 +219,41 @@ HEADERS += \
$$PWD/src/utils/model_template/mauilist.h \
$$PWD/src/utils/handy.h \
$$PWD/src/utils/utils.h \
$$PWD/src/utils/appsettings.h \
$$PWD/src/utils/mauiapp.h \
$$PWD/src/utils/models/pathlist.h \
$$PWD/src/controls/libs/appview.h
$$PWD/src/controls/libs/appview.h \
$$PWD/src/platforms/abstractplatform.h \
$$PWD/src/platforms/platform.h
SOURCES += \
$$PWD/src/utils/fmstatic.cpp \
$$PWD/src/mauikit.cpp \
$$PWD/src/utils/fmh.cpp \
$$PWD/src/utils/model_template/mauimodel.cpp \
$$PWD/src/utils/model_template/mauilist.cpp \
$$PWD/src/utils/handy.cpp \
$$PWD/src/utils/appsettings.cpp \
$$PWD/src/utils/mauiapp.cpp \
$$PWD/src/utils/models/pathlist.cpp
$$PWD/src/utils/models/pathlist.cpp \
$$PWD/src/platforms/abstractplatform.cpp \
$$PWD/src/platforms/platform.cpp
DEPENDPATH += \
$$PWD/src \
$$PWD/src/utils/model_template \
$$PWD/src/controls/libs
$$PWD/src/controls/libs \
$$PWD/src/platforms
INCLUDEPATH += \
$$PWD/src \
$$PWD/src/utils \
$$PWD/src/utils/models \
$$PWD/src/utils/model_template \
$$PWD/src/controls/libs
$$PWD/src/controls/libs \
$$PWD/src/platforms
API_VER = 1.0
API_VER = 1.2
DISTFILES += \
$$PWD/CMakeLists.txt \
......
......@@ -11,23 +11,31 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/controls/libs
${CMAKE_CURRENT_BINARY_DIR}/controls/libs
${CMAKE_CURRENT_SOURCE_DIR}/kde
${CMAKE_CURRENT_BINARY_DIR}/kde
${CMAKE_CURRENT_SOURCE_DIR}/platforms
${CMAKE_CURRENT_BINARY_DIR}/platforms
${CMAKE_CURRENT_SOURCE_DIR}/platforms/linux
${CMAKE_CURRENT_BINARY_DIR}/platforms/linux
)
set(mauikit_SRCS
mauikit.cpp
utils/fmstatic.cpp
utils/appsettings.cpp
utils/fmh.cpp
utils/mauiapp.cpp
utils/handy.cpp
utils/models/pathlist.cpp
utils/model_template/mauilist.cpp
utils/model_template/mauimodel.cpp
platforms/abstractplatform.cpp
platforms/platform.cpp
)
set(mauikit_HDRS
mauikit.h
utils/fmstatic.h
utils/appsettings.h
utils/fmh.h
utils/utils.h
utils/handy.h
......@@ -36,6 +44,8 @@ set(mauikit_HDRS
utils/model_template/mauilist.h
utils/model_template/mauimodel.h
controls/libs/appview.h
platforms/abstractplatform.h
platforms/platform.h
)
if(${COMPONENT_ACCOUNTS})
......@@ -80,21 +90,25 @@ if(${COMPONENT_FM})
message(STATUS "INCLUDING FM COMPONENT")
set(fm_SRCS
fm/fm.cpp
fm/fmlist.cpp
fm/placeslist.cpp
fm/downloader.cpp
utils/fm/fm.cpp
utils/fm/fmlist.cpp
utils/fm/placeslist.cpp
utils/fm/downloader.cpp
utils/fm/fileloader.cpp
utils/fm/thumbnailer.cpp
)
set(fm_HDRS
fm/fm.h
fm/fmlist.h
fm/placeslist.h
fm/downloader.h
utils/fm/fm.h
utils/fm/fmlist.h
utils/fm/placeslist.h
utils/fm/downloader.h
utils/fm/fileloader.h
utils/fm/thumbnailer.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/fm
${CMAKE_CURRENT_BINARY_DIR}/fm
${CMAKE_CURRENT_SOURCE_DIR}/utils/fm
${CMAKE_CURRENT_BINARY_DIR}/utils/fm
)
add_definitions(-DCOMPONENT_FM)
endif()
......@@ -104,7 +118,6 @@ if(${COMPONENT_TAGGING})
set(tagging_SRCS
utils/tagging/tagging.cpp
utils/tagging/tagdb.cpp
utils/tagging/tagsmodel.cpp
utils/tagging/tagslist.cpp
utils/tagging/tagging.qrc
)
......@@ -113,7 +126,6 @@ if(${COMPONENT_TAGGING})
utils/tagging/tag.h
utils/tagging/tagging.h
utils/tagging/tagdb.h
utils/tagging/tagsmodel.h
utils/tagging/tagslist.h
)
include_directories(
......@@ -208,7 +220,7 @@ if (ANDROID)
add_subdirectory(android)
set(mauikit_Android_SRCS
android/mauiandroid.cpp
platforms/android/mauiandroid.cpp
)
kde_enable_exceptions(MauiKit PRIVATE)
......@@ -216,13 +228,13 @@ else()
add_subdirectory(csd/libappletdecoration)
set(mauikit_KDE_SRCS
kde/mauikde.cpp
kde/kdeconnect.cpp
platforms/linux/mauilinux.cpp
platforms/linux/kdeconnect.cpp
)
set(mauikit_KDE_HDRS
kde/mauikde.h
kde/kdeconnect.h
platforms/linux/mauilinux.h
platforms/linux/kdeconnect.h
)
endif()
......@@ -263,9 +275,9 @@ if(ANDROID)
target_link_libraries(MauiKit PRIVATE Qt5::AndroidExtras jnigraphics)
target_include_directories(MauiKit PRIVATE android)
install(FILES android/mauiandroid.h DESTINATION ${KDE_INSTALL_INCLUDEDIR}/MauiKit COMPONENT Devel)
install(FILES platforms/android/mauiandroid.h DESTINATION ${KDE_INSTALL_INCLUDEDIR}/MauiKit COMPONENT Devel)
install(DIRECTORY android/ DESTINATION ${KDE_INSTALL_DATAROOTDIR}/MauiKitAndroid COMPONENT Devel)
install(DIRECTORY platforms/android/ DESTINATION ${KDE_INSTALL_DATAROOTDIR}/MauiKitAndroid COMPONENT Devel)
if (Qt5Core_VERSION VERSION_LESS 5.14.0)
install(FILES MauiKit-android-dependencies.xml DESTINATION ${KDE_INSTALL_LIBDIR})
......
QT *= androidextras xml
HEADERS += \
$$PWD/mauiandroid.h\
SOURCES += \
$$PWD/mauiandroid.cpp \
LIBS += -ljnigraphics
DEPENDPATH += \
$$PWD
INCLUDEPATH += \
$$PWD
#exists($$ANDROID_FILES_DIR) {
# warning("Using application android files at $${ANDROID_FILES_DIR}")
# system(cp -as $$ANDROID_FILES_DIR/. $${PWD}/)
#}else {
# warning("Expected files: $$ANDROID_FILES_MANIFEST, $$ANDROID_FILES_GRADLE, $$ANDROID_FILES_RES_DIR")
# error("The application is missing the android files, this files are supossed to be located at $$ANDROID_FILES_DIR")
#}
RESOURCES += \
$$PWD/android.qrc
#ANDROID_PACKAGE_SOURCE_DIR += $$PWD/
#DISTFILES += \
# $$PWD/AndroidManifest.xml \
# $$PWD/build.gradle \
# $$PWD/res/values/libs.xml
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
}
}
repositories {
google()
jcenter()
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
sourceSets {
main {
manifest.srcFile '@CMAKE_CURRENT_SOURCE_DIR@/AndroidManifest.xml'
java.srcDirs = ['@CMAKE_CURRENT_SOURCE_DIR@/src']
}
}
lintOptions {
abortOnError false
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'com.android.support:support-compat:28.0.0'
}
}
......@@ -17,12 +17,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "private"
import org.kde.mauikit 1.2 as Maui
Drawer
{
......@@ -31,9 +30,9 @@ Drawer
implicitHeight: window().internalHeight
height: implicitHeight
y: (window().header && !window().altHeader ? window().header.height : 0)
// closePolicy: modal || collapsed ? Popup.CloseOnEscape | Popup.CloseOnPressOutside : Popup.NoAutoClose
// closePolicy: modal || collapsed ? Popup.CloseOnEscape | Popup.CloseOnPressOutside : Popup.NoAutoClose
interactive: modal || collapsed || !visible
dragMargin: Maui.Style.space.big
dragMargin: Maui.Style.space.big
modal: false
property bool collapsible: false
property bool collapsed: false
......@@ -42,10 +41,10 @@ Drawer
readonly property alias overlay : _overlay
onCollapsedChanged: position = (collapsed && collapsedSize < 1) ? 0 : 1
default property alias content : _content.data
default property alias content : _content.data
signal contentDropped(var drop)
// background: null
// background: null
MouseArea
{
......@@ -54,7 +53,7 @@ Drawer
anchors.fill: parent
anchors.margins: 0
anchors.leftMargin: (control.width * control.position)
parent: window().contentItem
parent: window().pageContent
preventStealing: true
propagateComposedEvents: false
visible: false
......@@ -71,19 +70,24 @@ Drawer
// if(control.visible && !control.modal)
// control.position = 1
// }
contentItem: Item
contentItem: null
Item
{
id: _content
Kirigami.Separator
{
z: parent.z + 999
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
}
}
id: _content
anchors.fill: parent
Maui.Separator
{
z: 9999
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
position: Qt.Vertical
}
}
Component.onCompleted:
{
if(!control.collapsed && control.visible)
......@@ -98,7 +102,7 @@ Drawer
enabled: control.collapsible && control.position === 1
NumberAnimation
{
duration: Kirigami.Units.longDuration
duration: Kirigami.Units.shortDuration
easing.type: Easing.InOutQuad
}
}
......@@ -114,5 +118,10 @@ Drawer
control.contentDropped(drop)
}
}
background: Rectangle
{
color: Kirigami.Theme.backgroundColor
}
}
......@@ -68,7 +68,6 @@ Maui.SideBar
control.itemRightClicked(index)
}
}
}
}
}
import QtQuick 2.13
import QtQml 2.14
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.3
......@@ -9,7 +10,8 @@ Maui.Page
{
id: control
readonly property alias currentView : viewLoader.item
readonly property Item currentView : control.viewType === AltBrowser.ViewType.List ? _listView : _gridView
enum ViewType
{
Grid,
......@@ -22,85 +24,21 @@ Maui.Page
{
when: control.currentView
value: control.currentView.currentIndex
}
}
property Component listDelegate : null
property Component gridDelegate : null
property var model : null
property bool enableLassoSelection: false
property bool enableLassoSelection: false
property bool selectionMode: false
property alias holder : _holder
readonly property alias gridView : private_.gridView
readonly property alias listView : private_.listView
// readonly property var section : listView.section
readonly property alias gridView : _gridView
readonly property alias listView : _listView
flickable: viewLoader.item ? viewLoader.item.flickable : null
QtObject
{
//before loading the view we use a dummy representation of the possible views, in order to store the properties data. Once the actual view has been loaded then the exposed properties are changed from the dummy representation to the actual view loaded, this allows to preserve and use the bindings for the actual view. The dummy representations are within a private object and exposed as readonly properties to avoid those being changed externally
id: private_
property Maui.GridView gridView : Maui.GridView
{
id: _dummyGridView
}
Binding on gridView
{
delayed: true
value: control.viewType === AltBrowser.ViewType.Grid ? control.currentView : _dummyGridView
}
property Maui.ListBrowser listView : Maui.ListBrowser
{
id: _dummyListBrowser
}
Binding on listView
{
delayed: true
value: control.viewType === AltBrowser.ViewType.List ? control.currentView : _dummyListBrowser
}
}
Loader
{
id: viewLoader
anchors.fill: parent
focus: true
sourceComponent: switch(control.viewType)
{
case AltBrowser.ViewType.Grid: return gridViewComponent
case AltBrowser.ViewType.List: return listViewComponent
}
// onLoaded:
// {
// if(control.currentView)
// {
// switch(control.viewType)
// {
// case AltBrowser.ViewType.Grid:
// {
// private_.gridView = control.currentView
// private_.listView = _dummyListBrowser
//
// break
// }
// case AltBrowser.ViewType.List:
// {
// private_.listView = control.currentView
// private_.gridView = _dummyGridView
// break
// }
// }
// }
// }
}
flickable: control.viewType === AltBrowser.ViewType.List ? _listView.flickable : _gridView.flickable
Maui.Holder
{
......@@ -108,44 +46,29 @@ Maui.Page
anchors.fill: parent
}
Component
Maui.GridView