1
0
forked from blue/squawk

a bit of polish

This commit is contained in:
Blue 2022-01-11 23:50:42 +03:00
parent 4d3ba6b11f
commit 296328f12d
Signed by untrusted user: blue
GPG Key ID: 9B203B252A63EE38
4 changed files with 22 additions and 16 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.4) 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 CMP0076 NEW)
cmake_policy(SET CMP0079 NEW) cmake_policy(SET CMP0079 NEW)
@ -32,6 +32,7 @@ option(WITH_KIO "Build KIO support module" ON)
# Dependencies # Dependencies
## Qt ## Qt
set(QT_VERSION_MAJOR 5)
find_package(Qt5 COMPONENTS Widgets DBus Gui Xml Network Core REQUIRED) find_package(Qt5 COMPONENTS Widgets DBus Gui Xml Network Core REQUIRED)
find_package(Boost COMPONENTS) find_package(Boost COMPONENTS)
@ -114,12 +115,18 @@ endif ()
message("Build type: ${CMAKE_BUILD_TYPE}") message("Build type: ${CMAKE_BUILD_TYPE}")
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
target_compile_options(squawk PRIVATE set (COMPILE_OPTIONS -fno-sized-deallocation) # for eliminating _ZdlPvm
"-Wall;-Wextra" if (CMAKE_BUILD_TYPE STREQUAL "Release")
"$<$<CONFIG:DEBUG>:-g>" list(APPEND COMPILE_OPTIONS -O3)
"$<$<CONFIG:RELEASE>:-O3>" endif()
"-fno-sized-deallocation" # for eliminating _ZdlPvm 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) endif(CMAKE_COMPILER_IS_GNUCXX)
add_subdirectory(core) add_subdirectory(core)

View File

@ -10,11 +10,12 @@
- QT 5.12 *(lower versions might work but it wasn't tested)* - QT 5.12 *(lower versions might work but it wasn't tested)*
- lmdb - lmdb
- CMake 3.3 or higher - CMake 3.4 or higher
- qxmpp 1.1.0 or higher - qxmpp 1.1.0 or higher
- KDE Frameworks: kwallet (optional) - KDE Frameworks: kwallet (optional)
- KDE Frameworks: KIO (optional) - KDE Frameworks: KIO (optional)
- Boost - Boost (just one little hpp from there)
- Imagemagick (for compilation, to rasterize an SVG logo)
### Getting ### Getting

View File

@ -7,8 +7,8 @@ arch=('i686' 'x86_64')
url="https://git.macaw.me/blue/squawk" url="https://git.macaw.me/blue/squawk"
license=('GPL3') license=('GPL3')
depends=('hicolor-icon-theme' 'desktop-file-utils' 'lmdb' 'qxmpp>=1.1.0') depends=('hicolor-icon-theme' 'desktop-file-utils' 'lmdb' 'qxmpp>=1.1.0')
makedepends=('cmake>=3.3' 'imagemagick' 'qt5-tools') makedepends=('cmake>=3.3' 'imagemagick' 'qt5-tools' 'boost')
optdepends=('kwallet: secure password storage (requires rebuild)') optdepends=('kwallet: secure password storage (requires rebuild)' 'kio: better show in folder action (requires rebuild)')
source=("$pkgname-$pkgver.tar.gz") source=("$pkgname-$pkgver.tar.gz")
sha256sums=('8e93d3dbe1fc35cfecb7783af409c6a264244d11609b2241d4fe77d43d068419') sha256sums=('8e93d3dbe1fc35cfecb7783af409c6a264244d11609b2241d4fe77d43d068419')

View File

@ -255,7 +255,6 @@ void FeedView::updateGeometries()
bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewItem& option, const QAbstractItemModel* m, uint32_t totalHeight) bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewItem& option, const QAbstractItemModel* m, uint32_t totalHeight)
{ {
uint32_t previousOffset = elementMargin; uint32_t previousOffset = elementMargin;
bool success = true;
QDateTime lastDate; QDateTime lastDate;
for (int i = 0, size = m->rowCount(); i < size; ++i) { for (int i = 0, size = m->rowCount(); i < size; ++i) {
QModelIndex index = m->index(i, 0, rootIndex()); QModelIndex index = m->index(i, 0, rootIndex());
@ -271,8 +270,7 @@ bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewIt
QSize messageSize = itemDelegate(index)->sizeHint(option, index); QSize messageSize = itemDelegate(index)->sizeHint(option, index);
if (previousOffset + messageSize.height() + elementMargin > totalHeight) { if (previousOffset + messageSize.height() + elementMargin > totalHeight) {
success = false; return false;
break;
} }
uint32_t offsetX(0); uint32_t offsetX(0);
@ -295,10 +293,10 @@ bool FeedView::tryToCalculateGeometriesWithNoScrollbars(const QStyleOptionViewIt
previousOffset += dateDeviderMargin * 2 + dividerMetrics.height(); previousOffset += dateDeviderMargin * 2 + dividerMetrics.height();
if (previousOffset > totalHeight) { if (previousOffset > totalHeight) {
success = false; return false;
} }
return success; return true;
} }