Skip to content
Open
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
7 changes: 4 additions & 3 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@ on:
jobs:
clang-tidy:
runs-on: ubuntu-latest
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-6.8.1-2
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-forky-6.9.2-3
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 2
- name: Prepare compile_commands.json
run: |
cmake -G Ninja -B build -DCMAKE_PREFIX_PATH=/opt/qt -DQT_MAJOR_VERSION=6 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DOPENSSL_ROOT_DIR=/usr/local/lib64
cmake -G Ninja -B build -DQT_MAJOR_VERSION=6 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1
cd build && ninja
- name: Create results directory
run: |
mkdir clang-tidy-result
- name: Analyze
run: |
/usr/bin/git config --global --add safe.directory "$GITHUB_WORKSPACE"
/usr/bin/git diff -U0 HEAD^ | clang-tidy-diff-15.py -checks='-*,modernize-use-auto,modernize-use-using,modernize-use-nodiscard,modernize-use-nullptr,modernize-use-override,cppcoreguidelines-pro-type-static-cast-downcast' -p1 -path build -export-fixes clang-tidy-result/fixes.yml
/usr/bin/git diff -U0 HEAD^ | clang-tidy-diff-21.py -checks='-*,modernize-use-auto,modernize-use-using,modernize-use-nodiscard,modernize-use-nullptr,modernize-use-override,cppcoreguidelines-pro-type-static-cast-downcast' -p1 -path build -export-fixes clang-tidy-result/fixes.yml
- name: Run clang-tidy-pr-comments action
uses: platisd/clang-tidy-pr-comments@28cfb84edafa771c044bde7e4a2a3fae57463818 # v1.6.1 # >1.4.3 switches to composite method w/ a forced python version and breaks things: https://github.com/actions/setup-python/issues/871
with:
python_path: "/usr/bin/python3"
# The GitHub token (or a personal access token)
github_token: ${{ secrets.GITHUB_TOKEN }}
# The path to the clang-tidy fixes generated previously
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
name: Linux Appimage Package
runs-on: ubuntu-latest
container: ghcr.io/nextcloud/continuous-integration-client-appimage-qt6:client-appimage-el8-6.9.3-2
container: ghcr.io/nextcloud/continuous-integration-client-appimage-qt6:client-appimage-el8-6.10.1-1
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-clang-compile-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
name: Linux Clang compilation and tests
runs-on: ubuntu-latest
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-forky-6.9.2-1
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-forky-6.9.2-3
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-gcc-compile-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
name: Linux GCC compilation and tests
runs-on: ubuntu-latest
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-forky-6.9.2-1
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-forky-6.9.2-3
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos-craft-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ jobs:
- name: Add required blueprint repositories
if: steps.cache-craft-restore.outputs.cache-hit != 'true'
run: |
python "${{ env.CRAFT_MASTER_LOCATION }}/CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c --add-blueprint-repository "https://github.com/nextcloud/craft-blueprints-kde.git|next|"
python "${{ env.CRAFT_MASTER_LOCATION }}/CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c --add-blueprint-repository "https://github.com/nextcloud/desktop-client-blueprints.git|next|"
python "${{ env.CRAFT_MASTER_LOCATION }}/CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c --add-blueprint-repository "https://github.com/nextcloud/craft-blueprints-kde.git|master|"
python "${{ env.CRAFT_MASTER_LOCATION }}/CraftMaster.py" --config "${{ env.CRAFT_MASTER_CONFIG }}" --target ${{ env.CRAFT_TARGET }} -c --add-blueprint-repository "https://github.com/nextcloud/desktop-client-blueprints.git|master|"

- name: Setup Craft
if: steps.cache-craft-restore.outputs.cache-hit != 'true'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
name: SonarCloud analysis
runs-on: [ubuntu-latest, self-hosted]
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-6.8.1-2
container: ghcr.io/nextcloud/continuous-integration-client-qt6:client-forky-6.9.2-3
env:
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
Expand All @@ -27,7 +27,7 @@ jobs:
run: |
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_PREFIX_PATH=/opt/qt -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_BUILD_TYPE=Debug -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DQT_MAJOR_VERSION=6 -DCMAKE_CXX_FLAGS=-Werror -DOPENSSL_ROOT_DIR=/usr/local/lib64 -DBUILD_COVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake .. -G Ninja -DCMAKE_PREFIX_PATH=/opt/qt -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DQUICK_COMPILER=ON -DBUILD_UPDATER=ON -DBUILD_TESTING=1 -DQT_MAJOR_VERSION=6 -DCMAKE_CXX_FLAGS=-Werror -DOPENSSL_ROOT_DIR=/usr/local/lib64 -DBUILD_COVERAGE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} ninja
- name: Run tests
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
if($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
}

