Merge branch 'master-flameshotorg' into master_nc_merge_upstream

# Conflicts:
#	.travis.yml
#	appveyor.yml
#	data/graphics.qrc
#	data/img/app/keyboard.svg
#	data/img/material/black/delete.png
#	data/img/material/black/delete.svg
#	data/img/material/black/filepath.svg
#	data/img/material/black/shortcut.svg
#	data/img/material/white/filepath.svg
#	data/img/material/white/shortcut.svg
#	data/translations/Internationalization_hu.ts
#	data/translations/Internationalization_ka.ts
#	external/Qt-Color-Widgets/src/color_wheel.cpp
#	external/singleapplication/singleapplication.cpp
#	flameshot.pro
#	src/cli/commandlineparser.cpp
#	src/config/buttonlistview.cpp
#	src/config/configwindow.cpp
#	src/config/configwindow.h
#	src/config/geneneralconf.cpp
#	src/config/geneneralconf.h
#	src/config/uicoloreditor.cpp
#	src/config/uicoloreditor.h
#	src/core/controller.cpp
#	src/core/globalshortcutfilter.cpp
#	src/main.cpp
#	src/third-party/Qt-Color-Widgets/src/color_utils.cpp
#	src/tools/abstractactiontool.h
#	src/tools/abstractpathtool.h
#	src/tools/arrow/arrowtool.cpp
#	src/tools/arrow/arrowtool.h
#	src/tools/blur/blurtool.cpp
#	src/tools/capturetool.h
#	src/tools/circle/circletool.cpp
#	src/tools/circle/circletool.h
#	src/tools/copy/copytool.cpp
#	src/tools/copy/copytool.h
#	src/tools/exit/exittool.cpp
#	src/tools/exit/exittool.h
#	src/tools/imgur/imguruploader.cpp
#	src/tools/launcher/applaunchertool.cpp
#	src/tools/launcher/applaunchertool.h
#	src/tools/launcher/applauncherwidget.cpp
#	src/tools/launcher/openwithprogram.cpp
#	src/tools/line/linetool.cpp
#	src/tools/line/linetool.h
#	src/tools/marker/markertool.cpp
#	src/tools/marker/markertool.h
#	src/tools/move/movetool.cpp
#	src/tools/pencil/penciltool.cpp
#	src/tools/pencil/penciltool.h
#	src/tools/pin/pintool.cpp
#	src/tools/pin/pintool.h
#	src/tools/pin/pinwidget.cpp
#	src/tools/pixelate/pixelatetool.h
#	src/tools/rectangle/rectangletool.cpp
#	src/tools/rectangle/rectangletool.h
#	src/tools/redo/redotool.cpp
#	src/tools/redo/redotool.h
#	src/tools/save/savetool.cpp
#	src/tools/save/savetool.h
#	src/tools/selection/selectiontool.cpp
#	src/tools/selection/selectiontool.h
#	src/tools/sizeindicator/sizeindicatortool.cpp
#	src/tools/sizeindicator/sizeindicatortool.h
#	src/tools/storage/imgur/imguruploader.h
#	src/tools/storage/imgur/imguruploadertool.cpp
#	src/tools/storage/imgur/imguruploadertool.h
#	src/tools/text/textconfig.cpp
#	src/tools/text/texttool.cpp
#	src/tools/text/texttool.h
#	src/tools/toolfactory.cpp
#	src/tools/toolfactory.h
#	src/tools/undo/undotool.cpp
#	src/tools/undo/undotool.h
#	src/utils/confighandler.cpp
#	src/utils/confighandler.h
#	src/utils/dbusutils.cpp
#	src/utils/screenshotsaver.cpp
#	src/utils/screenshotsaver.h
#	src/widgets/capture/buttonhandler.cpp
#	src/widgets/capture/buttonhandler.h
#	src/widgets/capture/capturebutton.cpp
#	src/widgets/capture/capturebutton.h
#	src/widgets/capture/capturewidget.cpp
#	src/widgets/capture/capturewidget.h
#	src/widgets/capture/colorpicker.cpp
#	src/widgets/capturelauncher.cpp
#	src/widgets/infowindow.cpp
#	src/widgets/infowindow.h
#	src/widgets/panel/sidepanelwidget.cpp
#	src/widgets/panel/utilitypanel.cpp
#	src/widgets/panel/utilitypanel.h
#	translations/Internationalization_ca.ts
#	translations/Internationalization_de_DE.ts
#	translations/Internationalization_es.ts
#	translations/Internationalization_fr.ts
#	translations/Internationalization_ja.ts
#	translations/Internationalization_nl.ts
#	translations/Internationalization_pl.ts
#	translations/Internationalization_pt_br.ts
#	translations/Internationalization_ru.ts
#	translations/Internationalization_sk.ts
#	translations/Internationalization_sr.ts
#	translations/Internationalization_tr.ts
#	translations/Internationalization_uk.ts
#	translations/Internationalization_zh_CN.ts
#	translations/Internationalization_zh_TW.ts
This commit is contained in:
Yuriy Puchkov
2020-09-24 18:52:49 +03:00
351 changed files with 23741 additions and 14935 deletions

6
.clang-tidy Normal file
View File

@@ -0,0 +1,6 @@
---
Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*'
WarningsAsErrors: '*'
HeaderFilterRegex: ''
FormatStyle: none

18
.cmake-format.yaml Normal file
View File

@@ -0,0 +1,18 @@
additional_commands:
foo:
flags:
- BAR
- BAZ
kwargs:
DEPENDS: '*'
HEADERS: '*'
SOURCES: '*'
bullet_char: '*'
dangle_parens: false
enum_char: .
line_ending: unix
line_width: 120
max_pargs_hwrap: 3
separate_ctrl_name_with_space: false
separate_fn_name_with_space: false
tab_size: 2

413
.github/workflows/Linux-pack.yml vendored Normal file
View File

