mirror of
				https://git.jami.net/savoirfairelinux/jami-client-qt.git
				synced 2025-11-04 08:10:18 +08:00 
			
		
		
		
	Compare commits
	
		
			7 Commits
		
	
	
		
			beta/20250
			...
			beta/20250
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| e7ebc6f04a | |||
| 2bc69b7306 | |||
| a934cd1c70 | |||
| 2d487c8adf | |||
| 5771d07eb4 | |||
| f8d74fb170 | |||
| 7a03b4d410 | 
							
								
								
									
										2
									
								
								.github/FUNDING.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/FUNDING.yml
									
									
									
									
										vendored
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
custom: ['https://jami.net/whydonate/']
 | 
			
		||||
custom: ['https://jami.net/donate/']
 | 
			
		||||
lfx_crowdfunding: jami-a-gnu-package
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										15
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@ -1,15 +1,10 @@
 | 
			
		||||
{
 | 
			
		||||
    "C_Cpp.default.includePath": [
 | 
			
		||||
        "${default}",
 | 
			
		||||
        "${workspaceFolder}/**",
 | 
			
		||||
        "/usr/lib/libqt-jami/include/**",
 | 
			
		||||
        "/usr/lib64/qt-jami/include/**",
 | 
			
		||||
    ],
 | 
			
		||||
    "C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
 | 
			
		||||
    "C_Cpp.default.cppStandard": "c++17",
 | 
			
		||||
    "C_Cpp.default.cStandard": "c11",
 | 
			
		||||
    "cmake.configureOnOpen": true,
 | 
			
		||||
    "cmake.configureOnOpen": false,
 | 
			
		||||
    "editor.formatOnSave": true,
 | 
			
		||||
    "editor.defaultFormatter": "xaver.clang-format",
 | 
			
		||||
    "editor.defaultFormatter": "ms-vscode.cpptools",
 | 
			
		||||
    "files.eol": "\n",
 | 
			
		||||
    "cSpell.enabled": false,
 | 
			
		||||
}
 | 
			
		||||
    "cSpell.enabled": false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								daemon
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								daemon
									
									
									
									
									
								
							 Submodule daemon updated: 798c1fcf69...afe2446133
									
								
							@ -90,7 +90,7 @@
 | 
			
		||||
    <url type="bugtracker">https://git.jami.net/savoirfairelinux/jami-client-qt/issues</url>
 | 
			
		||||
    <url type="faq">https://docs.jami.net/user/faq.html</url>
 | 
			
		||||
    <url type="help">https://forum.jami.net/</url>
 | 
			
		||||
    <url type="donation">https://jami.net/whydonate/</url>
 | 
			
		||||
    <url type="donation">https://jami.net/donate/</url>
 | 
			
		||||
    <url type="translate">https://www.transifex.com/savoirfairelinux/jami</url>
 | 
			
		||||
    <categories>
 | 
			
		||||
      <category>Chat</category>
 | 
			
		||||
 | 
			
		||||
@ -1294,7 +1294,7 @@
 | 
			
		||||
 | 
			
		||||
  <url type="bugtracker">https://git.jami.net/savoirfairelinux/jami-client-qt/issues</url>
 | 
			
		||||
  <url type="homepage">https://jami.net/</url>
 | 
			
		||||
  <url type="donation">https://jami.net/whydonate/</url>
 | 
			
		||||
  <url type="donation">https://jami.net/donate/</url>
 | 
			
		||||
  <url type="faq">https://docs.jami.net/user/faq.html</url>
 | 
			
		||||
  <url type="translate">https://explore.transifex.com/savoirfairelinux/jami/</url>
 | 
			
		||||
  <url type="contribute">https://jami.net/contribute/</url>
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
#   https://snapcraft.io/docs/build-on-docker
 | 
			
		||||
#   https://github.com/canonical/snapcraft/issues/5079#issuecomment-2414199613
 | 
			
		||||
 | 
			
		||||
ARG UBUNTU=jammy
 | 
			
		||||
ARG UBUNTU=noble
 | 
			
		||||
 | 
			
		||||
