Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package seadrive-gui for openSUSE:Factory 
checked in at 2024-10-21 16:26:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/seadrive-gui (Old)
 and      /work/SRC/openSUSE:Factory/.seadrive-gui.new.26871 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "seadrive-gui"

Mon Oct 21 16:26:06 2024 rev:15 rq:1216668 version:3.0.11

Changes:
--------
--- /work/SRC/openSUSE:Factory/seadrive-gui/seadrive-gui.changes        
2023-11-16 20:29:42.754915568 +0100
+++ /work/SRC/openSUSE:Factory/.seadrive-gui.new.26871/seadrive-gui.changes     
2024-10-21 16:26:23.981451685 +0200
@@ -1,0 +2,8 @@
+Mon Oct 21 08:54:10 UTC 2024 - Paolo Stivanin <[email protected]>
+
+- Update to 3.0.11:
+  * https://github.com/haiwen/seadrive-gui/compare/v2.0.28...v3.0.11
+- Add fix-return.patch
+- Add pr404.patch
+
+-------------------------------------------------------------------

Old:
----
  seadrive-gui-2.0.28.tar.gz

New:
----
  fix-return.patch
  pr404.patch
  seadrive-gui-3.0.11.tar.gz

BETA DEBUG BEGIN:
  New:  * https://github.com/haiwen/seadrive-gui/compare/v2.0.28...v3.0.11
- Add fix-return.patch
- Add pr404.patch
  New:- Add fix-return.patch
- Add pr404.patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ seadrive-gui.spec ++++++
--- /var/tmp/diff_new_pack.JNaZHD/_old  2024-10-21 16:26:24.621478535 +0200
+++ /var/tmp/diff_new_pack.JNaZHD/_new  2024-10-21 16:26:24.625478703 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           seadrive-gui
-Version:        2.0.28
+Version:        3.0.11
 Release:        0
 Summary:        GUI part of seafile drive
 License:        GPL-3.0-only
@@ -25,6 +25,10 @@
 Source0:        
https://github.com/haiwen/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 # PATCH-FIX-UPSTREAM
 Patch1:         fix-cmake-exec-name.patch
+# PATCH-FIX-UPSTREAM https://github.com/haiwen/seadrive-gui/pull/404
+Patch2:         pr404.patch
+# PATCH-FIX-UPSTREAM
+Patch3:         fix-return.patch
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  cmake
@@ -37,7 +41,7 @@
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(libevent)
 BuildRequires:  pkgconfig(uuid)
-Requires:       seadrive-fuse >= 2.0.6
+Requires:       seadrive-fuse >= 2.0.22
 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
 BuildRequires:  jansson-devel
 BuildRequires:  qt5-linguist

++++++ fix-return.patch ++++++
--- seadrive-gui-3.0.11/src/ui/sync-errors-dialog.cpp.orig      2024-10-21 
11:07:51.399951694 +0200
+++ seadrive-gui-3.0.11/src/ui/sync-errors-dialog.cpp   2024-10-21 
11:02:19.781329275 +0200
@@ -242,6 +242,7 @@
 
     return ::pathJoin(account.syncRoot, repo_uname);
 #endif
+    return "";
 }
 
 SyncErrorsTableModel::SyncErrorsTableModel(QObject *parent)

++++++ pr404.patch ++++++
>From 1af9897bc603dcf9ce95ba4e1d0860cbb40c5a91 Mon Sep 17 00:00:00 2001
From: Heran Yang <[email protected]>
Date: Wed, 6 Mar 2024 17:15:55 +0800
Subject: [PATCH 1/2] Support multiple accounts

Support multiple accounts

Modify delete account info
---
 src/account-mgr.cpp    | 26 ++++++++++++++++++++++++++
 src/account-mgr.h      |  3 +++
 src/account.h          |  6 ++++++
 src/daemon-mgr.cpp     | 15 +++++++++++++++
 src/rpc/rpc-client.cpp | 26 ++++++++++++++++++++++++++
 src/seadrive-gui.cpp   | 36 ++++++++++++++++++++++++++++++++++--
 src/seadrive-gui.h     |  3 ++-
 src/ui/tray-icon.cpp   |  2 +-
 8 files changed, 113 insertions(+), 4 deletions(-)

diff --git a/src/account-mgr.cpp b/src/account-mgr.cpp
index 0a1dce45..f16ed0ec 100644
--- a/src/account-mgr.cpp
+++ b/src/account-mgr.cpp
@@ -413,6 +413,8 @@ int AccountManager::resyncAccount(const Account& account)
 
 #if defined(Q_OS_WIN32)
     setAccountSyncRoot(updated_account);