@@ -0,0 +1,413 @@
name: Packaging(Linux)
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
- 'LICENSE'
pull_request:
branches:
- master
paths-ignore:
- 'README.md'
- 'LICENSE'
env:
PRODUCT: flameshot
RELEASE: 1
ARCH: x86_64
# dockerfiles, see https://github.com/flameshot-org/flameshot-docker-images
# docker images, see https://hub.docker.com/r/vitzy/flameshot
# vitzy/flameshot or packpack/packpack
DOCKER_REPO: vitzy/flameshot
# upload services: 0x0.st, file.io, transfer.sh, wetransfer.com
UPLOAD_SERVICE: wetransfer.com
jobs:
deb-pack:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
dist: [debian-10, ubuntu-20.04]
steps:
- name: Checkout Source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Set env & Print flameshot version
shell: bash
run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD)
echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1}
echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
echo "================================"
echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
- name: Get packpack tool
uses: actions/checkout@v2
with:
# flameshot-org/packpack or packpack/packpack
repository: flameshot-org/packpack
path: tools
- name: Packaging on ${{ matrix.dist }}
if: matrix.dist == 'debian-10'
run: |
cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE
bash $GITHUB_WORKSPACE/tools/packpack
mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb
env:
OS: debian
DIST: buster
- name: Packaging on ${{ matrix.dist }}
if: matrix.dist == 'ubuntu-20.04'
run: |
cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE
bash $GITHUB_WORKSPACE/tools/packpack
mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb
env:
OS: ubuntu
DIST: focal
- name: SHA256Sum of ${{ matrix.dist }} package(daily build)
run: |
sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb
sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb.sha256sum
echo "=============${{ matrix.dist }} sha256sum download link============"
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb.sha256sum)
echo "========no operation for you can see link in the log console======="
- name: Upload ${{ matrix.dist }} package(daily build)
run: |
echo "================${{ matrix.dist }} download link==============="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb)
echo "======no operation for you can see link in the log console====="
deb-pack-extra:
name: ubuntu-18.04(extra job to packaging deb)
runs-on: ubuntu-20.04
container:
image: vitzy/flameshot:ubuntu-bionic
steps:
- name: Checkout Source code
# Because git version < 2.18(ubuntu 18.04), so only actions/checkout@v1 can be used.
# If you use actions/checkout@v2, you will have no .git folder.
uses: actions/checkout@v1
with:
fetch-depth: 0
ref: master
- name: Set env & Print flameshot version
shell: bash
run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD)
echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1}
echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
echo "================================"
echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
- name: Install dependencies
run: |
apt-get -y -qq update
apt-get -y --no-install-recommends install \
qt5-default \
qttools5-dev-tools \
qttools5-dev \
libqt5dbus5 \
libqt5network5 \
libqt5core5a \
libqt5widgets5 \
libqt5gui5 \
libqt5svg5-dev \
python3 \
python3-pip
- name: Prepare cmake(>=3.13.0)
run: |
apt-get -y autoremove cmake
wget https://github.com/Kitware/CMake/releases/download/v3.18.3/cmake-3.18.3-Linux-${ARCH}.tar.gz
tar -xf cmake-3.18.3-Linux-${ARCH}.tar.gz
cd ./cmake-3.18.3-Linux-${ARCH}
cp -r bin /usr/
cp -r share /usr/
cp -r doc /usr/share/
cp -r man /usr/share/
cd ..
rm -rf cmake-3.18.3-Linux-${ARCH} cmake-3.18.3-Linux-${ARCH}.tar.gz
echo "======CMAKE VERSION======"
cmake --version
echo "========================="
- name: Packaging on ubuntu-18.04
run: |
cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE
mkdir -p $GITHUB_WORKSPACE/build
sed -e "/cmake (>= 3.13~),/d" -i $GITHUB_WORKSPACE/debian/control
dpkg-buildpackage -b
cp $GITHUB_WORKSPACE/../${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb
- name: SHA256Sum of ubuntu-18.04 package(daily build)
run: |
sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb
sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb > $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb.sha256sum
echo "============ubuntu-18.04 sha256sum download link=============="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb.sha256sum)
echo "=====no operation for you can see link in the log console====="
- name: Upload ubuntu-18.04 package(daily build)
run: |
echo "===================ubuntu-18.04 download link=================="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb)
echo "======no operation for you can see link in the log console====="
rpm-pack:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
dist: [fedora-31, fedora-32, opensuse-leap-15.2]
steps:
- name: Checkout Source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Set env & Print flameshot version
shell: bash
run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD)
echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1}
echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
echo "================================"
echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
- name: Get packpack tool
uses: actions/checkout@v2
with:
# flameshot-org/packpack or packpack/packpack
repository: flameshot-org/packpack
path: tools
- name: Packaging on ${{ matrix.dist }}
if: matrix.dist == 'fedora-31'
run: |
cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE
bash $GITHUB_WORKSPACE/tools/packpack
env:
OS: fedora
DIST: 31
- name: Packaging on ${{ matrix.dist }}
if: matrix.dist == 'fedora-32'
run: |
cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE
bash $GITHUB_WORKSPACE/tools/packpack
env:
OS: fedora
DIST: 32
- name: Packaging on ${{ matrix.dist }}
if: matrix.dist == 'opensuse-leap-15.2'
run: |
cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE
bash $GITHUB_WORKSPACE/tools/packpack
env:
OS: opensuse-leap
DIST: 15.2
- name: SHA256Sum of ${{ matrix.dist }} package(daily build)
if: startsWith(matrix.dist, 'fedora')
run: |
sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm
sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm.sha256sum
echo "============${{ matrix.dist }} sha256sum download link============"
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm.sha256sum)
echo "=======no operation for you can see link in the log console======="
- name: SHA256Sum of ${{ matrix.dist }} package(daily build)
if: startsWith(matrix.dist, 'opensuse-leap')
run: |
sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm
sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm.sha256sum
echo "============${{ matrix.dist }} sha256sum download link==========="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm.sha256sum)
echo "=======no operation for you can see link in the log console======"
- name: Upload ${{ matrix.dist }} package(daily build)
if: startsWith(matrix.dist, 'fedora')
run: |
echo "================${{ matrix.dist }} download link==============="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm)
echo "======no operation for you can see link in the log console====="
- name: Upload ${{ matrix.dist }} package(daily build)
if: startsWith(matrix.dist, 'opensuse-leap')
run: |
echo "================${{ matrix.dist }} download link==============="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm)
echo "======no operation for you can see link in the log console====="
appimage-pack:
runs-on: ubuntu-20.04
steps:
- name: Checkout Source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Set env & Print flameshot version
shell: bash
run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD)
echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1}
echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
echo "================================"
echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
- name: Install Dependencies
run: |
sudo apt-get -y -qq update
sudo apt-get -y --no-install-recommends install \
cmake \
extra-cmake-modules \
build-essential \
qt5-default \
qttools5-dev-tools \
qttools5-dev \
libqt5dbus5 \
libqt5network5 \
libqt5core5a \
libqt5widgets5 \
libqt5gui5 \
libqt5svg5-dev \
appstream \
hicolor-icon-theme \
fcitx-frontend-qt5 \
openssl \
ca-certificates
- name: Get go-appimage tool
# Will not use linuxdeployqt anymore, because it suopprts currently still-supported mainstream distribution,
# which is glibc 2.23. For more information, please see https://github.com/probonopd/linuxdeployqt/issues/340.
# Will try new tool https://github.com/probonopd/go-appimage written in golang by the inventor of the AppImage format.
run: |
wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases -O - \
| grep "appimagetool-.*-${ARCH}.AppImage" | head -n 1 | cut -d '"' -f 2) -O appimagetool
chmod +x appimagetool
- name: Packaging appimage
run: |
APPIMAGE_DST_PATH=$GITHUB_WORKSPACE/${PRODUCT}.AppDir
mkdir -p ${APPIMAGE_DST_PATH}
cd $GITHUB_WORKSPACE
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
make -j$(nproc) DESTDIR=${APPIMAGE_DST_PATH} install
$GITHUB_WORKSPACE/appimagetool -s deploy ${APPIMAGE_DST_PATH}/usr/share/applications/flameshot.desktop
mkdir -p ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts
cp \
/usr/lib/${ARCH}-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so \
${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts/
cp \
$GITHUB_WORKSPACE/data/img/app/flameshot.png \
${APPIMAGE_DST_PATH}/
VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool ${APPIMAGE_DST_PATH}
- name: SHA256Sum of appimage package(daily build)
run: |
sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage
sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage > $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage.sha256sum
echo "================appimage sha256sum download link==============="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage.sha256sum)
echo "======no operation for you can see link in the log console====="
- name: Upload appimage package for daily build
run: |
echo "====================appimage download link====================="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage)
echo "======no operation for you can see link in the log console====="
flatpak-pack:
runs-on: ubuntu-20.04
steps:
- name: Checkout Source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Set env & Print flameshot version
shell: bash
run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD)
echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1}
echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
echo "================================"
echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
- name: Setup flatpak
run: |
sudo apt-get -y -qq update
sudo apt-get install -y flatpak flatpak-builder
- name: Setup Flathub
run: |
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y --noninteractive flathub org.kde.Sdk//5.15 org.kde.Platform//5.15
- name: Packaging flatpak
run: |
BUNDLE="org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak"
MANIFEST_PATH=$GITHUB_WORKSPACE/data/flatpak/org.flameshot.flameshot.yml
RUNTIME_REPO="https://flathub.org/repo/flathub.flatpakrepo"
APP_ID="org.flameshot.flameshot"
BRANCH="master"
flatpak-builder --user --disable-rofiles-fuse --repo=repo --force-clean flatpak_app ${MANIFEST_PATH} --install-deps-from=flathub
flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
- name: SHA256Sum of flatpak package(daily build)
run: |
sha256sum $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak
sha256sum $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak > $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak.sha256sum
echo "================flatpak sha256sum download link===================="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak.sha256sum)
echo "========no operation for you can see link in the log console======="
- name: Upload flatpak package(daily build)
run: |
echo "=====================flatpak download link====================="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak)
echo "======no operation for you can see link in the log console====="
snap-pack:
runs-on: ubuntu-20.04
steps:
- name: Checkout Source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Set env & Print flameshot version
shell: bash
run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD)
echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1}
echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
echo "================================"
echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
- name: Packaging snap
uses: snapcore/action-build@v1
id: snapcraft
with:
path: data
- name: SHA256Sum of snap package(daily build)
run: |
sha256sum ${{ steps.snapcraft.outputs.snap }}
sha256sum ${{ steps.snapcraft.outputs.snap }} > ${{ steps.snapcraft.outputs.snap }}.sha256sum
echo "================snap sha256sum download link=================="
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh ${{ steps.snapcraft.outputs.snap }}.sha256sum)
echo "=====no operation for you can see link in the log console====="
- name: Upload snap package(daily build)
run: |
echo "=======================snap download link======================"
echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh ${{ steps.snapcraft.outputs.snap }})
echo "======no operation for you can see link in the log console====="

158
.github/workflows/Windows-pack.yml vendored Normal file
View File