FROM ubuntu:$UBUNTU AS builder
 | 
			
		||||
ARG UBUNTU
 | 
			
		||||
@ -16,11 +16,6 @@ RUN apt-get install --yes \
 | 
			
		||||
      jq \
 | 
			
		||||
      squashfs-tools
 | 
			
		||||
 | 
			
		||||
# Download and unpack the core22 snap
 | 
			
		||||
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core22' | jq '.download_url' -r) --output core22.snap
 | 
			
		||||
RUN mkdir -p /snap/core22
 | 
			
		||||
RUN unsquashfs -d /snap/core22/current core22.snap
 | 
			
		||||
 | 
			
		||||
# Download and unpack the core24 snap
 | 
			
		||||
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core24' | jq '.download_url' -r) --output core24.snap
 | 
			
		||||
RUN mkdir -p /snap/core24
 | 
			
		||||
@ -43,7 +38,6 @@ RUN chmod +x /snap/bin/snapcraft
 | 
			
		||||
# time so they can be cached.
 | 
			
		||||
FROM ubuntu:$UBUNTU
 | 
			
		||||
 | 
			
		||||
COPY --from=builder /snap/core22 /snap/core22
 | 
			
		||||
COPY --from=builder /snap/core24 /snap/core24
 | 
			
		||||
COPY --from=builder /snap/snapcraft /snap/snapcraft
 | 
			
		||||
COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft
 | 
			
		||||
 | 
			
		||||
@ -98,13 +98,13 @@ description: |
 | 
			
		||||
 | 
			
		||||
confinement: strict
 | 
			
		||||
grade: stable
 | 
			
		||||
base: core22
 | 
			
		||||
base: core24
 | 
			
		||||
 | 
			
		||||
plugs:
 | 
			
		||||
  gnome-42-2204:
 | 
			
		||||
  gnome-46-2404:
 | 
			
		||||
    interface: content
 | 
			
		||||
    target: $SNAP/gnome-platform
 | 
			
		||||
    default-provider: gnome-42-2204
 | 
			
		||||
    default-provider: gnome-46-2404
 | 
			
		||||
  gtk-3-themes:
 | 
			
		||||
    interface: content
 | 
			
		||||
    target: $SNAP/data-dir/themes
 | 
			
		||||
@ -117,6 +117,10 @@ plugs:
 | 
			
		||||
    interface: content
 | 
			
		||||
    target: $SNAP/data-dir/sounds
 | 
			
		||||
    default-provider: gtk-common-themes:sounds-themes
 | 
			
		||||
  gpu-2404:
 | 
			
		||||
    interface: content
 | 
			
		||||
    target: $SNAP/gpu-2404
 | 
			
		||||
    default-provider: mesa-2404
 | 
			
		||||
 | 
			
		||||
slots:
 | 
			
		||||
  dbus-jami:
 | 
			
		||||
@ -135,16 +139,18 @@ layout:
 | 
			
		||||
    bind: $SNAP/usr/share/alsa
 | 
			
		||||
  /usr/share/X11/xkb:
 | 
			
		||||
    bind: $SNAP/usr/share/X11/xkb
 | 
			
		||||
  /usr/share/X11/XErrorDB:
 | 
			
		||||
    symlink: $SNAP/gpu-2404/X11/XErrorDB
 | 
			
		||||
 | 
			
		||||
environment:
 | 
			
		||||
  XDG_CURRENT_DESKTOP: Unity
 | 
			
		||||
  QT_BASE_DIR: "/usr/lib/libqt-jami"
 | 
			
		||||
  LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$SNAP$QT_BASE_DIR/lib:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pulseaudio"
 | 
			
		||||
  LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$SNAP$QT_BASE_DIR/lib:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pulseaudio:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libproxy"
 | 
			
		||||
 | 
			
		||||
apps:
 | 
			
		||||
  jami:
 | 
			
		||||
    command: usr/bin/jami
 | 
			
		||||
    command-chain:
 | 
			
		||||
    - bin/gpu-2404-wrapper
 | 
			
		||||
    - bin/desktop-launch
 | 
			
		||||
    - snap/command-chain/alsa-launch
 | 
			
		||||
    - bin/jami-wrapper
 | 
			
		||||
