2012-02-17 12:48:31 +04:00
|
|
|
/*
|
|
|
|
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef FOLDERMAN_H
|
|
|
|
#define FOLDERMAN_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2012-03-22 19:22:08 +04:00
|
|
|
#include <QQueue>
|
2013-07-22 14:10:13 +04:00
|
|
|
#include <QList>
|
2012-02-17 12:48:31 +04:00
|
|
|
|
2014-07-11 02:31:24 +04:00
|
|
|
#include "folder.h"
|
|
|
|
#include "folderwatcher.h"
|
2017-10-04 14:49:42 +03:00
|
|
|
#include "navigationpanehelper.h"
|
2014-07-11 02:31:24 +04:00
|
|
|
#include "syncfileitem.h"
|
2012-02-17 12:48:31 +04:00
|
|
|
|
2015-07-13 15:35:19 +03:00
|
|
|
class TestFolderMan;
|
2022-07-04 15:36:06 +03:00
|
|
|
class TestCfApiShellExtensionsIPC;
|
2022-10-06 14:21:33 +03:00
|
|
|
class TestShareModel;
|
2022-10-18 18:15:10 +03:00
|
|
|
class ShareTestHelper;
|
2012-02-19 00:21:58 +04:00
|
|
|
|
2014-11-10 00:34:07 +03:00
|
|
|
namespace OCC {
|
2013-07-22 14:10:13 +04:00
|
|
|
|
2014-05-26 16:34:08 +04:00
|
|
|
class Application;
|
2014-07-14 17:31:38 +04:00
|
|
|
class SyncResult;
|
|
|
|
class SocketApi;
|
2016-04-29 17:14:18 +03:00
|
|
|
class LockWatcher;
|
2014-05-26 16:34:08 +04:00
|
|
|
|
2015-06-29 19:56:09 +03:00
|
|
|
/**
|
|
|
|
* @brief The FolderMan class
|
|
|
|
* @ingroup gui
|
2016-10-18 17:04:25 +03:00
|
|
|
*
|
|
|
|
* The FolderMan knows about all loaded folders and is responsible for
|
|
|
|
* scheduling them when necessary.
|
|
|
|
*
|
|
|
|
* A folder is scheduled if:
|
|
|
|
* - The configured force-sync-interval has expired
|
|
|
|
* (_timeScheduler and slotScheduleFolderByTime())
|
|
|
|
*
|
|
|
|
* - A folder watcher receives a notification about a file change
|
|
|
|
* (_folderWatchers and Folder::slotWatchedPathChanged())
|
|
|
|
*
|
|
|
|
* - The folder etag on the server has changed
|
|
|
|
* (_etagPollTimer)
|
|
|
|
*
|
|
|
|
* - The locks of a monitored file are released
|
|
|
|
* (_lockWatcher and slotWatchedFileUnlocked())
|
|
|
|
*
|
|
|
|
* - There was a sync error or a follow-up sync is requested
|
|
|
|
* (_timeScheduler and slotScheduleFolderByTime()
|
|
|
|
* and Folder::slotSyncFinished())
|
2015-06-26 18:07:47 +03:00
|
|
|
*/
|
2014-07-07 18:30:32 +04:00
|
|
|
class FolderMan : public QObject
|
2012-02-17 12:48:31 +04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-09-08 14:21:30 +03:00
|
|
|
enum class PathValidityResult {
|
2022-09-08 13:00:13 +03:00
|
|
|
Valid,
|
|
|
|
ErrorRecursiveValidity,
|
|
|
|
ErrorContainsFolder,
|
|
|
|
ErrorContainedInFolder,
|
|
|
|
ErrorNonEmptyFolder
|
|
|
|
};
|
|
|
|
|
2021-08-17 13:39:31 +03:00
|
|
|
~FolderMan() override;
|
2013-07-22 15:59:52 +04:00
|
|
|
static FolderMan *instance();
|
2012-02-17 12:48:31 +04:00
|
|
|
|
|
|
|
int setupFolders();
|
2015-04-24 11:18:33 +03:00
|
|
|
int setupFoldersMigration();
|
2012-02-17 12:48:31 +04:00
|
|
|
|
2018-05-02 16:40:54 +03:00
|
|
|
/**
|
|
|
|
* Returns a list of keys that can't be read because they are from
|
|
|
|
* future versions.
|
|
|
|
*/
|
2018-05-14 15:37:48 +03:00
|
|
|
static void backwardMigrationSettingsKeys(QStringList *deleteKeys, QStringList *ignoreKeys);
|
2018-05-02 16:40:54 +03:00
|
|
|
|
2022-09-30 20:12:08 +03:00
|
|
|
[[nodiscard]] const Folder::Map &map() const;
|
2012-02-17 12:48:31 +04:00
|
|
|
|
2015-04-24 11:18:33 +03:00
|
|
|
/** Adds a folder for an account, ensures the journal is gone and saves it in the settings.
|
2012-02-17 12:48:31 +04:00
|
|
|
*/
|
2015-04-24 11:18:33 +03:00
|
|
|
Folder *addFolder(AccountState *accountState, const FolderDefinition &folderDefinition);
|
2013-10-03 19:04:55 +04:00
|
|
|
|
2016-10-19 12:03:13 +03:00
|
|
|
/** Removes a folder */
|
|
|
|
void removeFolder(Folder *);
|
|
|
|
|
2013-10-03 19:04:55 +04:00
|
|
|
/** Returns the folder which the file or directory stored in path is in */
|
2014-07-01 18:24:14 +04:00
|
|
|
Folder *folderForPath(const QString &path);
|
2012-02-17 12:48:31 +04:00
|
|
|
|
2015-11-16 17:04:59 +03:00
|
|
|
/**
|
|
|
|
* returns a list of local files that exist on the local harddisk for an
|
|
|
|
* incoming relative server path. The method checks with all existing sync
|
|
|
|
* folders.
|
|
|
|
*/
|
2015-11-24 16:24:18 +03:00
|
|
|
QStringList findFileInLocalFolders(const QString &relPath, const AccountPtr acc);
|
2015-11-16 17:04:59 +03:00
|
|
|
|
2020-06-05 01:51:32 +03:00
|
|
|
/** Returns the folder by alias or \c nullptr if no folder with the alias exists. */
|
2012-02-21 14:50:19 +04:00
|
|
|
Folder *folder(const QString &);
|
|
|
|
|
2015-05-12 17:48:19 +03:00
|
|
|
/**
|
|
|
|
* Migrate accounts from owncloud < 2.0
|
|
|
|
* Creates a folder for a specific configuration, identified by alias.
|
|
|
|
*/
|
|
|
|
Folder *setupFolderFromOldConfigFile(const QString &, AccountState *account);
|
2012-04-02 15:21:13 +04:00
|
|
|
|
2013-06-06 19:59:50 +04:00
|
|
|
/**
|
2016-09-02 16:51:13 +03:00
|
|
|
* Ensures that a given directory does not contain a sync journal file.
|
2013-06-06 19:59:50 +04:00
|
|
|
*
|
2013-07-24 16:16:52 +04:00
|
|
|
* @returns false if the journal could not be removed, true otherwise.
|
2013-06-06 19:59:50 +04:00
|
|
|
*/
|
2016-09-02 13:29:21 +03:00
|
|
|
static bool ensureJournalGone(const QString &journalDbFile);
|
2013-06-06 19:59:50 +04:00
|
|
|
|
2013-07-24 16:16:52 +04:00
|
|
|
/** Creates a new and empty local directory. */
|
2013-05-26 15:56:51 +04:00
|
|
|
bool startFromScratch(const QString &);
|
|
|
|
|
2018-01-23 16:11:20 +03:00
|
|
|
/// Produce text for use in the tray tooltip
|
|
|
|
static QString trayTooltipStatusString(SyncResult::Status syncStatus, bool hasUnresolvedConflicts, bool paused);
|
2013-07-22 14:10:13 +04:00
|
|
|
|
2018-01-23 16:11:20 +03:00
|
|
|
/// Compute status summarizing multiple folders
|
|
|
|
static void trayOverallStatus(const QList<Folder *> &folders,
|
|
|
|
SyncResult::Status *status, bool *unresolvedConflicts);
|
2013-07-22 14:10:13 +04:00
|
|
|
|
2014-08-11 17:09:17 +04:00
|
|
|
// Escaping of the alias which is used in QSettings AND the file
|
|
|
|
// system, thus need to be escaped.
|
|
|
|
static QString escapeAlias(const QString &);
|
2015-09-02 17:05:58 +03:00
|
|
|
static QString unescapeAlias(const QString &);
|
2014-08-11 17:09:17 +04:00
|
|
|
|
2014-09-03 18:12:21 +04:00
|
|
|
SocketApi *socketApi();
|
2017-10-04 14:49:42 +03:00
|
|
|
NavigationPaneHelper &navigationPaneHelper() { return _navigationPaneHelper; }
|
2014-09-03 18:12:21 +04:00
|
|
|
|
2015-07-13 15:35:19 +03:00
|
|
|
/**
|
|
|
|
* Check if @a path is a valid path for a new folder considering the already sync'ed items.
|
2015-10-05 07:21:19 +03:00
|
|
|
* Make sure that this folder, or any subfolder is not sync'ed already.
|
2015-07-13 15:35:19 +03:00
|
|
|
*
|
2017-03-20 16:28:32 +03:00
|
|
|
* Note that different accounts are allowed to sync to the same folder.
|
|
|
|
*
|
2022-09-08 13:00:13 +03:00
|
|
|
* @returns an empty string and PathValidityResult::Valid if it is allowed, or an error if it is not allowed
|
2015-07-13 15:35:19 +03:00
|
|
|
*/
|
2022-09-30 20:12:08 +03:00
|
|
|
[[nodiscard]] QPair<PathValidityResult, QString> checkPathValidityForNewFolder(const QString &path, const QUrl &serverUrl = QUrl()) const;
|
2017-03-20 16:28:32 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Attempts to find a non-existing, acceptable path for creating a new sync folder.
|
|
|
|
*
|
|
|
|
* Uses \a basePath as the baseline. It'll return this path if it's acceptable.
|
|
|
|
*
|
|
|
|
* Note that this can fail. If someone syncs ~ and \a basePath is ~/ownCloud, no
|
|
|
|
* subfolder of ~ would be a good candidate. When that happens \a basePath
|
|
|
|
* is returned.
|
|
|
|
*/
|
2022-09-30 20:12:08 +03:00
|
|
|
[[nodiscard]] QString findGoodPathForNewSyncFolder(const QString &basePath, const QUrl &serverUrl) const;
|
2015-07-13 15:35:19 +03:00
|
|
|
|
2015-08-10 12:03:57 +03:00
|
|
|
/**
|
|
|
|
* While ignoring hidden files can theoretically be switched per folder,
|
|
|
|
* it's currently a global setting that users can only change for all folders
|
|
|
|
* at once.
|
|
|
|
* These helper functions can be removed once it's properly per-folder.
|
|
|
|
*/
|
2022-09-30 20:12:08 +03:00
|
|
|
[[nodiscard]] bool ignoreHiddenFiles() const;
|
2015-08-10 12:03:57 +03:00
|
|
|
void setIgnoreHiddenFiles(bool ignore);
|
|
|
|
|
2015-09-04 11:33:48 +03:00
|
|
|
/**
|
|
|
|
* Access to the current queue of scheduled folders.
|
|
|
|
*/
|
2022-09-30 20:12:08 +03:00
|
|
|
[[nodiscard]] QQueue<Folder *> scheduleQueue() const;
|
2015-09-04 11:33:48 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Access to the currently syncing folder.
|
2020-11-26 19:19:20 +03:00
|
|
|
*
|
|
|
|
* Note: This is only the folder that's currently syncing *as-scheduled*. There
|
|
|
|
* may be externally-managed syncs such as from placeholder hydrations.
|
|
|
|
*
|
|
|
|
* See also isAnySyncRunning()
|
2015-09-04 11:33:48 +03:00
|
|
|
*/
|
2022-09-30 20:12:08 +03:00
|
|
|
[[nodiscard]] Folder *currentSyncFolder() const;
|
2015-09-04 11:33:48 +03:00
|
|
|
|
2020-11-26 19:19:20 +03:00
|
|
|
/**
|
|
|
|
* Returns true if any folder is currently syncing.
|
|
|
|
*
|
|
|
|
* This might be a FolderMan-scheduled sync, or a externally
|
|
|
|
* managed sync like a placeholder hydration.
|
|
|
|
*/
|
2022-09-30 20:12:08 +03:00
|
|
|
[[nodiscard]] bool isAnySyncRunning() const;
|
2020-11-26 19:19:20 +03:00
|
|
|
|
2016-10-19 12:03:13 +03:00
|
|
|
/** Removes all folders */
|
|
|
|
int unloadAndDeleteAllFolders();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If enabled is set to false, no new folders will start to sync.
|
|
|
|
* The current one will finish.
|
|
|
|
*/
|
|
|
|
void setSyncEnabled(bool);
|
|
|
|
|
|
|
|
/** Queues a folder for syncing. */
|
|
|
|
void scheduleFolder(Folder *);
|
|
|
|
|
2022-09-06 18:03:31 +03:00
|
|
|
/** Queues a folder for syncing that starts immediately. */
|
|
|
|
void scheduleFolderForImmediateSync(Folder *);
|
|
|
|
|
2016-11-25 16:23:56 +03:00
|
|
|
/** Puts a folder in the very front of the queue. */
|
|
|
|
void scheduleFolderNext(Folder *);
|
|
|
|
|
2016-10-19 12:03:13 +03:00
|
|
|
/** Queues all folders for syncing. */
|
|
|
|
void scheduleAllFolders();
|
|
|
|
|
2018-01-05 11:44:20 +03:00
|
|
|
void setDirtyProxy();
|
2016-10-19 12:03:13 +03:00
|
|
|
void setDirtyNetworkLimits();
|
|
|
|
|
2022-10-21 17:11:29 +03:00
|
|
|
/** removes current user from the share **/
|
|
|
|
void leaveShare(const QString &localFile);
|
|
|
|
|
2012-02-17 12:48:31 +04:00
|
|
|
signals:
|
2012-02-19 00:21:58 +04:00
|
|
|
/**
|
2015-04-28 16:13:39 +03:00
|
|
|
* signal to indicate a folder has changed its sync state.
|
2014-08-19 15:58:20 +04:00
|
|
|
*
|
2015-10-05 07:21:19 +03:00
|
|
|
* Attention: The folder may be zero. Do a general update of the state then.
|
2012-02-19 00:21:58 +04:00
|
|
|
*/
|
2022-10-24 17:00:50 +03:00
|
|
|
void folderSyncStateChange(OCC::Folder *);
|
2012-02-17 12:48:31 +04:00
|
|
|
|
2015-09-04 11:33:48 +03:00
|
|
|
/**
|
|
|
|
* Indicates when the schedule queue changes.
|
|
|
|
*/
|
|
|
|
void scheduleQueueChanged();
|
|
|
|
|
2014-09-04 12:12:54 +04:00
|
|
|
/**
|
2016-10-19 12:03:13 +03:00
|
|
|
* Emitted whenever the list of configured folders changes.
|
2014-09-04 12:12:54 +04:00
|
|
|
*/
|
2022-10-24 17:00:50 +03:00
|
|
|
void folderListChanged(const OCC::Folder::Map &);
|
2013-08-27 12:02:59 +04:00
|
|
|
|
2019-07-24 14:56:21 +03:00
|
|
|
/**
|
|
|
|
* Emitted once slotRemoveFoldersForAccount is done wiping
|
|
|
|
*/
|
2022-10-24 17:00:50 +03:00
|
|
|
void wipeDone(OCC::AccountState *account, bool success);
|
2019-07-24 14:56:21 +03:00
|
|
|
|
2016-10-19 12:03:13 +03:00
|
|
|
public slots:
|
2012-03-22 19:22:08 +04:00
|
|
|
|
2015-07-01 12:39:57 +03:00
|
|
|
/**
|
|
|
|
* Schedules folders of newly connected accounts, terminates and
|
|
|
|
* de-schedules folders of disconnected accounts.
|
|
|
|
*/
|
|
|
|
void slotAccountStateChanged();
|
|
|
|
|
2015-07-17 13:12:00 +03:00
|
|
|
/**
|
|
|
|
* restart the client as soon as it is possible, ie. no folders syncing.
|
|
|
|
*/
|
|
|
|
void slotScheduleAppRestart();
|
|
|
|
|
2016-04-29 17:14:18 +03:00
|
|
|
/**
|
|
|
|
* Triggers a sync run once the lock on the given file is removed.
|
|
|
|
*
|
|
|
|
* Automatically detemines the folder that's responsible for the file.
|
2016-10-18 17:04:25 +03:00
|
|
|
* See slotWatchedFileUnlocked().
|
2016-04-29 17:14:18 +03:00
|
|
|
*/
|
|
|
|
void slotSyncOnceFileUnlocks(const QString &path);
|
|
|
|
|
2016-10-19 12:03:13 +03:00
|
|
|
// slot to schedule an ETag job (from Folder only)
|
2022-10-24 17:00:50 +03:00
|
|
|
void slotScheduleETagJob(const QString &alias, OCC::RequestEtagJob *job);
|
2016-10-19 12:03:13 +03:00
|
|
|
|
2019-07-24 14:56:21 +03:00
|
|
|
/** Wipe folder */
|
2022-10-24 17:00:50 +03:00
|
|
|
void slotWipeFolderForAccount(OCC::AccountState *accountState);
|
2019-07-24 14:56:21 +03:00
|
|
|
|
2022-10-24 17:00:50 +03:00
|
|
|
void forceSyncForFolder(OCC::Folder *folder);
|
2022-10-24 14:46:12 +03:00
|
|
|
|
2014-01-11 23:35:16 +04:00
|
|
|
private slots:
|
2022-10-24 17:00:50 +03:00
|
|
|
void slotFolderSyncPaused(OCC::Folder *, bool paused);
|
2016-10-19 12:03:13 +03:00
|
|
|
void slotFolderCanSyncChanged();
|
|
|
|
void slotFolderSyncStarted();
|
2022-10-24 17:00:50 +03:00
|
|
|
void slotFolderSyncFinished(const OCC::SyncResult &);
|
2016-10-19 12:03:13 +03:00
|
|
|
|
|
|
|
void slotRunOneEtagJob();
|
|
|
|
void slotEtagJobDestroyed(QObject *);
|
|
|
|
|
2012-03-22 19:22:08 +04:00
|
|
|
// slot to take the next folder from queue and start syncing.
|
2014-09-17 15:02:11 +04:00
|
|
|
void slotStartScheduledFolderSync();
|
2014-12-03 00:32:54 +03:00
|
|
|
void slotEtagPollTimerTimeout();
|
2015-04-24 11:18:33 +03:00
|
|
|
|
2022-10-24 17:00:50 +03:00
|
|
|
void slotAccountRemoved(OCC::AccountState *accountState);
|
2021-03-09 12:56:17 +03:00
|
|
|
|
2022-10-24 17:00:50 +03:00
|
|
|
void slotRemoveFoldersForAccount(OCC::AccountState *accountState);
|
2012-03-22 19:22:08 +04:00
|
|
|
|
2015-06-17 16:55:48 +03:00
|
|
|
// Wraps the Folder::syncStateChange() signal into the
|
|
|
|
// FolderMan::folderSyncStateChange(Folder*) signal.
|
|
|
|
void slotForwardFolderSyncStateChange();
|
|
|
|
|
2022-10-24 17:00:50 +03:00
|
|
|
void slotServerVersionChanged(OCC::Account *account);
|
2016-03-02 13:59:36 +03:00
|
|
|
|
2016-04-29 17:14:18 +03:00
|
|
|
/**
|
2016-10-18 17:04:25 +03:00
|
|
|
* A file whose locks were being monitored has become unlocked.
|
|
|
|
*
|
|
|
|
* This schedules the folder for synchronization that contains
|
2016-04-29 17:14:18 +03:00
|
|
|
* the file with the given path.
|
|
|
|
*/
|
2016-10-18 17:04:25 +03:00
|
|
|
void slotWatchedFileUnlocked(const QString &path);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Schedules folders whose time to sync has come.
|
|
|
|
*
|
|
|
|
* Either because a long time has passed since the last sync or
|
|
|
|
* because of previous failures.
|
|
|
|
*/
|
|
|
|
void slotScheduleFolderByTime();
|
2016-04-29 17:14:18 +03:00
|
|
|
|
2022-10-24 17:00:50 +03:00
|
|
|
void slotSetupPushNotifications(const OCC::Folder::Map &);
|
|
|
|
void slotProcessFilesPushNotification(OCC::Account *account);
|
|
|
|
void slotConnectToPushNotifications(OCC::Account *account);
|
2021-01-12 11:23:41 +03:00
|
|
|
|
2012-02-17 12:48:31 +04:00
|
|
|
private:
|
2015-06-17 16:55:48 +03:00
|
|
|
/** Adds a new folder, does not add it to the account settings and
|
|
|
|
* does not set an account on the new folder.
|
2015-04-24 11:18:33 +03:00
|
|
|
*/
|
2016-11-22 18:12:28 +03:00
|
|
|
Folder *addFolderInternal(FolderDefinition folderDefinition,
|
2018-11-15 11:45:14 +03:00
|
|
|
AccountState *accountState, std::unique_ptr<Vfs> vfs);
|
2015-04-24 11:18:33 +03:00
|
|
|
|
2015-02-27 12:42:59 +03:00
|
|
|
/* unloads a folder object, does not delete it */
|
2015-04-28 16:13:39 +03:00
|
|
|
void unloadFolder(Folder *);
|
2015-02-27 12:42:59 +03:00
|
|
|
|
2015-01-16 14:23:15 +03:00
|
|
|
/** Will start a sync after a bit of delay. */
|
2016-10-18 17:04:25 +03:00
|
|
|
void startScheduledSyncSoon();
|
2015-01-16 14:23:15 +03:00
|
|
|
|
2012-02-17 12:48:31 +04:00
|
|
|
// finds all folder configuration files
|
|
|
|
// and create the folders
|
2022-09-30 20:12:08 +03:00
|
|
|
[[nodiscard]] QString getBackupName(QString fullPathName) const;
|
2017-10-09 13:06:11 +03:00
|
|
|
|
|
|
|
// makes the folder known to the socket api
|
|
|
|
void registerFolderWithSocketApi(Folder *folder);
|
2012-02-17 12:48:31 +04:00
|
|
|
|
2015-07-17 13:12:00 +03:00
|
|
|
// restarts the application (Linux only)
|
|
|
|
void restartApplication();
|
|
|
|
|
2018-10-29 14:31:39 +03:00
|
|
|
void setupFoldersHelper(QSettings &settings, AccountStatePtr account, const QStringList &ignoreKeys, bool backwardsCompatible, bool foldersWithPlaceholders);
|
2016-11-22 17:30:12 +03:00
|
|
|
|
2021-01-12 11:23:41 +03:00
|
|
|
void runEtagJobsIfPossible(const QList<Folder *> &folderMap);
|
|
|
|
void runEtagJobIfPossible(Folder *folder);
|
|
|
|
|
|
|
|
bool pushNotificationsFilesReady(Account *account);
|
|
|
|
|
2022-09-30 20:12:08 +03:00
|
|
|
[[nodiscard]] bool isSwitchToVfsNeeded(const FolderDefinition &folderDefinition) const;
|
2021-11-04 13:20:16 +03:00
|
|
|
|
2013-11-13 21:58:06 +04:00
|
|
|
QSet<Folder *> _disabledFolders;
|
2012-03-29 12:13:19 +04:00
|
|
|
Folder::Map _folderMap;
|
|
|
|
QString _folderConfigPath;
|
2020-05-28 17:59:24 +03:00
|
|
|
Folder *_currentSyncFolder = nullptr;
|
2015-04-28 16:13:39 +03:00
|
|
|
QPointer<Folder> _lastSyncFolder;
|
2020-05-28 17:59:24 +03:00
|
|
|
bool _syncEnabled = true;
|
2014-12-03 00:32:54 +03:00
|
|
|
|
2018-05-14 15:37:48 +03:00
|
|
|
/// Folder aliases from the settings that weren't read
|
|
|
|
QSet<QString> _additionalBlockedFolderAliases;
|
|
|
|
|
2016-10-18 17:04:25 +03:00
|
|
|
/// Starts regular etag query jobs
|
|
|
|
QTimer _etagPollTimer;
|
|
|
|
/// The currently running etag query
|
|
|
|
QPointer<RequestEtagJob> _currentEtagJob;
|
|
|
|
|
|
|
|
/// Watches files that couldn't be synced due to locks
|
2016-04-29 17:14:18 +03:00
|
|
|
QScopedPointer<LockWatcher> _lockWatcher;
|
2014-01-11 23:35:16 +04:00
|
|
|
|
2016-10-18 17:04:25 +03:00
|
|
|
/// Occasionally schedules folders
|
|
|
|
QTimer _timeScheduler;
|
|
|
|
|
|
|
|
/// Scheduled folders that should be synced as soon as possible
|
|
|
|
QQueue<Folder *> _scheduledFolders;
|
2014-09-17 15:02:11 +04:00
|
|
|
|
2016-10-18 17:04:25 +03:00
|
|
|
/// Picks the next scheduled folder and starts the sync
|
2015-01-16 14:23:15 +03:00
|
|
|
QTimer _startScheduledSyncTimer;
|
|
|
|
|
2022-09-06 18:03:31 +03:00
|
|
|
bool _nextSyncShouldStartImmediately = false;
|
|
|
|
|
2016-10-18 17:04:25 +03:00
|
|
|
QScopedPointer<SocketApi> _socketApi;
|
2017-10-04 14:49:42 +03:00
|
|
|
NavigationPaneHelper _navigationPaneHelper;
|
2016-10-18 17:04:25 +03:00
|
|
|
|
2020-05-28 17:59:24 +03:00
|
|
|
bool _appRestartRequired = false;
|
2015-07-17 13:12:00 +03:00
|
|
|
|
2013-07-22 15:59:52 +04:00
|
|
|
static FolderMan *_instance;
|
2018-11-11 12:56:22 +03:00
|
|
|
explicit FolderMan(QObject *parent = nullptr);
|
2014-11-10 00:34:07 +03:00
|
|
|
friend class OCC::Application;
|
2015-07-13 15:35:19 +03:00
|
|
|
friend class ::TestFolderMan;
|
2022-07-04 15:36:06 +03:00
|
|
|
friend class ::TestCfApiShellExtensionsIPC;
|
2022-10-18 18:15:10 +03:00
|
|
|
friend class ::ShareTestHelper;
|
2012-02-17 12:48:31 +04:00
|
|
|
};
|
|
|
|
|
2014-11-10 00:34:07 +03:00
|
|
|
} // namespace OCC
|
2012-02-17 12:48:31 +04:00
|
|
|
#endif // FOLDERMAN_H
|