@@ -0,0 +1,158 @@
name: Packaging(Windows)
on:
push:
branches:
- master
paths-ignore:
- 'README.md'
- 'LICENSE'
pull_request:
branches:
- master
paths-ignore:
- 'README.md'
- 'LICENSE'
env:
PRODUCT: flameshot
jobs:
windows-pack:
name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
qt_ver: [5.15.1]
qt_target: [desktop]
config:
- {
arch: x86,
generator: "-G'Visual Studio 16 2019' -A Win32",
vcpkg_triplet: x86-windows,
qt_arch: win32_msvc2019,
qt_arch_install: msvc2019,
pak_arch: win32
}
- {
arch: x64,
generator: "-G'Visual Studio 16 2019' -A x64",
vcpkg_triplet: x64-windows,
qt_arch: win64_msvc2019_64,
qt_arch_install: msvc2019_64,
pak_arch: win64
}
type: [portable, installer]
env:
VCINSTALLDIR: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/
Qt5_DIR: ${{ github.workspace }}\build\Qt\${{ matrix.qt_ver }}\${{ matrix.config.qt_arch_install }}\lib\cmake\Qt5\
QTDIR: ${{ github.workspace }}\build\Qt\${{ matrix.qt_ver }}\${{ matrix.config.qt_arch_install }}\
steps:
- name: Checkout Source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Set env & Print flameshot version
shell: bash
run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD)
echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1}
echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
echo "================================"
echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ./build/Qt/${{ matrix.qt_ver }}/${{ matrix.config.qt_arch_install }}
key: ${{ runner.os }}-QtCache/${{ matrix.qt_ver }}/${{ matrix.config.qt_arch }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt_ver }}
target: ${{ matrix.qt_target }}
arch: ${{ matrix.config.qt_arch }}
dir: '${{ github.workspace }}/build/'
modules: 'qtscript'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Configure
working-directory: build
shell: pwsh
run: |
cmake .. ${{matrix.config.generator}} `
-DCMAKE_BUILD_TYPE=Release `
-DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }}
- name: Compile
working-directory: build
shell: pwsh
run: cmake --build . --config Release
- name: CPack
working-directory: build
shell: pwsh
run: |
If ($env:TYPE -eq "installer")
{
cpack -G WIX -B "$env:GITHUB_WORKSPACE\build\Package"
}
ElseIf($env:TYPE -eq "portable")
{
cpack -G ZIP -B "$env:GITHUB_WORKSPACE\build\Package"
}
env:
TYPE: ${{matrix.type}}
- name: Package Clean
run: rm -r $env:GITHUB_WORKSPACE\build\Package\_CPack_Packages
- name: SHA256Sum of Windows installer(daily build)
if: matrix.type == 'installer'
shell: bash
run: |
sha256sum $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi
sha256sum $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi > $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi.sha256sum
python -m pip install -U -q requests
echo "============Windows installer sha256sum download link============"
echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi.sha256sum)
echo "=======no operation for you can see link in the log console====="
- name: SHA256Sum of Windows portable(daily build)
if: matrix.type == 'portable'
shell: bash
run: |
sha256sum $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip
sha256sum $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip > $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip.sha256sum
python -m pip install -U -q requests
echo "===========Windows portable sha256sum download link============"
echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip.sha256sum)
echo "=====no operation for you can see link in the log console====="
- name: Upload Windows installer(daily build)
if: matrix.type == 'installer'
shell: bash
run: |
python -m pip install -U -q requests
echo "================Windows installer download link================"
echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi)
echo "=====no operation for you can see link in the log console====="
- name: Upload Windows portable(daily build)
if: matrix.type == 'portable'
shell: bash
run: |
python -m pip install -U -q requests
echo "=================Windows portable download link================"
echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip)
echo "=====no operation for you can see link in the log console====="

124
.github/workflows/build_cmake.yml vendored Normal file
View File

@@ -0,0 +1,124 @@
name: Building(CMake)
on:
push:
branches: [ master ]
paths-ignore:
- 'README.md'
- 'LICENSE'
pull_request:
branches: [ master ]
paths-ignore:
- 'README.md'
- 'LICENSE'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
jobs:
linux-build:
name: ${{ matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo apt-get -y -qq update
sudo apt-get -y --no-install-recommends install \
cmake \
extra-cmake-modules \
build-essential \
qt5-default \
qttools5-dev-tools \
qttools5-dev \
libqt5dbus5 \
libqt5network5 \
libqt5core5a \
libqt5widgets5 \
libqt5gui5 \
libqt5svg5-dev
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{runner.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
#
# We need to source the profile file to make sure conan is in PATH
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{runner.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C $BUILD_TYPE
windows-build:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows 2019 MSVC",
artifact: "Windows-MSVC.tar.xz",
os: windows-2019,
cc: "cl", cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
}
- {
name: "Windows 2019 MinGW",
artifact: "Windows-MinGW.tar.xz",
os: windows-2019,
cc: "gcc", cxx: "g++"
}
steps:
- uses: actions/checkout@v2
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ./build/Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: 5.15.1
target: desktop
dir: '${{ github.workspace }}/build/'
- name: Configure
working-directory: build
shell: powershell
run: |
cmake -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE ../
- name: Build
working-directory: build
shell: powershell
run: |
cmake --build . --config $env:BUILD_TYPE

17
.github/workflows/clang-format.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: test-clang-format
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: DoozyX/clang-format-lint-action@v0.9
with:
source: './src'
#exclude: './third_party ./external'
extensions: 'h,cpp'
clangFormatVersion: 11
style: file

8
.gitignore vendored
View File

@@ -53,5 +53,13 @@ stage/
.snapcraft/
flameshot*.tar.bz2
.vscode/
build/
data/flatpak/.flatpak-builder
# NVIM
*~
# Jetbrains
.idea/
# End of https://www.gitignore.io/api/snapcraft

View File

@@ -1,31 +0,0 @@
#!/bin/bash --
set -e
DIST_PATH=dist
if [[ "${EXTEN}" == "other" ]]; then
cp "${BUILD_DST_PATH}/flameshot" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_${ARCH}"
cd "${ROOT_PATH}/.travis/services"
TEMP_DOWNLOAD_URL=$(travis_retry bash \
"${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \
flameshot_"${VERSION}_${ARCH}")
else
case "${OS}" in
"ubuntu"|"debian")
cp "${DIST_PATH}/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}"
cd "${ROOT_PATH}/.travis/services"
TEMP_DOWNLOAD_URL=$(travis_retry bash \
"${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \
"flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}")
;;
"fedora")
cp "${DIST_PATH}/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}"
cd "${ROOT_PATH}/.travis/services"
TEMP_DOWNLOAD_URL=$(travis_retry bash \
"${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \
"flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}")
;;
esac
fi

View File

@@ -1,7 +0,0 @@
#!/bin/bash --
set -e
if [[ "${EXTEN}" == "other" ]]; then
travis_retry sudo apt update
fi

View File

@@ -1,15 +0,0 @@
#!/bin/bash --
set -e
if [[ "${EXTEN}" == "other" ]]; then
# Compile-time
travis_retry sudo apt install -y gcc g++ build-essential qt5-default qt5-qmake qttools5-dev-tools
# Run-time
travis_retry sudo apt install -y libqt5dbus5 libqt5network5 libqt5core5a libqt5widgets5 libqt5gui5 libqt5svg5-dev
# Optional
travis_retry sudo apt install -y openssl ca-certificates
# Install fcitx-frontend-qt5
travis_retry sudo apt install -y fcitx-frontend-qt5
fi

View File

@@ -1,42 +0,0 @@
#!/bin/bash --
set -e
DIST_PATH=dist
if [[ ! -d "${DIST_PATH}" ]]; then
mkdir "${DIST_PATH}"
fi
if [[ "${EXTEN}" == "other" ]]; then
project_dir="$(pwd)"
BUILD_DST_PATH=build-test
qmake --version
mkdir "${BUILD_DST_PATH}"
qmake -makefile DESTDIR="${BUILD_DST_PATH}" "${project_dir}"/flameshot.pro
# Building flameshot
make -j$(nproc)
# Running flameshot tests
make check -j$(nproc)
ls -alhR
else
travis_retry git clone https://github.com/flameshotapp/packpack.git
travis_retry packpack/packpack
pwd && ls
case "${OS}" in
"ubuntu"|"debian")
# copy deb to dist path for distribution
cp \
build/flameshot_*_*.deb \
"${DIST_PATH}"/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}
;;
"fedora")
cp \
build/flameshot-${VERSION}-${RELEASE}.*.${ARCH}.rpm \
"${DIST_PATH}"/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}
;;
esac
fi

View File