@ -185,7 +191,7 @@ package-repositories:
 | 
			
		||||
    components: [main]
 | 
			
		||||
    suites: [jami]
 | 
			
		||||
    key-id: A295D773307D25A33AE72F2F64CD5FA175348F84
 | 
			
		||||
    url: https://dl.jami.net/internal/ubuntu_22.04/
 | 
			
		||||
    url: https://dl.jami.net/internal/ubuntu_24.04/
 | 
			
		||||
 | 
			
		||||
parts:
 | 
			
		||||
  desktop-launch:
 | 
			
		||||
@ -244,10 +250,15 @@ parts:
 | 
			
		||||
      - -usr/lib/x86_64-linux-gnu/libproxy.so*
 | 
			
		||||
      - -usr/share/doc/libp11-kit0/changelog.Debian.gz
 | 
			
		||||
      - -usr/share/doc/libproxy1v5/changelog.Debian.gz
 | 
			
		||||
      - -usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
 | 
			
		||||
      - -usr/lib/x86_64-linux-gnu/libdconf.so.1.0.0
 | 
			
		||||
      - -usr/libexec/dconf-service
 | 
			
		||||
      - -usr/share/doc/libdconf1/changelog.Debian.gz
 | 
			
		||||
      - -usr/share/man/man1/dconf-service.1.gz
 | 
			
		||||
    build-packages:
 | 
			
		||||
      - libasound2-dev
 | 
			
		||||
    stage-packages:
 | 
			
		||||
      - libasound2
 | 
			
		||||
      - libasound2t64
 | 
			
		||||
      - libasound2-plugins
 | 
			
		||||
      - yad
 | 
			
		||||
 | 
			
		||||
@ -272,8 +283,6 @@ parts:
 | 
			
		||||
      sed -i -E 's|(tmpName) << (PACKAGE_NAME << "_shm_")|\1 << "snap.jami." << \2|' ./daemon/src/media/video/sinkclient.cpp
 | 
			
		||||
      sed -i -E 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/net.jami.Jami.svg|' extras/data/net.jami.Jami.desktop
 | 
			
		||||
    override-build: |
 | 
			
		||||
      $CRAFT_PART_BUILD/extras/packaging/gnu-linux/scripts/install-pipewire-from-source.sh
 | 
			
		||||
 | 
			
		||||
      cd $CRAFT_PART_BUILD/daemon/contrib
 | 
			
		||||
      mkdir -p native
 | 
			
		||||
      cd native
 | 
			
		||||
@ -288,7 +297,7 @@ parts:
 | 
			
		||||
      DESTDIR=$CRAFT_PART_INSTALL make install
 | 
			
		||||
 | 
			
		||||
      cd $CRAFT_PART_BUILD/
 | 
			
		||||
      mkdir build
 | 
			
		||||
      mkdir -p build
 | 
			
		||||
      cd build
 | 
			
		||||
      cmake .. -DENABLE_LIBWRAP=true \
 | 
			
		||||
               -DLIBJAMI_BUILD_DIR=$CRAFT_PART_BUILD/daemon/src \
 | 
			
		||||
@ -301,7 +310,6 @@ parts:
 | 
			
		||||
      DESTDIR=$CRAFT_PART_INSTALL make install
 | 
			
		||||
    build-packages:
 | 
			
		||||
    - autoconf
 | 
			
		||||
    - autoconf-archive
 | 
			
		||||
    - automake
 | 
			
		||||
    - autopoint
 | 
			
		||||
    - bzip2
 | 
			
		||||
@ -312,8 +320,8 @@ parts:
 | 
			
		||||
    - gettext
 | 
			
		||||
    - gzip
 | 
			
		||||
    - libnotify-dev
 | 
			
		||||
    - libpipewire-0.3-dev
 | 
			
		||||
    - libqrencode-dev
 | 
			
		||||
    - libsndfile1-dev
 | 
			
		||||
    - libspeex-dev
 | 
			
		||||
    - python3
 | 
			
		||||
    - python3-dev
 | 
			
		||||
