summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartchus2024-01-02 22:43:17 +0100
committerMartchus2024-01-02 22:43:17 +0100
commit867713198e5eb7ee44620bd9cda457d2a0181ab5 (patch)
tree877b1e87a9dcb02fb460e0aee54772236c55da9e
parentcfad5e90e6f92ceddf736248e11c5f454ae2f0a0 (diff)
downloadaur-867713198e5eb7ee44620bd9cda457d2a0181ab5.tar.gz
Update version
-rw-r--r--.SRCINFO8
-rw-r--r--0001-Mock-setting-the-autostart-path-in-the-wizard-test.patch140
-rw-r--r--PKGBUILD13
3 files changed, 6 insertions, 155 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e77e94a1609d..e3e74be8da78 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = syncthingtray
pkgdesc = Tray application for Syncthing
- pkgver = 1.4.11
+ pkgver = 1.4.12
pkgrel = 1
url = https://github.com/Martchus/syncthingtray
arch = i686
@@ -31,9 +31,7 @@ pkgbase = syncthingtray
depends = qt5-declarative
optdepends = kio5: KIO plugin for Syncthing actions in Dolphin
optdepends = plasma-workspace: Plasmoid for Plasma 5 desktop
- source = syncthingtray-1.4.11.tar.gz::https://github.com/Martchus/syncthingtray/archive/v1.4.11.tar.gz
- source = 0001-Mock-setting-the-autostart-path-in-the-wizard-test.patch
- sha256sums = 0c48da193eb29338590bb297052a1274284d9c596a5078541c4d7cdf6b6eba6f
- sha256sums = SKIP
+ source = syncthingtray-1.4.12.tar.gz::https://github.com/Martchus/syncthingtray/archive/v1.4.12.tar.gz
+ sha256sums = 569d50ac1fd5799fda86d948b3e15934b14ac469d3055738415f359452e3290f
pkgname = syncthingtray
diff --git a/0001-Mock-setting-the-autostart-path-in-the-wizard-test.patch b/0001-Mock-setting-the-autostart-path-in-the-wizard-test.patch
deleted file mode 100644
index 11fcac72cc72..000000000000
--- a/0001-Mock-setting-the-autostart-path-in-the-wizard-test.patch
+++ /dev/null
@@ -1,140 +0,0 @@
-From 549be45b55e401d2d22a07c87c85ccc9d1e4bbd8 Mon Sep 17 00:00:00 2001
-From: Martchus <martchus@gmx.net>
-Date: Fri, 22 Dec 2023 17:33:21 +0100
-Subject: [PATCH] Mock setting the autostart path in the wizard test
-
-This test would keep the autostart disabled but override an existing
-autostart entry (see https://github.com/Martchus/syncthingtray/issues/221).
-With this change it will no longer override an existing entry. Reading and
-writing the autostart entry is now mocked and properly checked.
----
- syncthingwidgets/settings/settingsdialog.cpp | 7 ++++++
- syncthingwidgets/tests/wizard.cpp | 26 ++++++++++++++++++--
- 2 files changed, 31 insertions(+), 2 deletions(-)
-
-diff --git a/syncthingwidgets/settings/settingsdialog.cpp b/syncthingwidgets/settings/settingsdialog.cpp
-index bf3f778..c1ebdb0 100644
---- a/syncthingwidgets/settings/settingsdialog.cpp
-+++ b/syncthingwidgets/settings/settingsdialog.cpp
-@@ -818,6 +818,10 @@ QWidget *AutostartOptionPage::setupWidget()
- */
- std::optional<QString> configuredAutostartPath()
- {
-+ if (qEnvironmentVariableIsSet(PROJECT_VARNAME_UPPER "_AUTOSTART_PATH_MOCK")) {
-+ auto mockedPath = qEnvironmentVariable(PROJECT_VARNAME_UPPER "_AUTOSTART_PATH_MOCK");
-+ return mockedPath.isEmpty() ? std::nullopt : std::make_optional(mockedPath);
-+ }
- #if defined(PLATFORM_LINUX) && !defined(Q_OS_ANDROID)
- auto desktopFile = QFile(QStandardPaths::locate(QStandardPaths::ConfigLocation, QStringLiteral("autostart/" PROJECT_NAME ".desktop")));
- // check whether the file can be opened and whether it is enabled but prevent reading large files
-@@ -873,6 +877,9 @@ QString supposedAutostartPath()
- */
- bool setAutostartPath(const QString &path)
- {
-+ if (qEnvironmentVariableIsSet(PROJECT_VARNAME_UPPER "_AUTOSTART_PATH_MOCK")) {
-+ return qputenv(PROJECT_VARNAME_UPPER "_AUTOSTART_PATH_MOCK", path.toLocal8Bit());
-+ }
- #if defined(PLATFORM_LINUX) && !defined(Q_OS_ANDROID)
- const auto configPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
- if (configPath.isEmpty()) {
-diff --git a/syncthingwidgets/tests/wizard.cpp b/syncthingwidgets/tests/wizard.cpp
-index 8fc00d7..8e6eb09 100644
---- a/syncthingwidgets/tests/wizard.cpp
-+++ b/syncthingwidgets/tests/wizard.cpp
-@@ -6,9 +6,12 @@
- // use meta-data of syncthingtray application here
- #include "resources/../../tray/resources/config.h"
-
-+#include <qtutilities/misc/compat.h>
-+
- #include <QtTest/QtTest>
-
- #include <QApplication>
-+#include <QCheckBox>
- #include <QCommandLinkButton>
- #include <QDebug>
- #include <QEventLoop>
-@@ -148,6 +151,9 @@ void WizardTests::testShowingSettings()
- */
- void WizardTests::testConfiguringLauncher()
- {
-+ // mock the autostart path; it is supposed to be preserved
-+ QVERIFY(qputenv(PROJECT_VARNAME_UPPER "_AUTOSTART_PATH_MOCK", "fake-autostart-path"));
-+
- // pretend libsyncthing / systemd is already enabled
- // note: Should be unset as we're selecting to use an external binary.
- auto &settings = Settings::values();
-@@ -188,6 +194,9 @@ void WizardTests::testConfiguringLauncher()
- auto *const mainConfigPage = qobject_cast<MainConfigWizardPage *>(wizardDlg.currentPage());
- QVERIFY(mainConfigPage != nullptr);
- auto &setupDetection = wizardDlg.setupDetection();
-+ const auto &configuredAutostartPath = setupDetection.autostartConfiguredPath;
-+ QVERIFY(configuredAutostartPath.has_value());
-+ QCOMPARE(configuredAutostartPath.value(), QStringLiteral("fake-autostart-path"));
- QVERIFY(!setupDetection.hasConfig());
- // -> print debug output in certain launcher error cases to get the full picture if any of the subsequent checks fail
- if (setupDetection.launcherError.has_value()) {
-@@ -223,6 +232,10 @@ void WizardTests::testConfiguringLauncher()
- // keep autostart setting as-is
- auto *const autostartPage = qobject_cast<AutostartWizardPage *>(wizardDlg.currentPage());
- QVERIFY(autostartPage != nullptr);
-+ auto *const keepExistingCheckBox = autostartPage->findChild<QCheckBox *>(QStringLiteral("keepExistingCheckBox"));
-+ QVERIFY(keepExistingCheckBox != nullptr);
-+ QVERIFY(keepExistingCheckBox->isVisible());
-+ keepExistingCheckBox->setChecked(true);
- wizardDlg.next();
-
- // apply settings
-@@ -233,7 +246,7 @@ void WizardTests::testConfiguringLauncher()
- const auto summary = summaryTextBrowser->toPlainText();
- QVERIFY(summary.contains(QStringLiteral("Start Syncthing via Syncthing Tray's launcher")));
- QVERIFY(summary.contains(QStringLiteral("executable from PATH as separate process")));
-- QVERIFY(summary.contains(QStringLiteral("Keep autostart")));
-+ QVERIFY(summary.contains(QStringLiteral("Keep autostart disabled")) || summary.contains(QStringLiteral("Preserve existing autostart entry")));
- wizardDlg.next();
-
- // check results
-@@ -343,6 +356,7 @@ void WizardTests::testConfiguringLauncher()
- QVERIFY(!settings.connection.primary.syncthingUrl.isEmpty());
- QVERIFY(!settings.connection.primary.apiKey.isEmpty());
- QCOMPARE(settings.connection.secondary.size(), 0);
-+ QCOMPARE(qEnvironmentVariable(PROJECT_VARNAME_UPPER "_AUTOSTART_PATH_MOCK"), QStringLiteral("fake-autostart-path"));
- }
-
- /*!
-@@ -351,6 +365,9 @@ void WizardTests::testConfiguringLauncher()
- */
- void WizardTests::testConfiguringCurrentlyRunningSyncthing()
- {
-+ // mock the autostart path; it is supposed to be changed
-+ QVERIFY(qputenv(PROJECT_VARNAME_UPPER "_AUTOSTART_PATH_MOCK", "fake-autostart-path"));
-+
- // change port in config file
- auto wizardDlg = Wizard();
- auto &setupDetection = wizardDlg.setupDetection();
-@@ -427,9 +444,13 @@ void WizardTests::testConfiguringCurrentlyRunningSyncthing()
- QVERIFY(!cfgNoneRadioButton->isChecked());
- wizardDlg.next();
-
-- // keep autostart setting as-is
-+ // override existing autostart setting
- auto *const autostartPage = qobject_cast<AutostartWizardPage *>(wizardDlg.currentPage());
- QVERIFY(autostartPage != nullptr);
-+ auto *const keepExistingCheckBox = autostartPage->findChild<QCheckBox *>(QStringLiteral("keepExistingCheckBox"));
-+ QVERIFY(keepExistingCheckBox != nullptr);
-+ QVERIFY(keepExistingCheckBox->isVisible());
-+ keepExistingCheckBox->setChecked(false);
- wizardDlg.next();
- configureSyncthingArgs(setupDetection);
-
-@@ -483,6 +504,7 @@ void WizardTests::testConfiguringCurrentlyRunningSyncthing()
- QVERIFY(!settings.connection.primary.apiKey.isEmpty());
- QCOMPARE(settings.connection.secondary.size(), 1);
- QCOMPARE(settings.connection.secondary[0].label, QStringLiteral("Backup of testconfig (created by wizard)"));
-+ QCOMPARE(qEnvironmentVariable(PROJECT_VARNAME_UPPER "_AUTOSTART_PATH_MOCK"), setupDetection.autostartSupposedPath);
- }
-
- bool WizardTests::confirmMessageBox()
---
-2.43.0
-
diff --git a/PKGBUILD b/PKGBUILD
index 0e155c49f5af..ab23abdfac0b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -24,7 +24,7 @@ _enable_plasmoid=${SYNCTHING_TRAY_ENABLE_PLASMOID:-1}
_reponame=syncthingtray
pkgname=syncthingtray
-pkgver=1.4.11
+pkgver=1.4.12
pkgrel=1
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
pkgdesc='Tray application for Syncthing'
@@ -43,20 +43,13 @@ checkdepends=('cppunit' 'syncthing' 'iproute2')
[[ $_enable_kio_plugin ]] && makedepends+=('kio5')
[[ $_enable_plasmoid ]] && makedepends+=('plasma-framework5' 'extra-cmake-modules')
url="https://github.com/Martchus/${_reponame}"
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/archive/v${pkgver}.tar.gz"
- 0001-Mock-setting-the-autostart-path-in-the-wizard-test.patch)
-sha256sums=('0c48da193eb29338590bb297052a1274284d9c596a5078541c4d7cdf6b6eba6f'
- SKIP)
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/archive/v${pkgver}.tar.gz")
+sha256sums=('569d50ac1fd5799fda86d948b3e15934b14ac469d3055738415f359452e3290f')
ephemeral_port() {
comm -23 <(seq 49152 65535) <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort | uniq) | shuf | head -n 1
}
-prepare() {
- cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
- patch -p1 -i ../0001-Mock-setting-the-autostart-path-in-the-wizard-test.patch
-}
-
build() {
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"