@@ -1,55 +0,0 @@
#!/bin/bash --
set -e
project_dir="$(pwd)"
brew update > /dev/null
brew install qt
QTDIR=/usr/local/opt/qt
PATH="${QTDIR}"/bin:"${PATH}"
LDFLAGS=-L"${QTDIR}"/lib
CPPFLAGS=-I"${QTDIR}"/include
# Build your app
cd "${project_dir}"
mkdir dist
mkdir build
cd build
qmake -version
qmake CONFIG-=debug CONFIG+=release CONFIG+=packaging ../flameshot.pro
make -j$(nproc)
git clone https://github.com/aurelien-rainone/macdeployqtfix.git
pwd
ls
ls /Users/travis/build/ZetaoYang/flameshot
# Package DMG from build/flamshot.app directory
"${QTDIR}"/bin/macdeployqt flameshot.app
python \
"${project_dir}"/build/macdeployqtfix/macdeployqtfix.py \
flameshot.app/Contents/MacOS/flameshot \
"${QTDIR}"
cd "${project_dir}"/build
mkdir -p distrib/Flameshot
cd distrib/Flameshot
mv "${project_dir}"/build/flameshot.app "${project_dir}"/build/distrib/Flameshot/
cp "${project_dir}"/LICENSE LICENSE
cp "${project_dir}"/README.md README.md
echo "${VERSION}" > version
echo "${TRAVIS_COMMIT}" >> version
ln -s /Applications ./Applications
cd ..
hdiutil create -srcfolder ./Flameshot -format UDBZ ./flameshot.dmg
mv flameshot.dmg flameshot_X64_${VERSION}.dmg
mv flameshot_X64_${VERSION}.dmg "${project_dir}"/dist/flameshot_X64_$VERSION.dmg
TEMP_DOWNLOAD_URL=$(curl \
--upload-file \
flameshot_X64_$VERSION.dmg \
"https://transfer.sh/flameshot_X64_$VERSION.dmg")
cd ..

109
CMakeLists.txt Normal file
View File

@@ -0,0 +1,109 @@
cmake_minimum_required(VERSION 3.13)
# cmake_policy(SET CMP0076 OLD)
# This can be read from ${PROJECT_NAME} after project() is called
project(
flameshot
VERSION 0.8.1
LANGUAGES CXX)
set(PROJECT_NAME_CAPITALIZED "Flameshot")
# Configuration options
set(DEFAULT_RUN_IN_PLACE FALSE)
if(WIN32)
set(DEFAULT_RUN_IN_PLACE TRUE)
endif()
set(RUN_IN_PLACE ${DEFAULT_RUN_IN_PLACE} CACHE BOOL
"Run directly in source directory structure")
option(GENERATE_TS "Regenerate translation source files" OFF)
include(cmake/StandardProjectSettings.cmake)
add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_17)
add_library(project_warnings INTERFACE)
# enable cache system
include(cmake/Cache.cmake)
# standard compiler warnings
include(cmake/CompilerWarnings.cmake)
# set_project_warnings(project_warnings)
# sanitizer options if supported by compiler
include(cmake/Sanitizers.cmake)
enable_sanitizers(project_options)
# allow for static analysis options include(cmake/StaticAnalyzers.cmake)
add_subdirectory(src)
# CPack
set(CPACK_PACKAGE_VENDOR "flameshot-org")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Powerful yet simple to use screenshot software.")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_PACKAGE_HOMEPAGE_URL "https://flameshot.org")
set(CPACK_PACKAGE_CONTACT "flameshot-org developers <info@flameshot.org>")
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/data/img/app/flameshot.svg") # TODO: Can any generator make use of this?
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") # TODO: Where is this used? Do we need a better source?
if(WIN32)
# Include all dynamically linked runtime libaries such as MSVCRxxx.dll
include(InstallRequiredSystemLibraries)
if(RUN_IN_PLACE)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-win64")
else()
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-win32")
endif()
set(CPACK_GENERATOR ZIP)
else()
set(CPACK_GENERATOR WIX ZIP)
set(CPACK_PACKAGE_NAME "${PROJECT_NAME_CAPITALIZED}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME_CAPITALIZED}")
set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} "${PROJECT_NAME_CAPITALIZED}")
set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME})
# WIX (Windows .msi installer)
# 48x48 pixels
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/data/img/app/flameshot.ico")
# Supported languages can be found at
# http://wixtoolset.org/documentation/manual/v3/wixui/wixui_localization.html
#set(CPACK_WIX_CULTURES "ar-SA,bg-BG,ca-ES,hr-HR,cs-CZ,da-DK,nl-NL,en-US,et-EE,fi-FI,fr-FR,de-DE")
set(CPACK_WIX_UI_BANNER "${CMAKE_SOURCE_DIR}/data/win-installer/Bitmaps/CPACK_WIX_UI_BANNER.BMP")
set(CPACK_WIX_UI_DIALOG "${CMAKE_SOURCE_DIR}/data/win-installer/Bitmaps/CPACK_WIX_UI_DIALOG.BMP")
set(CPACK_WIX_PROPERTY_ARPHELPLINK "${CPACK_PACKAGE_HOMEPAGE_URL}")
set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "${CPACK_PACKAGE_HOMEPAGE_URL}")
set(CPACK_WIX_ROOT_FEATURE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-dcl:high") # set high compression
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/data/win-installer/LICENSE/GPL-3.0.txt")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
# The correct way would be to include both x32 and x64 into one installer
# and install the appropriate one.
# CMake does not support that, so there are two separate GUID's
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CPACK_WIX_UPGRADE_GUID "26D8062A-66D9-48D9-8924-42090FB9B3F9")
else()
set(CPACK_WIX_UPGRADE_GUID "2C53E1B9-51D9-4429-AAE4-B02221959AA5")
endif()
endif()
elseif(APPLE)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-osx")
set(CPACK_GENERATOR ZIP)
else()
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-linux")
set(CPACK_GENERATOR TGZ)
set(CPACK_SOURCE_GENERATOR TGZ)
endif()
include(CPack)

121
README.md
View File

