1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2026-04-03 09:11:33 +02:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Klaas Freitag
14a25f9d3f Update version tag to 1.4.2 2013-10-21 14:05:25 +02:00
Klaas Freitag
4e777aae33 Add a flag to the folder class that reflects the en-/disable user button
The existing flag _syncEnabled was used to both carry the users wish and
also the system capability of being able to sync (ie. network not
existing...) Now there are two flags (one for system problems that
disable sync and one for the user interaction) which steer the sync
algorithm.
2013-10-21 14:00:17 +02:00
Klaas Freitag
5a84452102 Update to RC1 2013-10-18 16:40:38 +02:00
Daniel Molkentin
8aa75ba4a4 1.4.2 ChangeLog 2013-10-18 15:36:59 +02:00
Daniel Molkentin
2f24172bac 1.4.2 final 2013-10-18 14:55:01 +02:00
7 changed files with 63 additions and 14 deletions

View File

@@ -1,5 +1,21 @@
ChangeLog
=========
version 1.4.2 (release 2013-10-18 ), csync 0.90.4 required
* Do not show the warning icon in the tray (#944)
* Fix manual proxy support when switching (#1016)
* Add folder column to detailed sync protocol (#1037)
* Fix possible endless loop in inotify (#1041)
* Do not elide the progress text (#1049)
* Fix high CPU load (#1073)
* Reconnect if network is unavailable after startup (#1080)
* Ensure paused folder stays paused when syncing with more than one folder (#1083)
* Don't show desktop notification when the user doesn't want to (#1093)
* System tray: Avoid quick flickering up of the ok-icon for the sync prepare state
* Progress: Do not show progress if nothing is transmitted
* Progress: Show number of deletes.
version 1.4.1 (release 2013-09-24 ), csync 0.90.1 required
* Translation and documentation fixes.

View File

@@ -1,6 +1,6 @@
set( VERSION_MAJOR 1 )
set( VERSION_MINOR 4 )
set( VERSION_PATCH 2 )
set( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}beta1")
set( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_SUFFIX}")
set( SOVERSION 0 )

View File

@@ -219,7 +219,7 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
item->setData( f->nativePath(), FolderStatusDelegate::FolderPathRole );
item->setData( f->secondPath(), FolderStatusDelegate::FolderSecondPathRole );
item->setData( f->alias(), FolderStatusDelegate::FolderAliasRole );
item->setData( f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
item->setData( f->userSyncEnabled() && f->syncEnabled(), FolderStatusDelegate::FolderSyncEnabled );
SyncResult res = f->syncResult();
SyncResult::Status status = res.status();
@@ -228,7 +228,7 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
Theme *theme = Theme::instance();
item->setData( theme->statusHeaderText( status ), Qt::ToolTipRole );
if( f->syncEnabled() ) {
if( f->syncEnabled() && f->userSyncEnabled() ) {
if( status == SyncResult::SyncPrepare ) {
if( _wasDisabledBefore ) {
// if the folder was disabled before, set the sync icon
@@ -445,7 +445,7 @@ void AccountSettings::slotEnableCurrentFolder()
if ( f->isBusy() && terminate )
folderMan->terminateSyncProcess( alias );
folderMan->slotEnableFolder( alias, !folderEnabled );
folderMan->slotGuiPauseFolder( alias, !folderEnabled );
// keep state for the icon setting.
if( !folderEnabled ) _wasDisabledBefore = true;

View File

@@ -50,6 +50,7 @@ Folder::Folder(const QString &alias, const QString &path, const QString& secondP
, _secondPath(secondPath)
, _alias(alias)
, _enabled(true)
, _userSyncEnabled(true)
, _thread(0)
, _csync(0)
, _csyncError(false)
@@ -200,16 +201,32 @@ void Folder::setSyncEnabled( bool doit )
{
_enabled = doit;
if( doit ) {
if( doit && userSyncEnabled() ) {
// qDebug() << "Syncing enabled on folder " << name();
_pollTimer.start();
_watcher->clearPendingEvents(); // FIXME 1.5: Why isn't that happening in setEventsEnabled?
_watcher->setEventsEnabled(true);
_timeSinceLastSync.restart();
} else {
// do not stop or start the watcher here, that is done internally by
// folder class. Even if the watcher fires, the folder does not
// schedule itself because it checks the var. _enabled before.
_pollTimer.stop();
_watcher->setEventsEnabled(false);
}
}
bool Folder::userSyncEnabled()
{
return _userSyncEnabled;
}
void Folder::slotSetSyncUserEnabled( bool enable )
{
_userSyncEnabled = enable;
setSyncEnabled( syncEnabled() ); // no change on the system enable flag.
}
void Folder::setSyncState(SyncResult::Status state)
{
_syncResult.setStatus(state);
@@ -222,11 +239,15 @@ SyncResult Folder::syncResult() const
void Folder::evaluateSync(const QStringList &/*pathList*/)
{
if( !_enabled ) {
if( !syncEnabled() ) {
qDebug() << "*" << alias() << "sync skipped, disabled!";
return;
}
if( !userSyncEnabled() ) {
qDebug() << "*" << alias() << "sync skipped, user disabled!";
return;
}
_syncResult.setStatus( SyncResult::NotYetStarted );
_syncResult.clearErrors();
emit scheduleToSync( alias() );
@@ -237,8 +258,9 @@ void Folder::slotPollTimerTimeout()
{
qDebug() << "* Polling" << alias() << "for changes. (time since next sync:" << (_timeSinceLastSync.elapsed() / 1000) << "s)";
// Force sync if the last sync is a long time ago or if there was a serious problem.
if (quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval() ||
_syncResult.status() != SyncResult::Success ) {
!(_syncResult.status() == SyncResult::Success || _syncResult.status() == SyncResult::Problem)) {
qDebug() << "** Force Sync now";
evaluateSync(QStringList());
} else {
@@ -627,10 +649,13 @@ void Folder::slotCsyncUnavailable()
void Folder::slotCSyncFinished()
{
qDebug() << "-> CSync Finished slot with error " << _csyncError;
_watcher->setEventsEnabledDelayed(2000);
_pollTimer.start();
_timeSinceLastSync.restart();
qDebug() << "-> CSync Finished slot for" << alias() << "with error" << _csyncError;
if( syncEnabled() && userSyncEnabled() ) {
qDebug() << "Sync is enabled - starting the polltimer again.";
_watcher->setEventsEnabledDelayed(2000);
_pollTimer.start();
_timeSinceLastSync.restart();
}
bubbleUpSyncResult();

View File

@@ -153,6 +153,13 @@ public slots:
void setProxyDirty(bool value);
bool proxyDirty();
/**
* @brief slotSetSyncUserEnabled - slot that sets the enable/disable flag from the GUI
* @param enable
*/
void slotSetSyncUserEnabled( bool enable );
bool userSyncEnabled();
private slots:
void slotCSyncStarted();
void slotCSyncError(const QString& );
@@ -197,6 +204,7 @@ protected:
QString _configFile;
QFileSystemWatcher *_pathWatcher;
bool _enabled;
bool _userSyncEnabled; // enabled by user interaction?
FolderWatcher *_watcher;
SyncResult _syncResult;
QThread *_thread;

View File

@@ -269,7 +269,7 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
return folder;
}
void FolderMan::slotEnableFolder( const QString& alias, bool enable )
void FolderMan::slotGuiPauseFolder( const QString& alias, bool enable )
{
if( ! _folderMap.contains( alias ) ) {
qDebug() << "!! Can not enable alias " << alias << ", can not be found in folderMap.";
@@ -278,7 +278,7 @@ void FolderMan::slotEnableFolder( const QString& alias, bool enable )
Folder *f = _folderMap[alias];
if( f ) {
f->setSyncEnabled(enable);
f->slotSetSyncUserEnabled(enable);
f->evaluateSync(QStringList());
}
}

View File

@@ -91,7 +91,7 @@ signals:
public slots:
void slotRemoveFolder( const QString& );
void slotEnableFolder( const QString&, bool );
void slotGuiPauseFolder( const QString&, bool );
void slotFolderSyncStarted();
void slotFolderSyncFinished( const SyncResult& );