Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tintou authored Dec 15, 2023
2 parents 4b67aa4 + 79afa4d commit 46e8bdd
Show file tree
Hide file tree
Showing 100 changed files with 3,006 additions and 1,088 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: cpp-linter/[email protected].1
- uses: cpp-linter/[email protected].2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
key: macos-latest-${{ env.CRAFT_TARGET }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/needsinfo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
operations-per-run: 1500
days-before-stale: 28
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
operations-per-run: 1500
days-before-stale: 28
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install Craft Master with Nextcloud Client Deps
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ if(BUILD_CLIENT)
find_package(OpenSSL 1.1 REQUIRED )

find_package(ZLIB REQUIRED)
find_package(SQLite3 3.9.0 REQUIRED)

if(NOT WIN32 AND NOT APPLE)
find_package(PkgConfig REQUIRED)
Expand Down
122 changes: 65 additions & 57 deletions cmake/modules/FindSQLite3.cmake
Original file line number Diff line number Diff line change
@@ -1,60 +1,68 @@
# - Try to find SQLite3
# Once done this will define
#
# SQLITE3_FOUND - system has SQLite3
# SQLITE3_INCLUDE_DIRS - the SQLite3 include directory
# SQLITE3_LIBRARIES - Link these to use SQLite3
# SQLITE3_DEFINITIONS - Compiler switches required for using SQLite3
#
# Copyright (c) 2009-2013 Andreas Schneider <[email protected]>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#


if (UNIX)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_SQLITE3 sqlite3)
endif (PKG_CONFIG_FOUND)
endif (UNIX)

find_path(SQLITE3_INCLUDE_DIR
NAMES
sqlite3.h
PATHS
${_SQLITE3_INCLUDEDIR}
${SQLITE3_INCLUDE_DIRS}
)

find_library(SQLITE3_LIBRARY
NAMES
sqlite3 sqlite3-0
PATHS
${_SQLITE3_LIBDIR}
${SQLITE3_LIBRARIES}
)

set(SQLITE3_INCLUDE_DIRS
${SQLITE3_INCLUDE_DIR}
)

if (SQLITE3_LIBRARY)
set(SQLITE3_LIBRARIES
${SQLITE3_LIBRARIES}
${SQLITE3_LIBRARY}
)
endif (SQLITE3_LIBRARY)