@@ -1,8 +1,8 @@
<div align="center">
<p>
<h1>
<a href="https://github.com/lupoDharkael/flameshot">
<img src="img/app/flameshot.svg" alt="Flameshot" />
<a href="https://github.com/flameshot-org/flameshot">
<img src="data/img/app/flameshot.svg" alt="Flameshot" />
</a>
<br />
Flameshot
@@ -10,23 +10,23 @@
<h4>Powerful yet simple to use screenshot software.</h4>
</p>
<p>
<a href="https://travis-ci.org/lupoDharkael/flameshot">
<img src="https://img.shields.io/travis/lupoDharkael/flameshot.svg?style=flat-square&label=gnu/linux" alt="GNU/Linux Build Status" />
<a href="https://github.com/flameshot-org/flameshot/actions">
<img src="https://img.shields.io/github/workflow/status/flameshot-org/flameshot/Packaging(Linux)?label=gnu%2Flinux" alt="GNU/Linux Build Status" />
</a>
<a href="https://ci.appveyor.com/project/lupoDharkael/flameshot">
<img src="https://img.shields.io/appveyor/ci/lupoDharkael/flameshot.svg?style=flat-square&label=windows" alt="Windows Build Status" />
<a href="https://github.com/flameshot-org/flameshot/actions">
<img src="https://img.shields.io/github/workflow/status/flameshot-org/flameshot/Packaging(Windows)?label=windows" alt="Windows Build Status" />
</a>
<a href="https://github.com/lupoDharkael/flameshot/releases">
<img src="https://img.shields.io/github/release/lupoDharkael/flameshot.svg?style=flat-square" alt="Latest Stable Release" />
<a href="https://github.com/flameshot-org/flameshot/releases">
<img src="https://img.shields.io/github/release/flameshot-org/flameshot.svg?style=flat-square" alt="Latest Stable Release" />
</a>
<a href="https://github.com/lupoDharkael/flameshot/releases">
<img src="https://img.shields.io/github/downloads/lupoDharkael/flameshot/total.svg?style=flat-square" alt="Total Downloads" />
<a href="https://github.com/flameshot-org/flameshot/releases">
<img src="https://img.shields.io/github/downloads/flameshot-org/flameshot/total.svg?style=flat-square" alt="Total Downloads" />
</a>
<a href="https://github.com/lupoDharkael/flameshot/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/lupoDharkael/flameshot.svg?style=flat-square" alt="License" />
<a href="https://github.com/flameshot-org/flameshot/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/flameshot-org/flameshot.svg?style=flat-square" alt="License" />
</a>
<a href="https://github.com/flameshotapp/flameshotapp.github.io">
<img src="https://img.shields.io/github/release/lupoDharkael/flameshot.svg?style=flat-square&label=docs" alt="Docs" />
<a href="https://flameshot.org">
<img src="https://img.shields.io/github/release/flameshot-org/flameshot.svg?style=flat-square&label=docs" alt="Docs" />
</a>
</p>
</div>
@@ -35,7 +35,7 @@
## Preview
![image](img/preview/animatedUsage.gif)
![image](https://github.com/flameshot-org/flameshot-org.github.io/blob/master/_media/animatedUsage.gif)
## Index
@@ -48,6 +48,8 @@
- [On KDE Plasma desktop](#on-kde-plasma-desktop)
- [Considerations](#considerations)
- [Installation](#installation)
- [Prebuilt Packages](#prebuilt-packages)
- [Packages from Repository](#packages-from-repository)
- [Compilation](#compilation)
- [Dependencies](#dependencies)
- [Compile-time](#compile-time)
@@ -74,6 +76,11 @@
## Usage
Executing the command `flameshot` without parameters will launch a running
instance of the program in background without taking actions.
If your desktop environment provides tray area, a tray icon will also
appear in the tray for users to perform configuration and management.
Example commands:
- Capture with GUI:
@@ -122,7 +129,7 @@ In case of doubt choose the first or the second command as shortcut in your favo
A systray icon will be in your system's panel while Flameshot is running.
Do a right click on the tray icon and you'll see some menu items to open the configuration window and the information window.
Check out the information window to see all the available shortcuts in the graphical capture mode.
Check out the About window to see all available shortcuts in the graphical capture mode.
### CLI configuration
@@ -196,7 +203,7 @@ Steps for using the configuration:
```shell
cd ~/Desktop
wget https://raw.githubusercontent.com/lupoDharkael/flameshot/master/docs/shortcuts-config/flameshot-shortcuts-kde
wget https://raw.githubusercontent.com/flameshot-org/flameshot/master/docs/shortcuts-config/flameshot-shortcuts-kde
```
3. Go to _System Settings_ → _Shortcuts_ → _Custom Shortcuts_.
4. If there's one, you'll need to disable an entry for Spectacle, the default KDE screenshot utility first because its shortcuts might collide with Flameshot's ones; so, just uncheck the _Spectacle_ entry.
@@ -210,15 +217,33 @@ Steps for using the configuration:
- If you are using Gnome you need to install the [Gnome Shell Extension Appindicator](https://github.com/Ubuntu/gnome-shell-extension-appindicator) extension in order to see the systemtray icon.
- Press <kbd>Enter</kbd> or <kbd>Ctrl</kbd> + <kbd>C</kbd> when you are in a capture mode and you don't have an active selection and the whole desktop will be copied to your clipboard! Pressing <kbd>Ctrl</kbd> + <kbd>S</kbd> will save your capture in a file! Check the [Shortcuts](#keyboard-shortcuts) for more information.
- Flameshot works best with a desktop environment that includes dbus. See this [article](https://wiki.archlinux.org/index.php/Flameshot#Troubleshooting) for tips on using Flameshot in a minimal window manager (dwm, i3, xmonad, etc)
- In order to speed up the first launch of Flameshot (DBus init of the app can be slow), consider starting the application automatically on boot.
- Press <kbd>Enter</kbd> or <kbd>Ctrl</kbd> + <kbd>C</kbd> when you are in a capture mode and you don't have an active selection and the whole desktop will be copied to your clipboard! Pressing <kbd>Ctrl</kbd> + <kbd>S</kbd> will save your capture in a file! Check the [Shortcuts](#shortcuts) for more information.
- Execute the command `flameshot` without parameters to launch a running instance of the program without taking actions.
- Quick tip: If you don't have Flameshot to autostart at boot and you want to set keyboard shortcut, use the following as the command for the keybinding:
```sh
( flameshot &; ) && ( sleep 0.5s && flameshot gui )
```
## Installation
There are packages available for a few distros:
Flameshot can be installed on Linux and Microsoft Windows currently.
There are no macOS port of flameshot now. Please participate in the development
of flameshot and help us make a macOS port.
### Prebuilt packages
Some prebuilt packages are provided on the release page of the GitHub project
repository.
[Click here to visit the release page.](https://github.com/flameshot-org/flameshot/releases).
### Packages from Repository
There are packages available in the repository of
some Linux distributions:
- [Arch](https://www.archlinux.org/packages/community/x86_64/flameshot/): `pacman -S flameshot`
+ Snapshot also available via AUR: [flameshot-git](https://aur.archlinux.org/packages/flameshot-git).
@@ -230,6 +255,7 @@ There are packages available for a few distros:
- [Docker](https://github.com/ManuelLR/docker-flameshot)
- Fedora: `dnf install flameshot`
- [Snap/Flatpak/AppImage](https://github.com/flameshotapp/packages)
- [Solus](https://dev.getsol.us/source/flameshot/): `eopkg it flameshot`
- Besides, generic packages available via [opensuse software repository](https://software.opensuse.org//download.html?project=home%3AVitzy&package=flameshot)
<details>
@@ -272,15 +298,20 @@ S3_X_API_KEY=seckret_key
## Compilation
To build the application in your system, you'll need to install the dependencies needed for it and Package names might be different for each distribution, see [Dependencies](#dependencies) below for more information.
To build the application in your system, you'll need to install the dependencies needed for it and package names might be different for each distribution, see [Dependencies](#dependencies) below for more information. You can also install most of the Qt dependencies via [their installer](https://www.qt.io/download-qt-installer). If you were developing Qt apps before, you probably already have them.
This project uses [CMake](https://cmake.org/) build system, so you need to install it in order to build the project (on most Linux distributions it is available in the standard repositories as a package called `cmake`). If your distribution provides too old version of CMake (e.g. Ubuntu 18.04) you can [download it on the official website](https://cmake.org/download/).
Also you can open and build/debug the project in a C++ IDE. For example, in Qt Creator you should be able to simply open `CMakeLists.txt` via `Open File or Project` in the menu after installing CMake into your system. [More information about CMake projects in Qt Creator](https://doc.qt.io/qtcreator/creator-project-cmake.html).
### Dependencies
#### Compile-time
- Qt >= 5.3
- Qt >= 5.9
+ Development tools
- GCC >= 4.9.2
- GCC >= 7.4
- CMake >= 3.13
#### Run-time
@@ -297,10 +328,10 @@ To build the application in your system, you'll need to install the dependencies
```shell
# Compile-time
apt install g++ build-essential qt5-default qt5-qmake qttools5-dev-tools
apt install g++ cmake build-essential qt5-default qttools5-dev-tools libqt5svg5-dev qttools5-dev
# Run-time
apt install libqt5dbus5 libqt5network5 libqt5core5a libqt5widgets5 libqt5gui5 libqt5svg5-dev
apt install libqt5dbus5 libqt5network5 libqt5core5a libqt5widgets5 libqt5gui5 libqt5svg5
# Optional
apt install git openssl ca-certificates
@@ -310,7 +341,7 @@ apt install git openssl ca-certificates
```shell
# Compile-time
dnf install gcc-c++ qt5-devel qt5-qtbase-devel qt5-linguist
dnf install gcc-c++ cmake qt5-devel qt5-qtbase-devel qt5-linguist
# Run-time
dnf install qt5-qtbase qt5-qtsvg-devel
@@ -323,7 +354,7 @@ dnf install git openssl ca-certificates
```shell
# Compile-time
pacman -S base-devel git qt5-base qt5-tools
pacman -S cmake base-devel git qt5-base qt5-tools
# Run-time
pacman -S qt5-svg
@@ -339,30 +370,14 @@ After installing all the dependencies, finally run the following commands in the
```shell
mkdir build
cd build
qmake ../
cmake ../
make
```
### Install
Simply use `make install` with privileges.
## Packaging
Having `git` installed is required if you're building Flameshot from a snapshot to have precise version information.
In order to generate the instructions in the `Makefile` to install the application in `/usr` instead of in `/usr/local` you can pass the `packaging` option to `qmake` (`qmake CONFIG+=packaging`).
If you want to install in a custom directory you can use the `INSTALL_ROOT` variable.
**Example**:
If you want to install Flameshot in `~/myBuilds/test`, you can execute the following to do so:
```shell
qmake CONFIG+=packaging
make INSTALL_ROOT=~/myBuilds/test install
```
Simply use `make install` with privileges.
Note: If you install from source, there is no uninstaller, you will need to manually remove the files. Consider using [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) to install to a custom location for easy removal.
## License
- The main code is licensed under [GPLv3](LICENSE)
@@ -377,17 +392,13 @@ Info: If I take code from your project and that implies a relicense to GPLv3, yo
## Contribute
If you want to contribute check the [CONTRIBUTING.md](CONTRIBUTING.md)
If you want to contribute check the [CONTRIBUTING.md](docs/CONTRIBUTING.md)
## Donations
I improve Flameshot in my free time because I want to create something good for everyone to use.
If you want you can donate some bucks with the following options:
- [Paypal](https://www.paypal.me/lupoDharkael)
- bitcoin:1K6oiUKWVjP3x9ZuW9C7NbDfcFkMx3G8ue
## Acknowledgment
I really appreciate those who have shown interest in the early development process:
Thanks to those who have shown interest in the early development process:
- [lupoDharkael](https://github.com/lupoDharkael)
- [Cosmo](https://github.com/philpem)
- [XerTheSquirrel](https://github.com/XerTheSquirrel)
- [The members of Sugus GNU/Linux](https://github.com/SUGUS-GNULinux)

View File

@@ -1,90 +1,20 @@
image: Visual Studio 2015
#TODO: we should take version from the last tag in git history + build number
version: 0.7.12.{build}
# Major_Version_Number.Minor_Version_Number.Patch_Number.Build_Number
skip_branch_with_pr: true
image:
- Visual Studio 2019
clone_folder: c:\projects\source
environment:
COMPILER: msvc
VSVER: 14
matrix:
- QT: C:\Qt\5.9\msvc2015_64
PLATFORM: amd64
- QT: C:\Qt\5.9\msvc2015
PLATFORM: x86
init:
- ps: |
$version = new-object System.Version $env:APPVEYOR_BUILD_VERSION
$packageVersion = "{0}.{1}.{2}.{3}" -f $version.Major, $version.Minor, $version.Build, $version.Revision
$env:build_number = $version.Build
$env:flameshot_version = $packageVersion
# scripts that run after cloning repository
install:
- set PATH=%QT%\bin\;C:\Qt\Tools\QtCreator\bin\;C:\Qt\QtIFW3.0.1\bin\;%PATH%
# scripts that run before build
before_build:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM%
- appveyor DownloadFile http://mlaan2.home.xs4all.nl/ispack/innosetup-6.0.5.exe
- innosetup-6.0.5.exe /VERYSILENT /ALLUSERS /DIR=C:\InnoSetup
# After calling vcvarsall.bat, %PLATFORM% will be X64 or x86
- qmake --version
- mkdir build
- cd build
- if "%PLATFORM%" EQU "X64" (qmake -r -spec win32-msvc CONFIG+=x86_64 CONFIG-=debug CONFIG+=release ../flameshot.pro)
- if "%PLATFORM%" EQU "x86" (qmake -r -spec win32-msvc CONFIG+=Win32 CONFIG-=debug CONFIG+=release ../flameshot.pro)
# custom build scripts
Qt5_INSTALL_DIR: 'C:\Qt\5.15.0\msvc2019_64'
PATH: '%Qt5_INSTALL_DIR%\bin;%PATH%'
build_script:
- nmake
- cmd: >-
# scripts that run after build
after_build:
# Clone OpenSSL DLLs
- mkdir distrib\flameshot
- windeployqt.exe --dir .\distrib\flameshot %APPVEYOR_BUILD_FOLDER%\build\release\flameshot.exe
- copy "%APPVEYOR_BUILD_FOLDER%\build\release\flameshot.exe" "distrib\flameshot\flameshot.exe"
- copy "%APPVEYOR_BUILD_FOLDER%\README.md" "distrib\flameshot\README.md"
- copy "%APPVEYOR_BUILD_FOLDER%\LICENSE" "distrib\flameshot\LICENSE.txt"
- copy "%APPVEYOR_BUILD_FOLDER%\docs\flameshot-documentation.pdf" "distrib\flameshot\flameshot-documentation.pdf"
- echo %flameshot_version% > "distrib\flameshot\version.txt"
- echo Build:%build_number% >> "distrib\flameshot\version.txt"
- echo %APPVEYOR_REPO_COMMIT% >> "distrib\flameshot\version.txt"
- copy "distrib\flameshot\flameshot.exe" "distrib\flameshot_win_%PLATFORM%.exe"
- copy "%APPVEYOR_BUILD_FOLDER%\build\translations\Internationalization_*.qm" "distrib\flameshot\translations"
# Delete translations\qt_*.qm
- del /F /Q "distrib\flameshot\translations\qt_*.qm"
# install vcredist-2015
- cd distrib
- if "%PLATFORM%" EQU "X64" (mv flameshot\vcredist_x64.exe flameshot\vcredist.exe)
- if "%PLATFORM%" EQU "x86" (mv flameshot\vcredist_x86.exe flameshot\vcredist.exe)
- 7z a flameshot_%flameshot_version%_win_%PLATFORM%.zip flameshot
# Download and install vcredist-2013 for OpenSSL binnaries
- if "%PLATFORM%" EQU "X64" appveyor DownloadFile https://slproweb.com/download/Win64OpenSSL_Light-1_0_2u.exe
- if "%PLATFORM%" EQU "X64" (mv Win64OpenSSL_Light-1_0_2u.exe flameshot\OpenSSL_Light-1_0_2u.exe)
- if "%PLATFORM%" EQU "x86" appveyor DownloadFile https://slproweb.com/download/Win32OpenSSL_Light-1_0_2u.exe
- if "%PLATFORM%" EQU "x86" (mv Win32OpenSSL_Light-1_0_2u.exe flameshot\OpenSSL_Light-1_0_2u.exe)
- flameshot\OpenSSL_Light-1_0_2u.exe /VERYSILENT /DIR="C:\OpenSSL_Temp"
- cp C:\OpenSSL_Temp\libeay32.dll flameshot\libeay32.dll
- cp C:\OpenSSL_Temp\libssl32.dll flameshot\libssl32.dll
- cp C:\OpenSSL_Temp\ssleay32.dll flameshot\ssleay32.dll
- rm flameshot\OpenSSL_Light-1_0_2u.exe
- if "%PLATFORM%" EQU "X64" appveyor DownloadFile https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe
- if "%PLATFORM%" EQU "X64" (mv vcredist_x64.exe flameshot\vcredist-2013.exe)
- if "%PLATFORM%" EQU "x86" appveyor DownloadFile https://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe
- if "%PLATFORM%" EQU "x86" (mv vcredist_x86.exe flameshot\vcredist-2013.exe)
# Build installation
- cp ..\..\win_setup\flameshot.iss flameshot.iss
- C:\InnoSetup\Compil32.exe /cc flameshot.iss
- mv Output\Flameshot-Setup.exe Output\Flameshot-Setup-%PLATFORM%-%flameshot_version%.exe
mkdir build
cd build
echo %PATH%
cmake c:\projects\source -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE:STRING=Release
cmake --build . --config "Release"
artifacts:
- path: build\distrib\flameshot_%flameshot_version%_win_%PLATFORM%.zip
name: exe_only
- path: build\distrib\Output\Flameshot-Setup-%PLATFORM%-%flameshot_version%.exe
name: installer

30
cmake/Cache.cmake Normal file
View File

@@ -0,0 +1,30 @@
option(ENABLE_CACHE "Enable cache if available" ON)
if(NOT ENABLE_CACHE)
return()
endif()
set(CACHE_OPTION
"ccache"
CACHE STRING "Compiler cache to be used")
set(CACHE_OPTION_VALUES "ccache" "sccache")
set_property(CACHE CACHE_OPTION PROPERTY STRINGS ${CACHE_OPTION_VALUES})
list(
FIND
CACHE_OPTION_VALUES
${CACHE_OPTION}
CACHE_OPTION_INDEX)
if(${CACHE_OPTION_INDEX} EQUAL -1)
message(
STATUS
"Using custom compiler cache system: '${CACHE_OPTION}', explicitly supported entries are ${CACHE_OPTION_VALUES}")
endif()
find_program(CACHE_BINARY ${CACHE_OPTION})
if(CACHE_BINARY)
message(STATUS "${CACHE_OPTION} found and enabled")
set(CMAKE_CXX_COMPILER_LAUNCHER ${CACHE_BINARY})
else()
message(WARNING "${CACHE_OPTION} is enabled but was not found. Not using it")
endif()

View File

@@ -0,0 +1,78 @@
# from here:
#
# https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Avai lable.md
function(set_project_warnings project_name)
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE)
set(MSVC_WARNINGS
/W4 # Baseline reasonable warnings
/w14242 # 'identifier': conversion from 'type1' to 'type1', possible loss of data
/w14254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
/w14263 # 'function': member function does not override any base class virtual member function
/w14265 # 'classname': class has virtual functions, but destructor is not virtual instances of this class may not
# be destructed correctly
/w14287 # 'operator': unsigned/negative constant mismatch
/we4289 # nonstandard extension used: 'variable': loop control variable declared in the for-loop is used outside
# the for-loop scope
/w14296 # 'operator': expression is always 'boolean_value'
/w14311 # 'variable': pointer truncation from 'type1' to 'type2'
/w14545 # expression before comma evaluates to a function which is missing an argument list
/w14546 # function call before comma missing argument list
/w14547 # 'operator': operator before comma has no effect; expected operator with side-effect
/w14549 # 'operator': operator before comma has no effect; did you intend 'operator'?
/w14555 # expression has no effect; expected expression with side- effect
/w14619 # pragma warning: there is no warning number 'number'
/w14640 # Enable warning on thread un-safe static member initialization
/w14826 # Conversion from 'type1' to 'type_2' is sign-extended. This may cause unexpected runtime behavior.
/w14905 # wide string literal cast to 'LPSTR'
/w14906 # string literal cast to 'LPWSTR'
/w14928 # illegal copy-initialization; more than one user-defined conversion has been implicitly applied
/permissive- # standards conformance mode for MSVC compiler.
)
set(CLANG_WARNINGS
-Wall
-Wextra # reasonable and standard
-Wshadow # warn the user if a variable declaration shadows one from a parent context
-Wnon-virtual-dtor # warn the user if a class with virtual functions has a non-virtual destructor. This helps
# catch hard to track down memory errors
-Wold-style-cast # warn for c-style casts
-Wcast-align # warn for potential performance problem casts
-Wunused # warn on anything being unused
-Woverloaded-virtual # warn if you overload (not override) a virtual function
-Wpedantic # warn if non-standard C++ is used
-Wconversion # warn on type conversions that may lose data
-Wsign-conversion # warn on sign conversions
-Wnull-dereference # warn if a null dereference is detected
-Wdouble-promotion # warn if float is implicit promoted to double
-Wformat=2 # warn on security issues around functions that format output (ie printf)
)
if(WARNINGS_AS_ERRORS)
set(CLANG_WARNINGS ${CLANG_WARNINGS} -Werror)
set(MSVC_WARNINGS ${MSVC_WARNINGS} /WX)
endif()
set(GCC_WARNINGS
${CLANG_WARNINGS}
-Wmisleading-indentation # warn if indentation implies blocks where blocks do not exist
-Wduplicated-cond # warn if if / else chain has duplicated conditions
-Wduplicated-branches # warn if if / else branches have duplicated code
-Wlogical-op # warn about logical operations being used where bitwise were probably wanted
-Wuseless-cast # warn if you perform a cast to the same type
)
if(MSVC)
set(PROJECT_WARNINGS ${MSVC_WARNINGS})
elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
set(PROJECT_WARNINGS ${CLANG_WARNINGS})
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(PROJECT_WARNINGS ${GCC_WARNINGS})
else()
message(AUTHOR_WARNING "No compiler warnings set for '${CMAKE_CXX_COMPILER_ID}' compiler.")
endif()
target_compile_options(${project_name} INTERFACE ${PROJECT_WARNINGS})
endfunction()

66
cmake/Sanitizers.cmake Normal file
View File

@@ -0,0 +1,66 @@
function(enable_sanitizers project_name)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE)
if(ENABLE_COVERAGE)
target_compile_options(${project_name} INTERFACE --coverage -O0 -g)
target_link_libraries(${project_name} INTERFACE --coverage)
endif()
set(SANITIZERS "")
option(ENABLE_SANITIZER_ADDRESS "Enable address sanitizer" FALSE)
if(ENABLE_SANITIZER_ADDRESS)
list(APPEND SANITIZERS "address")
endif()
option(ENABLE_SANITIZER_LEAK "Enable leak sanitizer" FALSE)
if(ENABLE_SANITIZER_LEAK)
list(APPEND SANITIZERS "leak")
endif()
option(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR "Enable undefined behavior sanitizer" FALSE)
if(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR)
list(APPEND SANITIZERS "undefined")
endif()
option(ENABLE_SANITIZER_THREAD "Enable thread sanitizer" FALSE)
if(ENABLE_SANITIZER_THREAD)
if("address" IN_LIST SANITIZERS OR "leak" IN_LIST SANITIZERS)
message(WARNING "Thread sanitizer does not work with Address and Leak sanitizer enabled")
else()
list(APPEND SANITIZERS "thread")
endif()
endif()
option(ENABLE_SANITIZER_MEMORY "Enable memory sanitizer" FALSE)
if(ENABLE_SANITIZER_MEMORY AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
if("address" IN_LIST SANITIZERS
OR "thread" IN_LIST SANITIZERS
OR "leak" IN_LIST SANITIZERS)
message(WARNING "Memory sanitizer does not work with Address, Thread and Leak sanitizer enabled")
else()
list(APPEND SANITIZERS "memory")
endif()
endif()
list(
JOIN
SANITIZERS
","
LIST_OF_SANITIZERS)
endif()
if(LIST_OF_SANITIZERS)
if(NOT
"${LIST_OF_SANITIZERS}"
STREQUAL
"")
target_compile_options(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS})
target_link_libraries(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS})
endif()
endif()
endfunction()

View File

@@ -0,0 +1,34 @@
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.")
set(CMAKE_BUILD_TYPE
RelWithDebInfo
CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui, ccmake
set_property(
CACHE CMAKE_BUILD_TYPE
PROPERTY STRINGS
"Debug"
"Release"
"MinSizeRel"
"RelWithDebInfo")
endif()
# Generate compile_commands.json to make it easier to work with clang based tools
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(ENABLE_IPO "Enable Interprocedural Optimization, aka Link Time Optimization (LTO)" OFF)
if(ENABLE_IPO)
include(CheckIPOSupported)
check_ipo_supported(
RESULT
result
OUTPUT
output)
if(result)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(SEND_ERROR "IPO is not supported: ${output}")
endif()
endif()

View File

@@ -0,0 +1,37 @@
option(ENABLE_CPPCHECK "Enable static analysis with cppcheck" OFF)
option(ENABLE_CLANG_TIDY "Enable static analysis with clang-tidy" OFF)
option(ENABLE_INCLUDE_WHAT_YOU_USE "Enable static analysis with include-what-you-use" OFF)
if(ENABLE_CPPCHECK)
find_program(CPPCHECK cppcheck)
if(CPPCHECK)
set(CMAKE_CXX_CPPCHECK
${CPPCHECK}
--suppress=missingInclude
--enable=all
--inline-suppr
--inconclusive
-i
${CMAKE_SOURCE_DIR}/imgui/lib)
else()
message(SEND_ERROR "cppcheck requested but executable not found")
endif()
endif()
if(ENABLE_CLANG_TIDY)
find_program(CLANGTIDY clang-tidy)
if(CLANGTIDY)
set(CMAKE_CXX_CLANG_TIDY ${CLANGTIDY} -extra-arg=-Wno-unknown-warning-option)
else()
message(SEND_ERROR "clang-tidy requested but executable not found")
endif()
endif()
if(ENABLE_INCLUDE_WHAT_YOU_USE)
find_program(INCLUDE_WHAT_YOU_USE include-what-you-use)
if(INCLUDE_WHAT_YOU_USE)
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${INCLUDE_WHAT_YOU_USE})
else()
message(SEND_ERROR "include-what-you-use requested but executable not found")
endif()
endif()

View File

@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.flameshot.Flameshot
Exec=${CMAKE_INSTALL_FULL_BINDIR}/flameshot

View File

@@ -1,6 +1,6 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.dharkael.Flameshot">
<interface name="org.flameshot.Flameshot">
<!--
graphicCapture:
@@ -14,7 +14,7 @@
<method name="graphicCapture">
<arg name="path" type="s" direction="in"/>
<arg name="delay" type="i" direction="in"/>
<arg name="id" type="i" direction="in"/>
<arg name="id" type="u" direction="in"/>
</method>
<!--
@@ -30,7 +30,7 @@
<arg name="path" type="s" direction="in"/>
<arg name="toClipboard" type="b" direction="in"/>
<arg name="delay" type="i" direction="in"/>
<arg name="id" type="i" direction="in"/>
<arg name="id" type="u" direction="in"/>
</method>
<!--
@@ -57,7 +57,7 @@
<arg name="path" type="s" direction="in"/>
<arg name="toClipboard" type="b" direction="in"/>
<arg name="delay" type="i" direction="in"/>
<arg name="id" type="i" direction="in"/>
<arg name="id" type="u" direction="in"/>
</method>
<!--
@@ -99,7 +99,7 @@
Successful capture signal returning the image.
-->
<signal name="captureTaken">
<arg name="id" type="i" direction="out"/>
<arg name="id" type="u" direction="out"/>
<arg name="rawImage" type="ay" direction="out"/>
</signal>
@@ -110,7 +110,7 @@
Whenever the capture fails.
-->
<signal name="captureFailed">
<arg name="id" type="i" direction="out"/>
<arg name="id" type="u" direction="out"/>
</signal>
</interface>
</node>

5
data/debian/changelog Normal file
View File

@@ -0,0 +1,5 @@
flameshot (0.8.1-1) unstable; urgency=medium
* New stable release.
-- Boyuan Yang <byang@debian.org> Wed, 23 Sep 2020 20:39:29 -0400

1
data/debian/compat Normal file
View File

@@ -0,0 +1 @@
11

View File

@@ -1,24 +1,24 @@
Source: flameshot
Section: graphics
Priority: optional
Maintainer: Juanma Navarro Mañez <juanma1980@gmail.com>
Uploaders:
Boyuan Yang <byang@debian.org>,
Maintainer: Boyuan Yang <byang@debian.org>
Build-Depends:
debhelper (>= 9),
qt5-qmake,
qtbase5-dev,
qttools5-dev-tools,
libqt5svg5-dev,
Standards-Version: 4.3.0
Homepage: https://github.com/lupoDharkael/flameshot
Vcs-Browser: https://github.com/lupoDharkael/flameshot
Vcs-Git: https://github.com/lupoDharkael/flameshot.git
cmake (>= 3.13~),
debhelper (>= 11),
qtbase5-dev (>= 5.9.0~),
qttools5-dev (>= 5.9.0~),
qttools5-dev-tools (>= 5.9.0~),
libqt5svg5-dev (>= 5.9.0~),
Standards-Version: 4.5.0
Homepage: https://github.com/flameshot-org/flameshot
Vcs-Browser: https://github.com/flameshot-org/flameshot
Vcs-Git: https://github.com/flameshot-org/flameshot.git
Package: flameshot
Architecture: any
Depends:
libqt5svg5,
hicolor-icon-theme,
libqt5svg5 (>= 5.9.0~),
${shlibs:Depends},
${misc:Depends},
Suggests:

View File

@@ -1,29 +1,33 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: flameshot
Source: https://github.com/lupoDharkael/flameshot/
Source: https://github.com/flameshot-org/flameshot/
Files: *
Copyright: 2016-2019 lupoDharkael <izhe@hotmail.es>
License: GPL-3+
Comments:
Comment:
The author copied a few lines of code from KSnapshot regiongrabber.cpp
revision 796531 (LGPL).
Files: debian/*
Copyright: 2017 Juanma Navarro Mañez <juanma1980@gmail.com>
2018-2019 Boyuan Yang <byang@debian.org>
2018 Boyuan Yang <byang@debian.org>
License: GPL-3+
Files: img/flameshot.*
Files:
data/img/app/flameshot.*
data/img/hicolor/*
Copyright: 2017 lupoDharkael <izhe@hotmail.es>
License: Free-Art-License-1.3
Files:
docs/appdata/flameshot.appdata.xml
docs/appdata/flameshot.metainfo.xml
Copyright: 2017-2019 lupoDharkael <izhe@hotmail.es>
License: CC0-1.0
Files: img/buttonIconsBlack/* img/buttonIconsWhite/*
Files:
data/img/material/black/*
data/img/material/white/*
Copyright: Google Inc.
License: Apache-2.0
@@ -32,7 +36,7 @@ Copyright: 2017 Alejandro Sirgo Rica
2017 Christian Kaiser <info@ckaiser.com.ar>
2007 Luca Gugelmann <lucag@student.ethz.ch>
License: GPL-3+
Comments:
Comment:
Relicensed under GPL-3+ under flameshot project.
.
Originally based on Lightscreen areadialog.h,
@@ -43,14 +47,14 @@ Comments:
Copyright 2007 Luca Gugelmann <lucag@student.ethz.ch>
released under the GNU LGPL <http://www.gnu.org/licenses/old-licenses/library.txt>
Files: src/third-party/singleapplication/*
Files: external/singleapplication/*
Copyright: 2015 - 2016 Itay Grudev
License: Expat
Files: src/third-party/Qt-Color-Widgets/*
Files: external/Qt-Color-Widgets/*
Copyright: 2013-2017 Mattia Basaglia <mattia.basaglia@gmail.com>
License: LGPL-3+
Comments:
Comment:
As a special exception, this library can be included in any project under the
terms of any of the GNU licenses, distributing the whole project under a
different GNU license, see LICENSE-EXCEPTION for details.
@@ -362,8 +366,8 @@ License: Free-Art-License-1.3
(without any changes).
.
Translation : Jonathan Clarke, Benjamin Jean, Griselda Jung, Fanny
Mourguet, Antoine Pitrou. Thanks to framalang.org
Mourguet, Antoine Pitrou. Thanks to framalang.org
License: GPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -21,4 +21,4 @@ export QT_SELECT := 5
override_dh_auto_configure:
# The existence of an empty .git directory triggers syncqt.
mkdir .git || true
dh_auto_configure -- CONFIG+=packaging CONFIG-=debug CONFIG+=release
dh_auto_configure --

View File

@@ -0,0 +1 @@
3.0 (native)

View File

@@ -0,0 +1,32 @@
app-id: org.flameshot.flameshot
runtime: org.kde.Platform
runtime-version: '5.15'
sdk: org.kde.Sdk
command: flameshot
finish-args:
# X11 + XShm access
- --share=ipc
- --socket=x11
# Wayland access
- --socket=wayland
- --device=dri
# Connectivity
- --share=network
# QtSingleApplication, allow other instances to see log files
- --env=TMPDIR=/var/tmp
# Allow loading/saving files from anywhere
- --filesystem=host
# Notification access
- --talk-name=org.freedesktop.Notifications
# System Tray Icon
- --talk-name=org.kde.StatusNotifierWatcher
- --own-name=org.kde.StatusNotifierItem-2-1
modules:
- name: flameshot
buildsystem: cmake-ninja
config-opts:
- -DCMAKE_BUILD_TYPE=Release
sources:
- type: git
url: https://github.com/flameshot-org/flameshot.git
branch: master

View File

@@ -32,7 +32,7 @@
<file>img/material/black/cloud-upload.svg</file>
<file>img/material/black/close.svg</file>
<file>img/material/black/circle-outline.svg</file>
<file>img/material/black/blur.svg</file>
<file>img/material/black/pixelate.svg</file>
<file>img/material/black/arrow-bottom-left.svg</file>
<file>img/material/white/undo-variant.svg</file>
<file>img/material/white/text.svg</file>
@@ -63,9 +63,10 @@
<file>img/material/white/cloud-upload.svg</file>
<file>img/material/white/close.svg</file>
<file>img/material/white/circle-outline.svg</file>
<file>img/material/white/blur.svg</file>
<file>img/material/white/pixelate.svg</file>
<file>img/material/white/arrow-bottom-left.svg</file>
<file>img/app/keyboard.svg</file>
<file>img/material/black/circlecount-outline.svg</file>
<file>img/material/white/circlecount-outline.svg</file>
<file>img/material/black/shortcut.svg</file>
<file>img/material/white/shortcut.svg</file>
<file>img/material/black/filepath.svg</file>

1
data/icon.rc Normal file
View File

@@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "img/app/flameshot.ico"

View File

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 180 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 101 B

After

Width:  |  Height:  |  Size: 101 B

View File

Before

Width:  |  Height:  |  Size: 469 B

After

Width:  |  Height:  |  Size: 469 B

View File

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 24 24"
version="1.1"
id="svg76"
sodipodi:docname="circlecount-outline.svg"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
inkscape:export-filename="/home/jeremy/flameshot/img/material/black/circlecount-outline.svg.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<metadata
id="metadata82">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs80" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1054"
id="namedview78"
showgrid="false"
inkscape:zoom="12.3891"
inkscape:cx="-0.75693185"
inkscape:cy="16.377941"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg76"
showguides="true"
inkscape:guide-bbox="true">
<sodipodi:guide
position="7.5053507,12.014269"
orientation="0,1"
id="guide32"
inkscape:locked="false" />
<sodipodi:guide
position="12.071344,11.129608"
orientation="1,0"
id="guide34"
inkscape:locked="false" />
</sodipodi:namedview>
<path
d="M12,20C7.58,20 4,16.42 4,12C4,7.58 7.58,4 12,4C16.42,4 20,7.58 20,12C20,16.42 16.42,20 12,20M12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2Z"
id="path74" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:16px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
x="6.6492271"
y="17.579073"
id="text86"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"><tspan
sodipodi:role="line"
id="tspan84"
x="6.6492271"
y="17.579073">1</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

View File

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 159 B

View File

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 344 B

View File

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 244 B

View File

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 332 B

View File

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

View File

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 360 B

View File

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 280 B

View File

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 224 B

View File

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

View File

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 274 B

View File

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 240 B

View File

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 266 B

View File

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 282 B

View File

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 242 B

View File

Before

Width:  |  Height:  |  Size: 871 B

After

Width:  |  Height:  |  Size: 871 B

View File

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 332 B

View File

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 327 B

View File

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 321 B

View File

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 272 B

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

View File

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 194 B

View File

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 146 B

View File

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

View File

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 254 B

View File

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 326 B

View File

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

View File

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 151 B

View File

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 333 B

View File

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 335 B

View File

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 339 B

View File

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 179 B

View File

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 159 B

View File

Before

Width:  |  Height:  |  Size: 74 B

After

Width:  |  Height:  |  Size: 74 B

View File

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 270 B

View File

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 175 B

View File

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 249 B

View File

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 197 B

View File

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

View File

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 360 B

View File

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 325 B

After

Width:  |  Height:  |  Size: 325 B

View File

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 251 B

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

View File

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 213 B

Some files were not shown because too many files have changed in this diff Show More