craft --add-blueprint-repository "https://github.com/nextcloud/craft-blueprints-kde.git|stable-4.0|"
craft --add-blueprint-repository "https://github.com/nextcloud/desktop-client-blueprints.git|stable-4.0|"
craft --add-blueprint-repository "https://github.com/nextcloud/craft-blueprints-kde.git|master|"
craft --add-blueprint-repository "https://github.com/nextcloud/desktop-client-blueprints.git|master|"
craft craft
craft --install-deps nextcloud-client

Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ if(BUILD_CLIENT)
find_package(ZLIB REQUIRED)
find_package(SQLite3 3.9.0 REQUIRED)

find_package(KDSingleApplication-qt6 REQUIRED)

if(NOT WIN32 AND NOT APPLE)
find_package(PkgConfig REQUIRED)
pkg_check_modules(CLOUDPROVIDERS cloudproviders IMPORTED_TARGET)
Expand Down
8 changes: 4 additions & 4 deletions craftmaster.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[General]
Branch = master
# CraftUrl = https://github.com/allexzander/craft.git
CraftRevision = 05fc0f0e7cb6cb5e8ee7eccba400ad4a2b590657
CraftRevision = 7b73acd32984b67d7e1054c9a02e3d86eca9a030
ShallowClone = False

# Variables defined here override the default value
Expand All @@ -28,7 +28,7 @@ ShortPath/Enabled = False
ShortPath/EnableJunctions = False

Packager/RepositoryUrl = https://download.nextcloud.com/desktop/development/craftCache/
Packager/CacheVersion = stable-4.0-qt-6.9.3
Packager/CacheVersion = master-qt-6.10.1
ContinuousIntegration/Enabled = True

Packager/UseCache = ${Variables:UseCache}
Expand All @@ -38,8 +38,8 @@ Packager/CacheDir = ${Variables:Root}\cache
[BlueprintSettings]
nextcloud-client.buildTests = True
binary/mysql.useMariaDB = False
libs/qt6.version = 6.9.3
craft/craft-blueprints-kde.revision = stable-4.0
libs/qt6.version = 6.10.1
craft/craft-blueprints-kde.revision = master

[windows-msvc2022_64-cl]
Packager/PackageType = NullsoftInstallerPackager
Expand Down
1 change: 1 addition & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ target_link_libraries(nextcloudCore
Qt::QuickControls2
Qt::QuickWidgets
KF6::Archive
KDAB::kdsingleapplication
)

if(KF6GuiAddons_FOUND)
Expand Down
35 changes: 23 additions & 12 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

#include "application.h"

#include <iostream>
#include <random>

#include "account.h"
#include "accountmanager.h"
#include "accountsetupcommandlinemanager.h"
Expand All @@ -23,11 +20,8 @@
#include "folderman.h"
#include "logger.h"
#include "pushnotifications.h"
#include "shellextensionsserver.h"
#include "socketapi/socketapi.h"
#include "sslerrordialog.h"
#include "theme.h"
#include "updatechannel.h"

#if defined(BUILD_UPDATER)
#include "updater/ocupdater.h"
Expand All @@ -42,6 +36,7 @@

#if defined(Q_OS_WIN)
#include <windows.h>
#include "shellextensionsserver.h"
#elif defined(Q_OS_MACOS)
#include "macOS/fileprovider.h"
#endif
Expand All @@ -56,6 +51,11 @@
#include <QVersionNumber>
#include <QRandomGenerator>
#include <QHttp2Configuration>
#include <QPushButton>
#include <QAbstractButton>
#include <QFileOpenEvent>

#include <iostream>

class QSocket;

Expand Down Expand Up @@ -216,7 +216,7 @@ ownCloudGui *Application::gui() const
}

Application::Application(int &argc, char **argv)
: SharedTools::QtSingleApplication(Theme::instance()->appName(), argc, argv)
: QApplication{argc, argv}
, _gui(nullptr)
, _theme(Theme::instance())
{
Expand Down Expand Up @@ -317,7 +317,7 @@ Application::Application(int &argc, char **argv)
return;
}

