diff --git a/.docker/Dockerfile-arch b/.docker/Dockerfile-arch index ca63def..5a52504 100644 --- a/.docker/Dockerfile-arch +++ b/.docker/Dockerfile-arch @@ -1,9 +1,10 @@ -FROM base/archlinux +FROM archlinux RUN pacman -Sy # toolchain -RUN pacman -S --noconfirm base-devel cmake extra-cmake-modules python +RUN echo -e 'y\ny' | pacman -S util-linux-libs +RUN pacman -S --noconfirm base-devel cmake extra-cmake-modules python util-linux-libs # kf5 and qt5 libraries RUN pacman -S --noconfirm plasma-framework diff --git a/.docker/Dockerfile-ubuntu-amd64 b/.docker/Dockerfile-ubuntu-amd64 index 0484b44..4b955a9 100644 --- a/.docker/Dockerfile-ubuntu-amd64 +++ b/.docker/Dockerfile-ubuntu-amd64 @@ -1,4 +1,4 @@ -FROM multiarch/ubuntu-core:amd64-xenial +FROM ubuntu:bionic RUN apt-get update # toolchain diff --git a/.docker/Dockerfile-ubuntu-i386 b/.docker/Dockerfile-ubuntu-i386 index 4fa8923..a88060d 100644 --- a/.docker/Dockerfile-ubuntu-i386 +++ b/.docker/Dockerfile-ubuntu-i386 @@ -1,4 +1,4 @@ -FROM multiarch/ubuntu-core:i386-xenial +FROM multiarch/ubuntu-core:i386-bionic RUN apt-get update # toolchain diff --git a/.docker/build-arch.sh b/.docker/build-arch.sh index 950ae21..5308d77 100755 --- a/.docker/build-arch.sh +++ b/.docker/build-arch.sh @@ -11,4 +11,4 @@ cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Optimization -DCMAKE_ make # tests -xvfb-run make test +xvfb-run -a make test diff --git a/.docker/build-ubuntu-package.sh b/.docker/build-ubuntu-package.sh index a0427fa..8cf2372 100755 --- a/.docker/build-ubuntu-package.sh +++ b/.docker/build-ubuntu-package.sh @@ -6,8 +6,8 @@ rm -rf build-ubuntu mkdir build-ubuntu # patches -git apply patches/qt5.6-qversionnumber.patch -git apply patches/qt5.5-qstringlist-and-qinfo.patch +#git apply patches/qt5.6-qversionnumber.patch +#git apply patches/qt5.5-qstringlist-and-qinfo.patch # build cd build-ubuntu diff --git a/.docker/build-ubuntu.sh b/.docker/build-ubuntu.sh index 9ec2661..68ec9f8 100755 --- a/.docker/build-ubuntu.sh +++ b/.docker/build-ubuntu.sh @@ -15,4 +15,4 @@ cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Optimization -DCMAKE_ make # tests -xvfb-run make test +xvfb-run -a make test diff --git a/.gitignore b/.gitignore index 9a0d19c..9684c5e 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ pkg # clion settings .idea +cmake-build* diff --git a/.travis.yml b/.travis.yml index f3292aa..80fdc9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,14 @@ sudo: required +language: generic -arch: - packages: - - plasma-framework - # build deps - - cmake - - extra-cmake-modules - - python - # test - - xorg-server-xvfb - # additional targets - - clang - - cppcheck - script: - - export DISPLAY=:99.0 - - git clone https://github.com/arcan1s/awesome-widgets/ - - cd awesome-widgets; git submodule update --init --recursive - - mkdir awesome-widgets/build - - cd awesome-widgets/build; cmake -DKDE_INSTALL_USE_QT_SYS_PATHS=ON -DCMAKE_BUILD_TYPE=Optimization -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_FUTURE=ON -DBUILD_TESTING=ON ../sources - - cd awesome-widgets/build; make - - cd awesome-widgets/build; make cppcheck - - cd awesome-widgets/build; make clangformat && ( [ `git status -s | wc -l` -eq 0 ] || exit 1 ) - - cd awesome-widgets/build; xvfb-run make test - - sleep 3 +env: + - DOCKER_TAG_ARCH="arcan1s/awesome-widgets-arch" + +services: + - docker + +before_install: + - docker build --tag="${DOCKER_TAG_ARCH}" -f ".docker/Dockerfile-arch" ".docker" script: - - "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash" + - docker run --rm -v "$(pwd):/opt/build" -w /opt/build "${DOCKER_TAG_ARCH}" sh -c ".docker/build-arch.sh" diff --git a/.travis.yml.bckp b/.travis.yml.bckp deleted file mode 100644 index dad2148..0000000 --- a/.travis.yml.bckp +++ /dev/null @@ -1,13 +0,0 @@ -sudo: required - -env: - - DOCKER_TAG="arcan1s/awesome-widgets" - -services: - - docker - -before_install: - - docker build --tag="${DOCKER_TAG}" .docker - -scirpt: - - docker run "${DOCKER_TAG}" .docker/build.sh diff --git a/AUTHORS b/AUTHORS index 4ed4ef5..bb814c0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,3 +11,5 @@ Ernesto Avilés Vzqz (Spanish) Виктор Слободян (Ukrainian) Steve Lemuel (Chinese) Mariusz Kocoń (Polish) +Ibnu Daru Aji (Indonesian) +Antonio Vivace (Italian) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67bf515..7875483 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,7 +38,7 @@ for more details. To avoid manual labor there is automatic cmake target named * `Q_PROPERTY` macro is allowed and recommended for QObject based classes. * Qt macros (e.g. `signals`, `slots`, `Q_OBJECT`, etc) are allowed. In other hand `Q_FOREACH` (`foreach`) is not allowed use `for (auto &foo : bar)` instead. -* Current project standard is **C++11**. +* Current project standard is **C++17**. * Do not use C-like code: * C-like style iteration if possible. Use `for (auto &foo : bar)` and `std::for_each` instead if possible. It is also recommended to use iterators. diff --git a/README.md b/README.md index 242ac79..4b50279 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ Optional dependencies * hddtemp * smartmontools * music player (mpd or MPRIS supported) +* wireless_tools Make dependencies ----------------- @@ -46,6 +47,8 @@ Make dependencies * cmake * extra-cmake-modules +In addition some distros might require to install some -dev packages, e.g. the list of required packages for deb-based distros can be found [here](https://github.com/arcan1s/awesome-widgets/blob/development/.docker/Dockerfile-ubuntu-amd64#L7). + Installation ------------ @@ -53,11 +56,15 @@ Installation * install mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../sources make && sudo make install **NOTE** on Plasma 5 it very likely requires `-DKDE_INSTALL_USE_QT_SYS_PATHS=ON` flag + **NOTE** if you are going to build from git, you need to init submodules first, e.g.: + + git submodule update --init --recursive + Additional information ====================== diff --git a/packages/PKGBUILD b/packages/PKGBUILD index 5ce62ec..2d50354 100644 --- a/packages/PKGBUILD +++ b/packages/PKGBUILD @@ -2,7 +2,7 @@ pkgname=plasma5-applet-awesome-widgets _pkgname=awesome-widgets -pkgver=3.3.3 +pkgver=3.4.1 pkgrel=1 pkgdesc="Collection of minimalistic Plasmoids which look like Awesome WM widgets (ex-PyTextMonitor)" arch=('i686' 'x86_64') @@ -17,7 +17,7 @@ optdepends=("catalyst: for GPU monitor" makedepends=('cmake' 'extra-cmake-modules' 'python') source=(https://github.com/arcan1s/awesome-widgets/releases/download/V.${pkgver}/${_pkgname}-${pkgver}-src.tar.xz) install=${pkgname}.install -md5sums=('ce2413868cbb230e358e75a15975a1e5') +md5sums=('772d1b6955ffe20a1e14c4255d04564b') backup=('etc/xdg/plasma-dataengine-extsysmon.conf') prepare() { diff --git a/sources/.clang-format b/sources/.clang-format index b4b4e86..05d985c 100644 --- a/sources/.clang-format +++ b/sources/.clang-format @@ -1,27 +1,26 @@ --- Language: Cpp AccessModifierOffset: -4 -AlignAfterOpenBracket: true +AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false -AlignEscapedNewlinesLeft: false AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Inline -AllowShortIfStatementsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: false +AlwaysBreakTemplateDeclarations: No BinPackArguments: true BinPackParameters: true BreakBeforeBinaryOperators: All BreakBeforeBraces: Linux BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: true -ColumnLimit: 80 +ColumnLimit: 100 CommentPragmas: '^ IWYU pragma:' ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 diff --git a/sources/.kdev4/awesomewidgets.kdev4 b/sources/.kdev4/awesomewidgets.kdev4 deleted file mode 100644 index 5da78b6..0000000 --- a/sources/.kdev4/awesomewidgets.kdev4 +++ /dev/null @@ -1,26 +0,0 @@ -[Buildset] -BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x1e\x00a\x00w\x00e\x00s\x00o\x00m\x00e\x00-\x00w\x00i\x00d\x00g\x00e\x00t\x00s) - -[CMake] -Build Directory Count=1 -Current Build Directory Index=0 -ProjectRootRelative=./ - -[CMake][CMake Build Directory 0] -Build Directory Path=file:///home/arcanis/Documents/github/awesome-widgets/build -Build Type=Optimization -CMake Binary=file:///usr/bin/cmake -Environment Profile= -Extra Arguments= -Install Directory=file:///usr - -[Defines And Includes][Compiler] -Name=GCC -Path=gcc -Type=GCC - -[Launch] -Launch Configurations= - -[Project] -VersionControlSupport=kdevgit diff --git a/sources/.kdev4/sources.kdev4 b/sources/.kdev4/sources.kdev4 deleted file mode 100644 index ea73c1d..0000000 --- a/sources/.kdev4/sources.kdev4 +++ /dev/null @@ -1,23 +0,0 @@ -[Buildset] -BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00\x1e\x00a\x00w\x00e\x00s\x00o\x00m\x00e\x00-\x00w\x00i\x00d\x00g\x00e\x00t\x00s) - -[CMake] -Build Directory Count=1 -Current Build Directory Index=0 -ProjectRootRelative=./ - -[CMake][CMake Build Directory 0] -Build Directory Path=file:///home/arcanis/Documents/github/awesome-widgets/build -Build Type=Release -CMake Binary=file:///usr/bin/cmake -Environment Profile= -Extra Arguments= -Install Directory=file:///usr - -[Defines And Includes][Compiler] -Name=GCC -Path=gcc -Type=GCC - -[Project] -VersionControlSupport=kdevgit diff --git a/sources/3rdparty/qreplytimeout/qreplytimeout.cpp b/sources/3rdparty/qreplytimeout/qreplytimeout.cpp index eb3c4ad..ee500bd 100644 --- a/sources/3rdparty/qreplytimeout/qreplytimeout.cpp +++ b/sources/3rdparty/qreplytimeout/qreplytimeout.cpp @@ -12,7 +12,7 @@ QReplyTimeout::QReplyTimeout(QNetworkReply *reply, const int timeout) void QReplyTimeout::timeout() { - QNetworkReply *reply = static_cast(parent()); + auto *reply = dynamic_cast(parent()); if (reply->isRunning()) reply->close(); } diff --git a/sources/CMakeLists.txt b/sources/CMakeLists.txt index f7209f0..3fe9c5e 100644 --- a/sources/CMakeLists.txt +++ b/sources/CMakeLists.txt @@ -1,12 +1,13 @@ cmake_minimum_required(VERSION 2.8.12) # some fucking magic -cmake_policy(SET CMP0003 OLD) -cmake_policy(SET CMP0002 OLD) cmake_policy(SET CMP0011 NEW) cmake_policy(SET CMP0015 NEW) if (POLICY CMP0063) - cmake_policy(SET CMP0063 OLD) + cmake_policy(SET CMP0063 NEW) +endif () +if (POLICY CMP0071) + cmake_policy(SET CMP0071 NEW) endif () project(awesomewidgets) @@ -14,8 +15,8 @@ set(PROJECT_AUTHOR "Evgeniy Alekseev") set(PROJECT_CONTACT "esalexeev@gmail.com") set(PROJECT_LICENSE "GPL3") set(PROJECT_VERSION_MAJOR "3") -set(PROJECT_VERSION_MINOR "3") -set(PROJECT_VERSION_PATCH "3") +set(PROJECT_VERSION_MINOR "4") +set(PROJECT_VERSION_PATCH "1") set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") # append git version if any set(PROJECT_COMMIT_SHA "Commit hash" CACHE INTERNAL "") @@ -41,40 +42,23 @@ option(BUILD_TESTING "Build with additional test abilities" OFF) set(PROJECT_CHANGELOG "Changelog" CACHE INTERNAL "") include(changelog.cmake) -# flags -if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "-Wall -Wno-cpp -std=c++11") - set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") - set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") - set(CMAKE_CXX_FLAGS_OPTIMIZATION "-Ofast -DNDEBUG") - # avoid newer gcc warnings - add_definitions(-D_DEFAULT_SOURCE) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-Wall -std=c++11") - set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") - set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") - set(CMAKE_CXX_FLAGS_OPTIMIZATION "-Ofast -DNDEBUG") - # linker flags -else () - message(FATAL_ERROR "Unknown compiler") -endif () -if (CMAKE_BUILD_TYPE MATCHES Debug) - set(CMAKE_VERBOSE_MAKEFILE ON) -endif () - -# required by successfully coverity and cppcheck build -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - +# directories set(PROJECT_TRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty) set(PROJECT_LIBRARY awesomewidgets) set(PROJECT_MONITORSOURCES extsysmonsources) + +# modules +include(compiler.cmake) include(libraries.cmake) include(clang-format.cmake) include(cppcheck.cmake) include(coverity.cmake) +# pre-configure get_directory_property(CMAKE_DEFINITIONS COMPILE_DEFINITIONS) configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) + +# build components add_subdirectory(awesomewidgets) add_subdirectory(extsysmonsources) add_subdirectory(extsysmon) @@ -90,4 +74,3 @@ if (BUILD_TESTING) endif () include(packages-recipe.cmake) - diff --git a/sources/awdebug.cpp b/sources/awdebug.cpp index 84c14ba..7135db6 100644 --- a/sources/awdebug.cpp +++ b/sources/awdebug.cpp @@ -21,16 +21,12 @@ #include "awdebug.h" -Q_LOGGING_CATEGORY(LOG_AW, "org.kde.plasma.awesomewidget", - QtMsgType::QtWarningMsg) +Q_LOGGING_CATEGORY(LOG_AW, "org.kde.plasma.awesomewidget", QtMsgType::QtWarningMsg) Q_LOGGING_CATEGORY(LOG_DBUS, "org.kde.plasma.awdbus", QtMsgType::QtWarningMsg) -Q_LOGGING_CATEGORY(LOG_DP, "org.kde.plasma.desktoppanel", - QtMsgType::QtWarningMsg) +Q_LOGGING_CATEGORY(LOG_DP, "org.kde.plasma.desktoppanel", QtMsgType::QtWarningMsg) Q_LOGGING_CATEGORY(LOG_ESM, "org.kde.plasma.extsysmon", QtMsgType::QtWarningMsg) -Q_LOGGING_CATEGORY(LOG_ESS, "org.kde.plasma.extsysmonsources", - QtMsgType::QtWarningMsg) -Q_LOGGING_CATEGORY(LOG_LIB, "org.kde.plasma.awesomewidgets", - QtMsgType::QtWarningMsg) +Q_LOGGING_CATEGORY(LOG_ESS, "org.kde.plasma.extsysmonsources", QtMsgType::QtWarningMsg) +Q_LOGGING_CATEGORY(LOG_LIB, "org.kde.plasma.awesomewidgets", QtMsgType::QtWarningMsg) QString AWDebug::getAboutText(const QString &_type) @@ -46,15 +42,9 @@ QString AWDebug::getAboutText(const QString &_type) text = i18n("A set of minimalistic plasmoid widgets"); } else if (_type == "links") { text = i18n("Links:") + "