if (SQLite3_FIND_VERSION AND _SQLITE3_VERSION)
set(SQLite3_VERSION _SQLITE3_VERSION)
endif (SQLite3_FIND_VERSION AND _SQLITE3_VERSION)
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLite3 DEFAULT_MSG SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIRS)
#[=======================================================================[.rst:
FindSQLite3
-----------
.. versionadded:: 3.14
Find the SQLite libraries, v3
IMPORTED targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` target:
``SQLite::SQLite3``
Result variables
^^^^^^^^^^^^^^^^
# show the SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES variables only in the advanced view
mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)
This module will set the following variables if found:
``SQLite3_INCLUDE_DIRS``
where to find sqlite3.h, etc.
``SQLite3_LIBRARIES``
the libraries to link against to use SQLite3.
``SQLite3_VERSION``
version of the SQLite3 library found
``SQLite3_FOUND``
TRUE if found
#]=======================================================================]

# Look for the necessary header
find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h)
mark_as_advanced(SQLite3_INCLUDE_DIR)

# Look for the necessary library
find_library(SQLite3_LIBRARY NAMES sqlite3 sqlite)
mark_as_advanced(SQLite3_LIBRARY)

# Extract version information from the header file
if(SQLite3_INCLUDE_DIR)
file(STRINGS ${SQLite3_INCLUDE_DIR}/sqlite3.h _ver_line
REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
LIMIT_COUNT 1)
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
SQLite3_VERSION "${_ver_line}")
unset(_ver_line)
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLite3
REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY
VERSION_VAR SQLite3_VERSION)

# Create the imported target
if(SQLite3_FOUND)
set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR})
set(SQLite3_LIBRARIES ${SQLite3_LIBRARY})
if(NOT TARGET SQLite::SQLite3)
add_library(SQLite::SQLite3 UNKNOWN IMPORTED)
set_target_properties(SQLite::SQLite3 PROPERTIES
IMPORTED_LOCATION "${SQLite3_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}")
endif()
endif()
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ if(WIN32)
elseif(UNIX AND NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now")
elseif(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-ld_classic")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-ld_classic")
endif()

set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/theme CACHE STRING "" FORCE)
Expand Down
6 changes: 1 addition & 5 deletions src/csync/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ include(DefineOptions.cmake)

include(DefineInstallationPaths)

find_package(SQLite3 3.8.0 REQUIRED)

include(ConfigureChecks.cmake)
include(../common/common.cmake)

Expand Down Expand Up @@ -66,9 +64,6 @@ target_include_directories(
PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/std
)

target_include_directories(nextcloud_csync PUBLIC ${SQLITE3_INCLUDE_DIR})
target_link_libraries(nextcloud_csync PUBLIC ${SQLITE3_LIBRARIES})

generate_export_header(nextcloud_csync
EXPORT_MACRO_NAME OCSYNC_EXPORT
EXPORT_FILE_NAME ocsynclib.h
Expand All @@ -84,6 +79,7 @@ if(ZLIB_FOUND)
target_link_libraries(nextcloud_csync PUBLIC ZLIB::ZLIB)
endif(ZLIB_FOUND)

target_link_libraries(nextcloud_csync PRIVATE SQLite::SQLite3)

# For src/common/utility_mac.cpp
if (APPLE)
Expand Down
151 changes: 85 additions & 66 deletions src/gui/tray/TrayFoldersMenuButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import Style 1.0
HeaderButton {
id: root

implicitWidth: contentItem.implicitWidth

signal folderEntryTriggered(string fullFolderPath, bool isGroupFolder)

required property var currentUser
Expand Down Expand Up @@ -55,87 +57,104 @@ HeaderButton {
text: root.userHasGroupFolders ? qsTr("Open local or group folders") : qsTr("Open local folder")
}

Image {
id: folderStateIndicator
visible: root.currentUser.hasLocalFolder
source: root.currentUser.isConnected ? Style.stateOnlineImageSource : Style.stateOfflineImageSource
cache: false

anchors.top: root.verticalCenter
anchors.left: root.horizontalCenter
sourceSize.width: Style.folderStateIndicatorSize
sourceSize.height: Style.folderStateIndicatorSize

Accessible.role: Accessible.Indicator
Accessible.name: root.currentUser.isConnected ? qsTr("Connected") : qsTr("Disconnected")
z: 1

Rectangle {
id: folderStateIndicatorBackground
width: Style.folderStateIndicatorSize + Style.trayFolderStatusIndicatorSizeOffset
height: width
anchors.centerIn: parent
color: Style.currentUserHeaderColor
radius: width * Style.trayFolderStatusIndicatorRadiusFactor
z: -2
}
contentItem: Item {
id: rootContent

Rectangle {
id: folderStateIndicatorBackgroundMouseHover
width: Style.folderStateIndicatorSize + Style.trayFolderStatusIndicatorSizeOffset
height: width
anchors.fill: parent

Item {
id: contentContainer
anchors.centerIn: parent
color: root.hovered ? Style.currentUserHeaderTextColor : "transparent"
opacity: Style.trayFolderStatusIndicatorMouseHoverOpacityFactor
radius: width * Style.trayFolderStatusIndicatorRadiusFactor
z: -1
}
}

RowLayout {
id: openLocalFolderButtonRowLayout
implicitWidth: openLocalFolderButtonCaretIconLoader.active ? openLocalFolderButtonIcon.width + openLocalFolderButtonCaretIconLoader.width : openLocalFolderButtonIcon.width
implicitHeight: openLocalFolderButtonIcon.height

Image {
id: folderStateIndicator
visible: root.currentUser.hasLocalFolder
source: root.currentUser.isConnected ? Style.stateOnlineImageSource : Style.stateOfflineImageSource
cache: false

anchors.bottom: openLocalFolderButtonIcon.bottom
anchors.bottomMargin: Style.trayFoldersMenuButtonStateIndicatorBottomOffset
anchors.right: openLocalFolderButtonIcon.right
sourceSize.width: Style.folderStateIndicatorSize
sourceSize.height: Style.folderStateIndicatorSize

Accessible.role: Accessible.Indicator
Accessible.name: root.currentUser.isConnected ? qsTr("Connected") : qsTr("Disconnected")
z: 1

Rectangle {
id: folderStateIndicatorBackground
width: Style.folderStateIndicatorSize + Style.trayFolderStatusIndicatorSizeOffset
height: width
anchors.centerIn: parent
color: Style.currentUserHeaderColor
radius: width * Style.trayFolderStatusIndicatorRadiusFactor
z: -2
}

anchors.fill: parent
spacing: 0
Rectangle {
id: folderStateIndicatorBackgroundMouseHover
width: Style.folderStateIndicatorSize + Style.trayFolderStatusIndicatorSizeOffset
height: width
anchors.centerIn: parent
color: root.hovered ? Style.currentUserHeaderTextColor : "transparent"
opacity: Style.trayFolderStatusIndicatorMouseHoverOpacityFactor
radius: width * Style.trayFolderStatusIndicatorRadiusFactor
z: -1
}
}

Image {
id: openLocalFolderButtonIcon

Image {
id: openLocalFolderButtonIcon
cache: true
source: "image://svgimage-custom-color/folder.svg/" + Style.currentUserHeaderTextColor
property int imageWidth: rootContent.width * Style.trayFoldersMenuButtonMainIconSizeFraction
property int imageHeight: rootContent.width * Style.trayFoldersMenuButtonMainIconSizeFraction

sourceSize {
width: Style.headerButtonIconSize
height: Style.headerButtonIconSize
cache: true

source: "image://svgimage-custom-color/folder.svg/" + Style.currentUserHeaderTextColor
sourceSize {
width: imageWidth
height: imageHeight
}

width: imageWidth
height: imageHeight

anchors.verticalCenter: parent
}

verticalAlignment: Qt.AlignCenter

Accessible.role: Accessible.Graphic
Accessible.name: qsTr("Group folder button")
Layout.leftMargin: Style.trayHorizontalMargin
}
Loader {
id: openLocalFolderButtonCaretIconLoader

Loader {
id: openLocalFolderButtonCaretIconLoader
active: root.userHasGroupFolders
visible: active

active: root.userHasGroupFolders
visible: active
anchors.left: openLocalFolderButtonIcon.right
anchors.verticalCenter: openLocalFolderButtonIcon.verticalCenter

sourceComponent: ColorOverlay {
width: source.width
height: source.height
cached: true
color: Style.currentUserHeaderTextColor
source: Image {
source: "image://svgimage-custom-color/caret-down.svg/" + Style.currentUserHeaderTextColor
sourceSize.width: Style.accountDropDownCaretSize
sourceSize.height: Style.accountDropDownCaretSize
property int imageWidth: rootContent.width * Style.trayFoldersMenuButtonDropDownCaretIconSizeFraction
property int imageHeight: rootContent.width * Style.trayFoldersMenuButtonDropDownCaretIconSizeFraction

verticalAlignment: Qt.AlignCenter
sourceComponent: Image {
id: openLocalFolderButtonCaretIcon

Layout.alignment: Qt.AlignRight
Layout.margins: Style.accountDropDownCaretMargin
cache: true

source: "image://svgimage-custom-color/caret-down.svg/" + Style.currentUserHeaderTextColor
sourceSize: {
width: openLocalFolderButtonCaretIconLoader.imageWidth
height: openLocalFolderButtonCaretIconLoader.imageHeight
}
}

width: openLocalFolderButtonCaretIconLoader.imageWidth
height: openLocalFolderButtonCaretIconLoader.imageHeight

}
}
}
Expand Down
Loading

0 comments on commit 46e8bdd

Please sign in to comment.