@ -321,13 +329,9 @@ parts:
 | 
			
		||||
    - yasm
 | 
			
		||||
    - wget
 | 
			
		||||
    - nasm # ffmpeg
 | 
			
		||||
    - libavcodec-dev
 | 
			
		||||
    - libavdevice-dev
 | 
			
		||||
    - libavformat-dev
 | 
			
		||||
    - libswscale-dev
 | 
			
		||||
    - libva-dev
 | 
			
		||||
    - libvdpau-dev
 | 
			
		||||
    - libargon2-0-dev # opendht
 | 
			
		||||
    - libargon2-dev # opendht
 | 
			
		||||
    - libexpat1-dev
 | 
			
		||||
    - libjsoncpp-dev
 | 
			
		||||
    - libnm-dev # connectivityChanged()
 | 
			
		||||
@ -340,51 +344,29 @@ parts:
 | 
			
		||||
    - libgl-dev
 | 
			
		||||
    - libvulkan-dev
 | 
			
		||||
    - libgnutls28-dev # TLS
 | 
			
		||||
    - gnutls-bin
 | 
			
		||||
    - libssl-dev
 | 
			
		||||
    - git            # PipeWire build dependencies
 | 
			
		||||
    - meson          #
 | 
			
		||||
    - libasound2-dev #
 | 
			
		||||
    - libdbus-1-dev  # These packages are needed by the
 | 
			
		||||
    - libglib2.0-dev # install-pipewire-from-source.sh
 | 
			
		||||
    - ninja-build    # script in order to build PipeWire
 | 
			
		||||
    - pkg-config     # from source.
 | 
			
		||||
    stage-packages:
 | 
			
		||||
    - libgnutls30
 | 
			
		||||
    - libavutil56
 | 
			
		||||
    - libdouble-conversion3
 | 
			
		||||
    - libegl1
 | 
			
		||||
    - libgbm1
 | 
			
		||||
    - libgudev-1.0-0
 | 
			
		||||
    - libjsoncpp25
 | 
			
		||||
    - libllvm12
 | 
			
		||||
    - libminizip1
 | 
			
		||||
    - libminizip1t64
 | 
			
		||||
    - libnm0
 | 
			
		||||
    - libnotify4
 | 
			
		||||
    - libnspr4
 | 
			
		||||
    - libnss3
 | 
			
		||||
    - libopengl0
 | 
			
		||||
    - libopus0
 | 
			
		||||
    - liborc-0.4-0
 | 
			
		||||
    - libpcre2-16-0
 | 
			
		||||
    - libpcre2-8-0
 | 
			
		||||
    - pipewire-bin
 | 
			
		||||
    - libqrencode4
 | 
			
		||||
    - libqt-jami
 | 
			
		||||
    - libsnappy1v5
 | 
			
		||||
    - libspeex1
 | 
			
		||||
    - libproxy1v5
 | 
			
		||||
    - libwayland-server0
 | 
			
		||||
    - libwebpdemux2
 | 
			
		||||
    - libwebpmux3
 | 
			
		||||
    - libxkbfile1
 | 
			
		||||
    - libxtst6
 | 
			
		||||
    - ocl-icd-libopencl1
 | 
			
		||||
    - libva-drm2
 | 
			
		||||
    - libva-glx2
 | 
			
		||||
    - libva-wayland2
 | 
			
		||||
    - libva2
 | 
			
		||||
    - libvdpau-va-gl1
 | 
			
		||||
    - libvdpau1
 | 
			
		||||
    - va-driver-all
 | 
			
		||||
    prime:
 | 
			
		||||
    - -usr/lib/libqt-jami/bin/
 | 
			
		||||
    - -usr/lib/libqt-jami/docs/
 | 
			
		||||
