From 296328f12dd9296a8a8d092b4fcd6f8332a15403 Mon Sep 17 00:00:00 2001 From: blue Date: Tue, 11 Jan 2022 23:50:42 +0300 Subject: [PATCH] a bit of polish --- CMakeLists.txt | 21 ++++++++++++++------- README.md | 5 +++-- packaging/Archlinux/PKGBUILD | 4 ++-- ui/widgets/messageline/feedview.cpp | 8 +++----- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da89682..b104667 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.4) -project(squawk VERSION 0.1.6 LANGUAGES CXX) +project(squawk VERSION 0.2.0 LANGUAGES CXX) cmake_policy(SET CMP0076 NEW) cmake_policy(SET CMP0079 NEW) @@ -32,6 +32,7 @@ option(WITH_KIO "Build KIO support module" ON) # Dependencies ## Qt +set(QT_VERSION_MAJOR 5) find_package(Qt5 COMPONENTS Widgets DBus Gui Xml Network Core REQUIRED) find_package(Boost COMPONENTS) @@ -114,12 +115,18 @@ endif () message("Build type: ${CMAKE_BUILD_TYPE}") if(CMAKE_COMPILER_IS_GNUCXX) -target_compile_options(squawk PRIVATE - "-Wall;-Wextra" - "$<$:-g>" - "$<$:-O3>" - "-fno-sized-deallocation" # for eliminating _ZdlPvm - ) + set (COMPILE_OPTIONS -fno-sized-deallocation) # for eliminating _ZdlPvm + if (CMAKE_BUILD_TYPE STREQUAL "Release") + list(APPEND COMPILE_OPTIONS -O3) + endif() + if (CMAKE_BUILD_TYPE STREQUAL Debug) + list(APPEND COMPILE_OPTIONS -g) + list(APPEND COMPILE_OPTIONS -Wall) + list(APPEND COMPILE_OPTIONS -Wextra) + endif() + + message("Compilation options: " ${COMPILE_OPTIONS}) + target_compile_options(squawk PRIVATE ${COMPILE_OPTIONS}) endif(CMAKE_COMPILER_IS_GNUCXX) add_subdirectory(core) diff --git a/README.md b/README.md index ff36f3c..0af201f 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,12 @@ - QT 5.12 *(lower versions might work but it wasn't tested)* - lmdb -- CMake 3.3 or higher +- CMake 3.4 or higher - qxmpp 1.1.0 or higher - KDE Frameworks: kwallet (optional) - KDE Frameworks: KIO (optional) -- Boost +- Boost (just one little hpp from there) +- Imagemagick (for compilation, to rasterize an SVG logo) ### Getting diff --git a/packaging/Archlinux/PKGBUILD b/packaging/Archlinux/PKGBUILD index 68e1558..0d2aaaa 100644 --- a/packaging/Archlinux/PKGBUILD +++ b/packaging/Archlinux/PKGBUILD @@ -7,8 +7,8 @@ arch=('i686' 'x86_64') url="https://git.macaw.me/blue/squawk" license=('GPL3') depends=('hicolor-icon-theme' 'desktop-file-utils' 'lmdb' 'qxmpp>=1.1.0') -makedepends=('cmake>=3.3' 'imagemagick' 'qt5-tools') -optdepends=('kwallet: secure password storage (requires rebuild)') +makedepends=('cmake>=3.3' 'imagemagick' 'qt5-tools' 'boost') +optdepends=('kwallet: secure password storage (requires rebuild)' 'kio: better show in folder action (requires rebuild)') source=("$pkgname-$pkgver.tar.gz") sha256sums=('8e93d3dbe1fc35cfecb7783af409c6a264244d11609b2241d4fe77d43d068419') diff --git a/ui/widgets/messageline/feedview.cpp b/ui/widgets/messageline/feedview.cpp index 34f9400..de7f56f 100644 --- a/ui/widgets/messageline/feedview.cpp +++ b/ui/widgets/messageline/feedview.cpp @@ -255,7 +255,6 @@ void FeedView::updateGeometries() bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewItem& option, const QAbstractItemModel* m, uint32_t totalHeight) { uint32_t previousOffset = elementMargin; - bool success = true; QDateTime lastDate; for (int i = 0, size = m->rowCount(); i < size; ++i) { QModelIndex index = m->index(i, 0, rootIndex()); @@ -271,8 +270,7 @@ bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewIt QSize messageSize = itemDelegate(index)->sizeHint(option, index); if (previousOffset + messageSize.height() + elementMargin > totalHeight) { - success = false; - break; + return false; } uint32_t offsetX(0); @@ -295,10 +293,10 @@ bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewIt previousOffset += dateDeviderMargin * 2 + dividerMetrics.height(); if (previousOffset > totalHeight) { - success = false; + return false; } - return success; + return true; }