Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide consistent version info including human readable version #7857

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions VERSION.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ set( MIRALL_VERSION_STRING ${MIRALL_VERSION} )
set( MIRALL_VERSION_FULL "${MIRALL_VERSION_FULL}.${MIRALL_VERSION_BUILD}" )

set( MIRALL_VERSION_STRING "${MIRALL_VERSION}${MIRALL_VERSION_SUFFIX}" )
if(MIRALL_VERSION_PATCH VERSION_GREATER_EQUAL "50")
set (MIRALL_HUMAN_VERSION_STRING "3.17.0 alpha")
else()
set (MIRALL_HUMAN_VERSION_STRING ${MIRALL_VERSION_STRING})
endif()

if( MIRALL_VERSION_BUILD )
set( MIRALL_VERSION_STRING "${MIRALL_VERSION_STRING} (build ${MIRALL_VERSION_BUILD})" )
Expand Down
30 changes: 15 additions & 15 deletions src/libsync/theme.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/libsync/theme.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/libsync/theme.cpp

File src/libsync/theme.cpp does not conform to Custom style guidelines. (lines 419, 608)
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -410,6 +410,18 @@
#endif
}

QString Theme::developerStringInfo() const
{
// Shorten Qt's OS name: "macOS Mojave (10.14)" -> "macOS"
const auto osStringList = Utility::platformName().split(QLatin1Char(' '));
const auto osName = osStringList.at(0);

const auto devString = QString(tr("<p>%1 Desktop Client Version %2 (%3). For more information please click <a href='%4'>here</a>.</p>", "%1 is application name. %2 is the human version string. %3 is the operating system name. %4 is the help URL"))
.arg(APPLICATION_NAME, QString::fromLatin1(MIRALL_HUMAN_VERSION_STRING), osName, helpUrl());

return devString;
}

// If this option returns true, the client only supports one folder to sync.
// The Add-Button is removed accordingly.
bool Theme::singleSyncFolder() const
Expand Down Expand Up @@ -592,13 +604,8 @@

QString Theme::aboutInfo() const
{
// Shorten Qt's OS name: "macOS Mojave (10.14)" -> "macOS"
QStringList osStringList = Utility::platformName().split(QLatin1Char(' '));
QString osName = osStringList.at(0);

//: Example text: "<p>Nextcloud Desktop Client</p>" (%1 is the application name)
auto devString = QString(tr("<p>%1 Desktop Client</p><p>Version %1. For more information please click <a href='%2'>here</a>.</p>") + QStringLiteral(" (%3)"))
.arg(APPLICATION_NAME, QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION)), helpUrl(), osName);
auto devString = developerStringInfo();


devString += tr("<p><small>Using virtual files plugin: %1</small></p>").arg(Vfs::modeToString(bestAvailableVfsMode()));
Expand All @@ -609,22 +616,15 @@

QString Theme::about() const
{
// Shorten Qt's OS name: "macOS Mojave (10.14)" -> "macOS"
QStringList osStringList = Utility::platformName().split(QLatin1Char(' '));
QString osName = osStringList.at(0);

//: Example text: "<p>Nextcloud Desktop Client</p>" (%1 is the application name)
const auto devString = tr("<p>%1 desktop client %2</p>").arg(APPLICATION_NAME, QString::fromLatin1(MIRALL_STRINGIFY(MIRALL_VERSION)));
const auto devString = developerStringInfo();

return devString;
}

QString Theme::aboutDetails() const
{
QString devString;
devString = tr("<p>Version %1. For more information please click <a href='%2'>here</a>.</p>")
.arg(MIRALL_VERSION_STRING)
.arg(helpUrl());
devString = developerStringInfo();

devString += tr("<p>This release was supplied by %1.</p>")
.arg(APPLICATION_VENDOR);
Expand Down
2 changes: 2 additions & 0 deletions src/libsync/theme.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef _THEME_H
#define _THEME_H

#include <QIcon>

Check failure on line 18 in src/libsync/theme.h

View workflow job for this annotation

GitHub Actions / build

src/libsync/theme.h:18:10 [clang-diagnostic-error]

'QIcon' file not found
#include <QObject>
#include <QPalette>
#include <QGuiApplication>
Expand Down Expand Up @@ -645,6 +645,8 @@
Theme(Theme const &);
Theme &operator=(Theme const &);

[[nodiscard]] QString developerStringInfo() const;

void updateMultipleOverrideServers();
void connectToPaletteSignal() const;
#if defined(Q_OS_WIN)
Expand Down
1 change: 1 addition & 0 deletions version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ constexpr auto MIRALL_VERSION_SUFFIX = "@MIRALL_VERSION_SUFFIX@";
#cmakedefine MIRALL_VERSION_FULL @MIRALL_VERSION_FULL@

#cmakedefine MIRALL_VERSION_STRING "@MIRALL_VERSION_STRING@"
#cmakedefine MIRALL_HUMAN_VERSION_STRING "@MIRALL_HUMAN_VERSION_STRING@"

constexpr int NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MAJOR = @NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MAJOR@;
constexpr int NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MINOR = @NEXTCLOUD_SERVER_VERSION_MIN_SUPPORTED_MINOR@;
Expand Down
Loading