@ -392,3 +374,15 @@ parts:
 | 
			
		||||
    - -usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libLLVM-*.so*
 | 
			
		||||
    - -usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libclang-*.so*
 | 
			
		||||
    - -usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libflite*.so*
 | 
			
		||||
 | 
			
		||||
  gpu-2404:
 | 
			
		||||
    after: [jami]
 | 
			
		||||
    source: https://github.com/canonical/gpu-snap.git
 | 
			
		||||
    plugin: dump
 | 
			
		||||
    override-prime: |
 | 
			
		||||
      craftctl default
 | 
			
		||||
      ${CRAFT_PART_SRC}/bin/gpu-2404-cleanup mesa-2404
 | 
			
		||||
      # Workaround for https://bugs.launchpad.net/snapd/+bug/2055273
 | 
			
		||||
      mkdir -p "${CRAFT_PRIME}/gpu-2404"
 | 
			
		||||
    prime:
 | 
			
		||||
    - bin/gpu-2404-wrapper
 | 
			
		||||
@ -32,7 +32,7 @@ sed -i "s/RELEASE_VERSION/${RELEASE_VERSION}/g" snapcraft.yaml
 | 
			
		||||
# set the build version of the app
 | 
			
		||||
sed -i "s/BUILD_VERSION_PLACEHOLDER/${BUILD_VERSION}/g" snapcraft.yaml
 | 
			
		||||
 | 
			
		||||
snapcraft # requires snapcraft >= 4.8
 | 
			
		||||
snapcraft pack
 | 
			
		||||
 | 
			
		||||
# move the built snap to output
 | 
			
		||||
mv *.snap /opt/output/
 | 
			
		||||
 | 
			
		||||
@ -1,30 +0,0 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
# The purpose of this script is to build PipeWire from source in a snap based on core22 / Ubuntu 22.04
 | 
			
		||||
# It must be called in the "override-build" section of the relevant part in snapcraft.yaml
 | 
			
		||||
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
OLD_WD=$(pwd)
 | 
			
		||||
cd /tmp
 | 
			
		||||
 | 
			
		||||
# Build PipeWire 1.0.5 and install it in the /usr directory of the build environment
 | 
			
		||||
wget -q https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/1.0.5/pipewire-1.0.5.tar.gz
 | 
			
		||||
echo "c5a5de26d684a1a84060ad7b6131654fb2835e03fccad85059be92f8e3ffe993  pipewire-1.0.5.tar.gz" | sha256sum --check
 | 
			
		||||
tar xzf pipewire-1.0.5.tar.gz
 | 
			
		||||
cd pipewire-1.0.5
 | 
			
		||||
meson setup builddir -Dsession-managers=media-session -Dalsa=disabled -Dprefix=/usr
 | 
			
		||||
meson compile -C builddir
 | 
			
		||||
meson install -C builddir
 | 
			
		||||
 | 
			
		||||
# The files installed by the previous command are only for the "Build" step of the snap
 | 
			
		||||
# creation process (https://snapcraft.io/docs/how-snapcraft-builds). In order to ensure
 | 
			
		||||
# that PipeWire is installed in the final snap archive, we also need to copy all the
 | 
			
		||||
# required files under the $CRAFT_PART_INSTALL directory.
 | 
			
		||||
meson configure builddir -Dprefix=$CRAFT_PART_INSTALL/usr/
 | 
			
		||||
meson install -C builddir
 | 
			
		||||
 | 
			
		||||
# Cleanup
 | 
			
		||||
cd /tmp
 | 
			
		||||
rm -rf pipewire-1.0.5  pipewire-1.0.5.tar.gz
 | 
			
		||||
cd $OLD_WD
 | 
			
		||||
