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)
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"
"$<$<CONFIG:DEBUG>:-g>"
"$<$<CONFIG:RELEASE>:-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)

View File

@ -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

View File

@ -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')

View File

@ -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;
}