+#elif defined(Q_OS_LINUX)
+    setAccountDisplayName(updated_account);
 #endif
 
     SeafileRpcClient *rpc_client = gui->rpcClient(updated_account.domainID());
@@ -631,6 +633,10 @@ void AccountManager::addAccountToDaemon(const Account& 
account)
         gui->fileProviderManager()->registerDomain(added_account);
         gui->fileProviderManager()->askUserToEnable();
     }
+#elif defined(Q_OS_LINUX)
+    if (added_account.isValid()) {
+        setAccountDisplayName(added_account);
+    }
 #endif
 
 #ifndef Q_OS_MAC
@@ -852,6 +858,26 @@ void AccountManager::setAccountSyncRoot(Account &account)
 }
 #endif
 
+#if defined(Q_OS_LINUX)
+void AccountManager::setAccountDisplayName(Account &account)
+{
+    QString name = account.accountInfo.name;
+    if (name.isEmpty()) {
+        name = account.username;
+    }
+    QString displayName = name + "(" + account.serverUrl.host() + ")";
+    account.displayName = displayName;
+
+    QMutexLocker locker(&accounts_mutex_);
+    for (size_t i = 0; i < accounts_.size(); i++) {
+        if (accounts_.at(i) == account) {
+            accounts_[i].displayName = displayName;
+            break;
+        }
+    }
+}
+#endif
+
 void AccountManager::reloginAccount(const Account &account)
 {
     if (account.isShibboleth) {
diff --git a/src/account-mgr.h b/src/account-mgr.h
index 3976b543..b43c3a4b 100644
--- a/src/account-mgr.h
+++ b/src/account-mgr.h
@@ -129,6 +129,9 @@ private slots:
     const QString getOldSyncRootDir(const Account& account);
     const QString genSyncRootName(const Account& account);
     void setAccountSyncRoot(Account &account);
+#endif
+#if defined(Q_OS_LINUX)
+    void setAccountDisplayName(Account &account);
 #endif
     static bool loadAccountsCB(struct sqlite3_stmt *stmt, void *data);
     static bool loadServerInfoCB(struct sqlite3_stmt *stmt, void *data);
diff --git a/src/account.h b/src/account.h
index fe7cbd80..7551bb65 100644
--- a/src/account.h
+++ b/src/account.h
@@ -26,6 +26,8 @@ class Account {
     QString token;
 #if defined(Q_OS_WIN32)
     QString syncRoot;
+#elif defined (Q_OS_LINUX)
+    QString displayName;
 #endif
     qint64 lastVisited;
     bool isShibboleth;
@@ -68,6 +70,8 @@ class Account {
         token(rhs.token),
 #if defined(Q_OS_WIN32)
         syncRoot(rhs.syncRoot),
+#elif defined(Q_OS_LINUX)
+        displayName(rhs.displayName),
 #endif
         lastVisited(rhs.lastVisited),
         isShibboleth(rhs.isShibboleth),
@@ -87,6 +91,8 @@ class Account {
         token = rhs.token;
 #if defined(Q_OS_WIN32)
         syncRoot = rhs.syncRoot;
+#elif defined(Q_OS_LINUX)
+        displayName = rhs.displayName;
 #endif
         lastVisited = rhs.lastVisited;
         isShibboleth = rhs.isShibboleth;
diff --git a/src/daemon-mgr.cpp b/src/daemon-mgr.cpp
index 9fb48ae2..591ceb21 100644
--- a/src/daemon-mgr.cpp
+++ b/src/daemon-mgr.cpp
@@ -176,6 +176,21 @@ QStringList DaemonManager::collectSeaDriveArgs()
     args << sync_root_path;
 #endif
 
+#if defined(Q_OS_LINUX)
+      args << "-f";
+
+      QString fuse_opts = qgetenv("SEADRIVE_FUSE_OPTS");
+      if (fuse_opts.isEmpty()) {
+          QStringList umount_arguments;
+          umount_arguments << "-u" << gui->seadriveRoot();
+          QProcess::execute("fusermount", umount_arguments);
+          QString mount_dir = gui->seadriveRoot();
+          args << mount_dir;
+      } else {
+          args << fuse_opts.split(" ");
+      }
+#endif
+
     auto stream = qWarning() << "starting seadrive daemon:" << 
kSeadriveExecutable;
     foreach (const QString& arg, args) {
         stream << arg;
diff --git a/src/rpc/rpc-client.cpp b/src/rpc/rpc-client.cpp
index 83c3b8f7..f2fa424c 100644
--- a/src/rpc/rpc-client.cpp
+++ b/src/rpc/rpc-client.cpp
@@ -619,6 +619,32 @@ bool SeafileRpcClient::addAccount(const Account& account)
 
     return true;
 }
+#elif defined(Q_OS_LINUX)
+bool SeafileRpcClient::addAccount(const Account& account)
+{
+    GError *error = NULL;
+    QString serverAddr = account.serverUrl.toEncoded().data();
+    if (serverAddr.endsWith("/")) {
+        serverAddr = serverAddr.left(serverAddr.size() - 1);
+    }
+
+    searpc_client_call__int(seadrive_rpc_client_, "seafile_add_account", 
&error,
+                            5,
+                            "string", toCStr(serverAddr),
+                            "string", toCStr(account.username),
+                            "string", toCStr(account.token),
+                            "string", toCStr(account.displayName),
+                            "int", account.isPro() ? 1 : 0);
+    if (error) {
+        qWarning() << "Unable to add account" << account << ":"
+                   << (error->message ? error->message : "");
+        g_error_free(error);
+        return false;
+    }
+    qWarning() << "Add account" << account;
+
+    return true;
+}
 #endif
 
 bool SeafileRpcClient::deleteAccount(const Account& account, bool remove_cache)
diff --git a/src/seadrive-gui.cpp b/src/seadrive-gui.cpp
index 11c5929b..caf19596 100644
--- a/src/seadrive-gui.cpp
+++ b/src/seadrive-gui.cpp
@@ -482,6 +482,17 @@ void SeadriveGui::start()
 
     RemoteWipeService::instance()->start();
     AccountInfoService::instance()->start();
+#elif defined(Q_OS_LINUX)
+    settings_mgr_->loadProxySettings();
+    settings_mgr_->applyProxySettings();
+
+    loginAccounts();
+
+    connect(daemon_mgr_, SIGNAL(daemonStarted()),
+            this, SLOT(onDaemonStarted()));
+    connect(daemon_mgr_, SIGNAL(daemonRestarted()),
+            this, SLOT(onDaemonRestarted()));
+    daemon_mgr_->startSeadriveDaemon();
 #endif
 }
 
@@ -543,8 +554,8 @@ void SeadriveGui::onDaemonStarted()
         message_poller->start();
         message_pollers_.insert(EMPTY_DOMAIN_ID, message_poller);
     }
-#if defined(Q_OS_WIN32)
-    rpc_client->connectDaemon();
+#if defined(Q_OS_WIN32) || defined(Q_OS_LINUX)
+    rpc_client_->connectDaemon();
 #endif
 
     auto accounts = account_mgr_->activeAccounts();
@@ -800,6 +811,22 @@ bool SeadriveGui::initLog()
     }
 #endif
 
+  // On linux we must unmount the mount point dir before trying to create it,
+  // otherwise checkdir_with_mkdir would think it doesn't exist and try to
+  // create it, but the creation operation would fail.
+#if defined(Q_OS_LINUX)
+      QStringList umount_arguments;
+      umount_arguments << "-u" << seadriveRoot();
+      QProcess::execute("fusermount", umount_arguments);
+#endif
+
+#if defined(Q_OS_LINUX)
+  if (checkdir_with_mkdir(toCStr(seadriveRoot())) < 0) {
+      errorAndExit(tr("Failed to initialize: failed to create seadrive mount 
folder"));
+      return false;
+  }
+#endif
+
     if (applet_log_init(toCStr(seadrive_dir.absolutePath())) < 0) {
         errorAndExit(tr("Failed to initialize log: 
%1").arg(g_strerror(errno)));
         return false;
@@ -1023,6 +1050,11 @@ QString SeadriveGui::seadriveRoot() const
 {
     return seadrive_root_;
 }
+#elif defined(Q_OS_LINUX)
+QString SeadriveGui::seadriveRoot() const
+{
+    return QDir::home().absoluteFilePath(getBrand());
+}
 #endif
 
 QString SeadriveGui::getUniqueClientId()
diff --git a/src/seadrive-gui.h b/src/seadrive-gui.h
index f21bd035..1daa6f0e 100644
--- a/src/seadrive-gui.h
+++ b/src/seadrive-gui.h
@@ -67,7 +67,7 @@ class SeadriveGui : public QObject {
 
     void migrateOldConfig(const QString& data_dir);
 
-#if defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN32) || defined(Q_OS_LINUX)
     QString seadriveRoot() const;
 #endif
 
@@ -107,6 +107,7 @@ private slots:
     void onDaemonStarted();
     void onDaemonRestarted();
     void onDaemonRestarted(const QString& domain_id);
+
     void connectDaemon();
 
 private:
diff --git a/src/ui/tray-icon.cpp b/src/ui/tray-icon.cpp
index 9b1e8746..df9060aa 100644
--- a/src/ui/tray-icon.cpp
+++ b/src/ui/tray-icon.cpp
@@ -674,7 +674,7 @@ void SeafileTrayIcon::deleteAccount()
         return;
     }
 
-#ifdef Q_OS_WIN32
+#if defined(Q_OS_WIN32) || defined(Q_OS_LINUX)
     QString question = tr("Are you sure to remove account from 
\"%1\"?").arg(account.serverUrl.toString());
 #else
     QString question = tr("Are you sure to remove account from \"%1\"? After 
removing account, you can still find downloaded files at 
~/Library/CloudStorage.").arg(account.serverUrl.toString());

>From db13b64cd5b75178e080df1497018070188d30eb Mon Sep 17 00:00:00 2001
From: Heran Yang <[email protected]>
Date: Tue, 11 Jun 2024 10:49:53 +0800
Subject: [PATCH 2/2] Fix rebase error

---
 src/seadrive-gui.cpp                | 2 +-
 src/ui/transfer-progress-dialog.cpp | 2 +-
 src/ui/tray-icon.cpp                | 4 ++++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/seadrive-gui.cpp b/src/seadrive-gui.cpp
index caf19596..9c663b2d 100644
--- a/src/seadrive-gui.cpp
+++ b/src/seadrive-gui.cpp
@@ -555,7 +555,7 @@ void SeadriveGui::onDaemonStarted()
         message_pollers_.insert(EMPTY_DOMAIN_ID, message_poller);
     }
 #if defined(Q_OS_WIN32) || defined(Q_OS_LINUX)
-    rpc_client_->connectDaemon();
+    rpc_client->connectDaemon();
 #endif
 
     auto accounts = account_mgr_->activeAccounts();
diff --git a/src/ui/transfer-progress-dialog.cpp 
b/src/ui/transfer-progress-dialog.cpp
index 582a05a1..0540779c 100644
--- a/src/ui/transfer-progress-dialog.cpp
+++ b/src/ui/transfer-progress-dialog.cpp
@@ -189,7 +189,7 @@ TransferItemsTableModel::TransferItemsTableModel(QObject* 
parent)
 
 }
 
-#if defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN32) || defined(Q_OS_LINUX)
 void TransferItemsTableModel::setTransferItems()
 {
     TransferProgress transfer_progress;
diff --git a/src/ui/tray-icon.cpp b/src/ui/tray-icon.cpp
index df9060aa..6c9ce2e6 100644
--- a/src/ui/tray-icon.cpp
+++ b/src/ui/tray-icon.cpp
@@ -669,10 +669,12 @@ void SeafileTrayIcon::deleteAccount()
 
     SeafileRpcClient *rpc_client = gui->rpcClient(account.domainID());
 
+#ifndef Q_OS_LINUX
     if (rpc_client && rpc_client->isAccountUploading(account)) {
         gui->warningBox(tr("There are changes being uploaded under the 
account, please try again later"));
         return;
     }
+#endif
 
 #if defined(Q_OS_WIN32) || defined(Q_OS_LINUX)
     QString question = tr("Are you sure to remove account from 
\"%1\"?").arg(account.serverUrl.toString());
@@ -699,11 +701,13 @@ void SeafileTrayIcon::resyncAccount()
         return;
     }
 
+#ifndef Q_OS_LINUX
     bool is_uploading = rpc_client->isAccountUploading (account);
     if (is_uploading) {
         gui->warningBox (tr("There are changes being uploaded under the 
account, please try again later"));
         return;
     }
+#endif
 
     QString question = tr("The account will be synced to a new sync root 
folder. Are you sure to resync account from 
\"%1\"?").arg(account.serverUrl.toString());
 

++++++ seadrive-gui-2.0.28.tar.gz -> seadrive-gui-3.0.11.tar.gz ++++++
/work/SRC/openSUSE:Factory/seadrive-gui/seadrive-gui-2.0.28.tar.gz 
/work/SRC/openSUSE:Factory/.seadrive-gui.new.26871/seadrive-gui-3.0.11.tar.gz 
differ: char 15, line 1

Reply via email to