Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

[PREVIEW] When loading from the database, initialize everything right in the constructor #3928

Open
wants to merge 17 commits into
base: kingfisher/master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
security default-keychain -s ~/Library/Keychains/build.keychain

# Mac Developer Certificate
base64 -D <<< "${{ secrets.CERT_MACOS_DEVELOPMENT }}" > Bundle_cert_macos_development.p12
security import ./Bundle_cert_macos_development.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_DEVELOPMENT_PASSWORD }} -T /usr/bin/codesign
base64 -D <<< "${{ secrets.CERT_MACOS_DEVELOPER }}" > Bundle_cert_macos_developer.p12
security import ./Bundle_cert_macos_developer.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.CERT_MACOS_DEVELOPER_PASSWORD }} -T /usr/bin/codesign

# Application Certificate
base64 -D <<< "${{ secrets.CERT_MACOS_APPLICATION }}" > Bundle_cert_macos_distribution.p12
Expand Down Expand Up @@ -79,9 +79,11 @@ jobs:
fetch-depth: 1
- name: Install dependencies
run: |
sudo apt update
sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 qt5-default libqt5gui5 libqt5webengine5 libqt5webenginecore5 libqt5webenginewidgets5 libqt5printsupport5 libqt5quickwidgets5 libqt5x11extras5 libxss1
sudo apt install patchelf binutils cmake pkg-config qtbase5-dev qtwebengine5-dev libqt5x11extras5-dev qtbase5-private-dev libssl-dev libxss-dev libxmu-dev
# try getting the deps 10 times before solving this right
for i in {1..10}; do
sudo apt update || true
sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 qt5-default libqt5gui5 libqt5webengine5 libqt5webenginecore5 libqt5webenginewidgets5 libqt5printsupport5 libqt5quickwidgets5 libqt5x11extras5 libxss1 patchelf binutils cmake pkg-config qtbase5-dev qtwebengine5-dev libqt5x11extras5-dev qtbase5-private-dev libssl-dev libxss-dev libxmu-dev || true
done
- name: Build the Linux binary
run: |
bash ./dist/linux/package.sh build
Expand All @@ -99,10 +101,11 @@ jobs:
fetch-depth: 1
- name: Install dependencies
run: |
sudo apt update
sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0
sudo apt install patchelf binutils cmake pkg-config libssl-dev libxss-dev libxmu-dev
sudo apt install dbus libfreetype6 fontconfig libx11-6 libx11-xcb1 libgl1-mesa-dev libnss3 libasound2 libxcomposite1 libxcursor1 libxi6 libxtst6 wget
# try getting the deps 10 times before solving this right
for i in {1..10}; do
sudo apt update || true
sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 patchelf binutils cmake pkg-config libssl-dev libxss-dev libxmu-dev dbus libfreetype6 fontconfig libx11-6 libx11-xcb1 libgl1-mesa-dev libnss3 libasound2 libxcomposite1 libxcursor1 libxi6 libxtst6 wget || true
done
- name: Fetch and install binary Qt
run: |
bash ./dist/linux/install-qt.sh 5.12.5
Expand Down Expand Up @@ -131,8 +134,11 @@ jobs:
gpg --import <<< "${{ secrets.CERT_LINUX_DEB64 }}"
- name: Install dependencies
run: |
sudo apt update
sudo apt install devscripts cmake debhelper pkg-config qtbase5-dev qtwebengine5-dev libqt5x11extras5-dev qtbase5-private-dev libssl-dev libxss-dev libxmu-dev
# try getting the deps 10 times before solving this right
for i in {1..10}; do
sudo apt update || true
sudo apt install devscripts cmake debhelper pkg-config qtbase5-dev qtwebengine5-dev libqt5x11extras5-dev qtbase5-private-dev libssl-dev libxss-dev libxmu-dev || true
done
- name: Build a Debian package
run: |
TAG_NAME=$(./dist/get-tag-name.sh)
Expand All @@ -156,13 +162,19 @@ jobs:
fetch-depth: 1
- name: Install Flatpak
run: |
sudo apt update
sudo apt install flatpak flatpak-builder
# try getting the deps 10 times before solving this right
for i in {1..10}; do
sudo apt update || true
sudo apt install flatpak flatpak-builder || true
done
- name: Install Flatpak KDE SDK
run: |
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
sudo flatpak install --system -y flathub org.kde.Platform//5.12
sudo flatpak install --system -y flathub org.kde.Sdk//5.12
# try getting the deps 10 times before solving this right
for i in {1..10}; do
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo || true
sudo flatpak install --system -y flathub org.kde.Platform//5.12 || true
sudo flatpak install --system -y flathub org.kde.Sdk//5.12 || true
done
- name: Build Linux Flatpak package - KDE based
run: |
pushd dist/linux/flatpak
Expand Down
40 changes: 21 additions & 19 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,34 @@ include_directories(
set(LIBRARY_SOURCE_FILES
util/logger.cc
util/memory.cc
util/custom_error_handler.cc
util/rectangle.cc
util/random.cc
util/formatter.cc

model/autotracker.cc
model/base_model.cc
model/client.cc
model/obm_action.cc
model/project.cc
model/settings.cc
model/tag.cc
model/task.cc
model/time_entry.cc
model/timeline_event.cc
model/user.cc
model/workspace.cc

database/database.cc
database/migrations.cc

base_model.cc
batch_update_result.cc
client.cc
idle.cc
analytics.cc
help_article.cc
autotracker.cc
urls.cc
migrations.cc
context.cc
custom_error_handler.cc
database.cc
feedback.cc
formatter.cc
get_focused_window_linux.cc
error.cc
gui.cc
Expand All @@ -58,23 +71,12 @@ set(LIBRARY_SOURCE_FILES
toggl_api.cc
toggl_api_private.cc
model_change.cc
obm_action.cc
platforminfo.cc
project.cc
proxy.cc
random.cc
rectangle.cc
related_data.cc
settings.cc
tag.cc
task.cc
timeline_event.cc
time_entry.cc
timeline_uploader.cc
user.cc
websocket_client.cc
window_change_recorder.cc
workspace.cc
)

# Set up compilation targets
Expand All @@ -84,7 +86,7 @@ add_library(TogglDesktopLibrary SHARED ${LIBRARY_SOURCE_FILES})
target_link_libraries(TogglDesktopLibrary PRIVATE
${JSONCPP_LIBRARIES}
${LUA_LIBRARIES}
PocoCrypto PocoDataSQLite PocoNetSSL
PocoData PocoCrypto PocoDataSQLite PocoNetSSL
)

install(TARGETS TogglDesktopLibrary DESTINATION lib)
4 changes: 2 additions & 2 deletions src/analytics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#include "const.h"
#include "https_client.h"
#include "platforminfo.h"
#include "settings.h"
#include "urls.h"
#include "user.h"
#include "util/logger.h"
#include "model/settings.h"
#include "model/user.h"

namespace toggl {

Expand Down
6 changes: 4 additions & 2 deletions src/analytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
#include <Poco/Task.h>
#include <Poco/TaskManager.h>
#include <Poco/LocalDateTime.h>

#include "proxy.h"
#include "settings.h"
#include "rectangle.h"
#include "util/memory.h"
#include "util/rectangle.h"
#include "model/settings.h"

namespace toggl {

Expand Down
2 changes: 1 addition & 1 deletion src/batch_update_result.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <sstream>
#include <cstring>

#include "base_model.h"
#include "model/base_model.h"

namespace toggl {

Expand Down
23 changes: 12 additions & 11 deletions src/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@

#include <iostream> // NOLINT

#include "autotracker.h"
#include "client.h"
#include "const.h"
#include "database.h"
#include "error.h"
#include "formatter.h"
#include "https_client.h"
#include "obm_action.h"
#include "project.h"
#include "random.h"
#include "settings.h"
#include "task.h"
#include "time_entry.h"
#include "timeline_uploader.h"
#include "urls.h"
#include "window_change_recorder.h"
#include "workspace.h"

#include "util/formatter.h"
#include "util/random.h"
#include "database/database.h"
#include "model/autotracker.h"
#include "model/client.h"
#include "model/obm_action.h"
#include "model/project.h"
#include "model/settings.h"
#include "model/task.h"
#include "model/time_entry.h"
#include "model/workspace.h"

#include <Poco/Crypto/OpenSSLInitializer.h>
#include <Poco/DateTimeFormat.h>
Expand Down
6 changes: 3 additions & 3 deletions src/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
#include <iostream> // NOLINT

#include "analytics.h"
#include "custom_error_handler.h"
#include "feedback.h"
#include "gui.h"
#include "help_article.h"
#include "idle.h"
#include "util/logger.h"
#include "model_change.h"
#include "timeline_event.h"
#include "timeline_notifications.h"
#include "types.h"
#include "websocket_client.h"
#include "util/custom_error_handler.h"
#include "util/logger.h"
#include "model/timeline_event.h"

#include <Poco/Activity.h>
#include <Poco/LocalDateTime.h>
Expand Down
Loading