Skip to content

Commit

Permalink
New upstream version 1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fvcr committed Jan 17, 2023
1 parent 50d8f59 commit fb392e1
Show file tree
Hide file tree
Showing 39 changed files with 1,545 additions and 327 deletions.
73 changes: 28 additions & 45 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
---
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: None
AlignEscapedNewlines: Right
Standard: Auto
IndentWidth: 4
TabWidth: 4
UseTab: Never
MaxEmptyLinesToKeep: 4
ColumnLimit: 160
DeriveLineEnding: true
SortIncludes: Never
SortUsingDeclarations: false
NamespaceIndentation: All
FixNamespaceComments: false
PointerAlignment: Left
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: false
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
Expand All @@ -18,55 +30,31 @@ AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BreakAfterJavaFieldAnnotations: false
BreakBeforeBinaryOperators: None
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakConstructorInitializersBeforeComma: true
BreakInheritanceList: BeforeColon
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
BreakStringLiterals: false
ColumnLimit: 160
BreakBeforeConceptDeclarations: Always
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
PackConstructorInitializers: Never
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
FixNamespaceComments: false
IndentAccessModifiers: true
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 18
PenaltyBreakComment: 226
PenaltyBreakFirstLessLess: 183
PenaltyBreakString: 540
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1145584
PenaltyReturnTypeOnItsOwnLine: 58
PointerAlignment: Left
ReflowComments: false
SortIncludes: Never
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
Expand All @@ -77,15 +65,10 @@ SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseCRLF: false
UseTab: Never
...
53 changes: 49 additions & 4 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,51 @@
---
Checks: '-*,clang-diagnostic-*,bugprone-*,cert-*,misc-*,modernize-*,performance-*,readability-*,hicpp-exception-baseclass,hicpp-avoid-goto,-clang-diagnostic-address-of-packed-member,-cert-dcl16-c,-cert-dcl21-cpp,-cert-err58-cpp,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-modernize-avoid-c-arrays,-modernize-concat-nested-namespaces,-modernize-raw-string-literal,-modernize-use-default-member-init,-modernize-use-nodiscard,-modernize-use-override,-modernize-use-trailing-return-type,-readability-else-after-return,-readability-identifier-naming,-readability-implicit-bool-cast,-readability-implicit-bool-conversion,-readability-magic-numbers,-readability-named-parameter,-readability-qualified-auto,-readability-redundant-access-specifiers,-readability-redundant-member-init,-readability-uppercase-literal-suffix'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
FormatStyle: none
Checks: >-
-*,
clang-diagnostic-*,
bugprone-*,
cert-*,
misc-*,
modernize-*,
performance-*,
readability-*,
android-cloexec-*,
cppcoreguidelines-avoid-const-or-ref-data-members,
cppcoreguidelines-avoid-goto,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-macro-usage,
cppcoreguidelines-narrowing-conversions,
cppcoreguidelines-slicing,
cppcoreguidelines-virtual-class-destructor,
hicpp-exception-baseclass,
-clang-diagnostic-address-of-packed-member,
-bugprone-easily-swappable-parameters,
-bugprone-reserved-identifier,
-cert-dcl16-c,
-cert-dcl37-c,
-cert-dcl51-cpp,
-cert-env33-c,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-raw-string-literal,
-modernize-replace-disallow-copy-and-assign-macro,
-modernize-replace-random-shuffle,
-modernize-use-default-member-init,
-modernize-use-nodiscard,
-modernize-use-override,
-modernize-use-trailing-return-type,
-readability-const-return-type,
-readability-else-after-return,
-readability-identifier-length,
-readability-identifier-naming,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-named-parameter,
-readability-qualified-auto,
-readability-redundant-access-specifiers,
-readability-redundant-member-init,
-readability-static-accessed-through-instance
WarningsAsErrors: ''
HeaderFilterRegex: '.*'
...
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install Dependencies
run: |
sudo apt update
sudo apt -y install build-essential libgtkmm-3.0-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev
sudo apt -y install build-essential intltool libgtkmm-3.0-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev
- name: Configure
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ master ]

jobs:
build:
install:
runs-on: ubuntu-latest

steps:
Expand All @@ -17,7 +17,7 @@ jobs:
- name: Install Dependencies
run: |
sudo apt update
sudo apt -y install build-essential libgtkmm-3.0-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev
sudo apt -y install build-essential intltool libgtkmm-3.0-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev
- name: Configure
run: mkdir build
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Linter

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
linter:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Lint clang-format
uses: DoozyX/[email protected]
with:
source: './src'
extensions: 'hpp,cpp'
clangFormatVersion: 15
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ release ]

jobs:
build:
release:
runs-on: ubuntu-latest

steps:
Expand All @@ -14,8 +14,8 @@ jobs:

- name: Install Dependencies
run: |
sudo apt update && sudo apt upgrade
sudo apt -y install build-essential cmake pkg-config libgtkmm-3.0-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev debhelper zsync squashfs-tools
sudo apt update
sudo apt -y install build-essential intltool cmake pkg-config libgtkmm-3.0-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev debhelper zsync squashfs-tools
- name: Build & Install
run: |
Expand Down Expand Up @@ -66,6 +66,7 @@ jobs:
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
onlyLastTag: true
stripGeneratorNotice: true