@ -892,7 +892,7 @@ Item {
 | 
			
		||||
    property string zoomLevel: qsTr("Text zoom level")
 | 
			
		||||
 | 
			
		||||
    // Donation campaign
 | 
			
		||||
    property string donationTipBoxText: qsTr("Free and private sharing. <a href=\"https://jami.net/whydonate/\">Donate</a> to expand it.")
 | 
			
		||||
    property string donationTipBoxText: qsTr("Free and private sharing. <a href=\"https://jami.net/donate/\">Donate</a> to expand it.")
 | 
			
		||||
    property string donation: qsTr("Donate")
 | 
			
		||||
    property string donationText: qsTr("If you enjoy using Jami and believe in our mission, do you want to make a donation?")
 | 
			
		||||
    property string notNow: qsTr("Not now")
 | 
			
		||||
 | 
			
		||||
@ -701,7 +701,7 @@ Item {
 | 
			
		||||
    // Donation campaign
 | 
			
		||||
    property color donationButtonTextColor: "#005699"
 | 
			
		||||
    property color donationBackgroundColor: "#D5E4EF"
 | 
			
		||||
    property string donationUrl: "https://jami.net/whydonate/"
 | 
			
		||||
    property string donationUrl: "https://jami.net/donate/"
 | 
			
		||||
 | 
			
		||||
    //Connection monitoring
 | 
			
		||||
    property color connectionMonitoringTableColor1: darkTheme ? "#4D4D4D" : "#f0efef"
 | 
			
		||||
 | 
			
		||||
@ -56,7 +56,7 @@ ColumnLayout {
 | 
			
		||||
        active: storeAvailable
 | 
			
		||||
        Layout.fillWidth: true
 | 
			
		||||
        Layout.alignment: Qt.AlignHCenter
 | 
			
		||||
        Layout.preferredHeight: active ? item.height : 0
 | 
			
		||||
        Layout.preferredHeight: active ? wrapper.height : 0
 | 
			
		||||
        sourceComponent: Flow {
 | 
			
		||||
            id: pluginStoreList
 | 
			
		||||
            height: childrenRect.height
 | 
			
		||||
 | 
			
		||||
@ -14,6 +14,7 @@
 | 
			
		||||
 *   You should have received a copy of the GNU General Public License      *
 | 
			
		||||
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
 | 
			
		||||
 ***************************************************************************/
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <QString>
 | 
			
		||||
@ -308,29 +309,32 @@ getFormattedCallDuration(const std::time_t duration)
 | 
			
		||||
    if (duration == 0)
 | 
			
		||||
        return {};
 | 
			
		||||
 | 
			
		||||
    int minutes = duration / 60;
 | 
			
		||||
    int seconds = duration % 60;
 | 
			
		||||
    int minutes = duration / 60;
 | 
			
		||||
    int hours = minutes / 60;
 | 
			
		||||
    int days = hours / 24;
 | 
			
		||||
 | 
			
		||||
    if (days > 0) {
 | 
			
		||||
        hours = hours % 24;
 | 
			
		||||
        minutes = minutes % 60;
 | 
			
		||||
        return QString("%1d %2h %3m %4s")
 | 
			
		||||
            .arg(days)
 | 
			
		||||
        return QObject::tr("%4d %3h %2m %1s")
 | 
			
		||||
            .arg(seconds)
 | 
			
		||||
            .arg(minutes)
 | 
			
		||||
            .arg(hours)
 | 
			
		||||
            .arg(minutes, 2, 10, QChar('0'))
 | 
			
		||||
            .arg(seconds, 2, 10, QChar('0'));
 | 
			
		||||
            .arg(days);
 | 
			
		||||
    } else if (hours > 0) {
 | 
			
		||||
        minutes = minutes % 60;
 | 
			
		||||
        return QString("%1h %2m %3s")
 | 
			
		||||
            .arg(hours)
 | 
			
		||||
            .arg(minutes, 2, 10, QChar('0'))
 | 
			
		||||
            .arg(seconds, 2, 10, QChar('0'));
 | 
			
		||||
        return QObject::tr("%3h %2m %1s")
 | 
			
		||||
            .arg(seconds)
 | 
			
		||||
            .arg(minutes)
 | 
			
		||||
            .arg(hours);
 | 
			
		||||
    } else if (minutes > 0) {
 | 
			
		||||
        return QString("%1m %2s").arg(minutes).arg(seconds, 2, 10, QChar('0'));
 | 
			
		||||
        return QObject::tr("%2m %1s")
 | 
			
		||||
            .arg(seconds)
 | 
			
		||||
            .arg(minutes);
 | 
			
		||||
    } else {
 | 
			
		||||
        return QString("%1s").arg(seconds);
 | 
			
		||||
        return QObject::tr("%1s")
 | 
			
		||||
            .arg(seconds);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user