if (isRunning()) {
if (!_singleApp.isPrimaryInstance()) {
return;
}

Expand Down Expand Up @@ -386,7 +386,7 @@ Application::Application(int &argc, char **argv)
_shellExtensionsServer.reset(new ShellExtensionsServer);
#endif

connect(this, &SharedTools::QtSingleApplication::messageReceived, this, &Application::slotParseMessage);
connect(&_singleApp, &KDSingleApplication::messageReceived, this, &Application::slotParseMessage);

// create accounts and folders from a legacy desktop client or from the current config file
setupAccountsAndFolders();
Expand Down Expand Up @@ -753,11 +753,12 @@ void Application::setupLogging()
qCInfo(lcApplication) << "Arguments:" << qApp->arguments();
}

void Application::slotParseMessage(const QString &msg, QObject *)
void Application::slotParseMessage(const QByteArray &message)
{
const auto msg = QString::fromLatin1(message);
if (msg.startsWith(QLatin1String("MSG_PARSEOPTIONS:"))) {
const int lengthOfMsgPrefix = 17;
QStringList options = msg.mid(lengthOfMsgPrefix).split(QLatin1Char('|'));
const auto options = msg.mid(lengthOfMsgPrefix).split(QLatin1Char{'|'});
_showLogWindow = false;
parseOptions(options);
setupLogging();
Expand Down Expand Up @@ -962,6 +963,16 @@ void Application::showVersion()
displayHelpText(Theme::instance()->versionSwitchOutput());
}

bool Application::isRunning() const
{
return !_singleApp.isPrimaryInstance();
}

bool Application::sendMessage(const QString &message)
{
return _singleApp.sendMessage(message.toLatin1());
}

void Application::showHint(std::string errorHint)
{
static QString binName = QFileInfo(QCoreApplication::applicationFilePath()).fileName();
Expand Down Expand Up @@ -1156,7 +1167,7 @@ bool Application::event(QEvent *event)
qCInfo(lcApplication) << "application palette changed";
emit systemPaletteChanged();
}
return SharedTools::QtSingleApplication::event(event);
return QGuiApplication::event(event);
}

} // namespace OCC
27 changes: 15 additions & 12 deletions src/gui/application.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2014 ownCloud GmbH
Expand All @@ -7,23 +7,20 @@
#ifndef APPLICATION_H
#define APPLICATION_H

#include "owncloudgui.h"
#include "progressdispatcher.h"
#include "clientproxy.h"
#include "folderman.h"

#include <KDSingleApplication>

#include <QApplication>
#include <QPointer>
#include <QQueue>
#include <QTimer>
#include <QElapsedTimer>
#include <QNetworkInformation>

#include "qtsingleapplication.h"

#include "syncresult.h"
#include "logbrowser.h"
#include "owncloudgui.h"
#include "connectionvalidator.h"
#include "progressdispatcher.h"
#include "clientproxy.h"
#include "folderman.h"

class QMessageBox;
class QSystemTrayIcon;
class QSocket;
Expand All @@ -41,7 +38,7 @@
* @brief The Application class
* @ingroup gui
*/
class Application : public SharedTools::QtSingleApplication
class Application : public QApplication
{
Q_OBJECT
public:
Expand All @@ -56,6 +53,10 @@
bool versionOnly(); // only display the version?
void showVersion();

[[nodiscard]] bool isRunning() const;

bool sendMessage(const QString &message);

void showMainDialog();

[[nodiscard]] ownCloudGui *gui() const;
Expand Down Expand Up @@ -87,7 +88,7 @@
void systemPaletteChanged();

protected slots:
void slotParseMessage(const QString &, QObject *);
void slotParseMessage(const QByteArray &msg);
void slotCheckConnection();
void slotCleanup();
void slotAccountStateAdded(OCC::AccountState *accountState);
Expand All @@ -112,6 +113,8 @@

QPointer<ownCloudGui> _gui;

KDSingleApplication _singleApp;

Theme *_theme;

bool _helpOnly = false;
Expand Down
1 change: 1 addition & 0 deletions src/gui/networksettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "folderman.h"
#include "theme.h"

#include <QShowEvent>
#include <QNetworkProxy>
#include <QString>
#include <QList>
Expand Down
Loading