- name: Create Release
Expand Down
77 changes: 49 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
cmake_minimum_required(VERSION 3.12)
project(
whatsapp-for-linux
VERSION 1.4.7
DESCRIPTION "An unofficial WhatsApp desktop application for Linux"
HOMEPAGE_URL "https://github.com/eneshecan/whatsapp-for-linux"
LANGUAGES C CXX)
whatsapp-for-linux
VERSION 1.5.1
DESCRIPTION "An unofficial WhatsApp desktop application for Linux"
HOMEPAGE_URL "https://github.com/eneshecan/whatsapp-for-linux"
LANGUAGES C CXX
)

include(GNUInstallDirs)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -16,41 +19,59 @@ set(WFL_VERSION ${CMAKE_PROJECT_VERSION})
string(TIMESTAMP WFL_BUILD_DATE "%Y-%m-%d")
set(WFL_APP_ID "com.github.eneshecan.WhatsAppForLinux")
set(WFL_ICON ${WFL_APP_ID})

include(GNUInstallDirs)
set(GETTEXT_PACKAGE ${WFL_NAME})
set(WFL_LOCALEDIR "${CMAKE_INSTALL_FULL_LOCALEDIR}")

message(STATUS "${CMAKE_PROJECT_NAME} version: ${WFL_VERSION}")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated/VERSION" ${WFL_VERSION})
configure_file(${CMAKE_SOURCE_DIR}/src/Config.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/generated/Config.hpp)
configure_file(${CMAKE_SOURCE_DIR}/resource/desktop/${WFL_APP_ID}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/generated/${WFL_APP_ID}.desktop)
configure_file(${CMAKE_SOURCE_DIR}/resource/desktop/${WFL_APP_ID}.appdata.xml.in ${CMAKE_CURRENT_BINARY_DIR}/generated/${WFL_APP_ID}.appdata.xml)

message(STATUS "Compiling UI resources")
execute_process(
COMMAND glib-compile-resources --target=${CMAKE_CURRENT_BINARY_DIR}/generated/Resources.c --generate-source gresource.xml
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/resource
)

FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTKMM gtkmm-3.0 REQUIRED)
PKG_CHECK_MODULES(WEBKIT webkit2gtk-4.0 REQUIRED)
PKG_CHECK_MODULES(APPINDICATOR ayatana-appindicator3-0.1 REQUIRED)
include_directories(${GTKMM_INCLUDE_DIRS} ${WEBKIT_INCLUDE_DIRS} ${APPINDICATOR_INCLUDE_DIRS})
COMMAND glib-compile-resources --target=${CMAKE_CURRENT_BINARY_DIR}/generated/Resources.c --generate-source gresource.xml
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/resource
)

find_package(PkgConfig REQUIRED)

find_package(Intl REQUIRED)
find_package(Gettext REQUIRED)
include_directories(${Intl_INCLUDE_DIRS})
link_directories(${INTL_LIBRARY_DIRS})

pkg_check_modules(GTKMM gtkmm-3.0 REQUIRED)
include_directories(${GTKMM_INCLUDE_DIRS})

pkg_check_modules(WEBKIT webkit2gtk-4.0)
if (NOT WEBKIT_FOUND)
pkg_check_modules(WEBKIT webkit2gtk-4.1 REQUIRED)
endif()
include_directories(${WEBKIT_INCLUDE_DIRS})

pkg_check_modules(APPINDICATOR ayatana-appindicator3-0.1 REQUIRED)
include_directories(${APPINDICATOR_INCLUDE_DIRS})

include_directories(${CMAKE_CURRENT_BINARY_DIR}/generated/)

add_executable(${CMAKE_PROJECT_NAME}
src/main.cpp
${CMAKE_CURRENT_BINARY_DIR}/generated/Resources.c
src/util/Helper.cpp
src/util/Settings.cpp
src/ui/Application.cpp
src/ui/MainWindow.cpp
src/ui/PreferencesWindow.cpp
src/ui/PhoneNumberDialog.cpp
src/ui/TrayIcon.cpp
src/ui/WebView.cpp
)
target_link_libraries(${CMAKE_PROJECT_NAME} ${GTKMM_LIBRARIES} ${WEBKIT_LIBRARIES} ${APPINDICATOR_LIBRARIES})
src/main.cpp
${CMAKE_CURRENT_BINARY_DIR}/generated/Resources.c
src/util/Helper.cpp
src/util/Settings.cpp
src/ui/Application.cpp
src/ui/MainWindow.cpp
src/ui/PreferencesWindow.cpp
src/ui/PhoneNumberDialog.cpp
src/ui/TrayIcon.cpp
src/ui/WebView.cpp
)
target_link_libraries(${CMAKE_PROJECT_NAME} ${GTKMM_LIBRARIES} ${WEBKIT_LIBRARIES} ${APPINDICATOR_LIBRARIES} ${Intl_LIBRARIES})

install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/generated/${WFL_APP_ID}.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/generated/${WFL_APP_ID}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/resource/image/icons DESTINATION ${CMAKE_INSTALL_DATADIR})

add_subdirectory(po)
2 changes: 1 addition & 1 deletion .github/contributing.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ We are really happy you're reading this, because we need volunteers to help this
## Code

You can contribute by opening issues, resolving any issue especially [good first issues](https://github.com/eneshecan/whatsapp-for-linux/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22),
improving documentation etc.
improving documentation, adding [translations](https://github.com/eneshecan/whatsapp-for-linux/wiki#translations) in your language etc.

### Submitting changes

Expand Down
Loading

0 comments on commit fb392e1

Please sign in to comment.