[Pkg-owncloud-commits] [owncloud-client] 06/38: FolderMan: Migrate folderlist if no folder definitions can be found

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Sep 5 20:20:54 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch sid
in repository owncloud-client.

commit 653b8494f505d4be353f54ec234604c64625ba0f
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Thu Jun 12 16:53:46 2014 +0200

    FolderMan: Migrate folderlist if no folder definitions can be found
    
    and the account indicates that it was migrated. In that case,
    read the folder definitions from the ownCloud config directory.
---
 src/mirall/folderman.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp
index 6c4b1b8..7aa08f4 100644
--- a/src/mirall/folderman.cpp
+++ b/src/mirall/folderman.cpp
@@ -13,10 +13,13 @@
  */
 
 #include "mirall/folderman.h"
+#include "mirall/account.h"
+
 #include "mirall/mirallconfigfile.h"
 #include "mirall/folder.h"
 #include "mirall/syncresult.h"
 #include "mirall/theme.h"
+#include "mirall/accountmigrator.h"
 
 #include <neon/ne_socket.h>
 
@@ -147,6 +150,15 @@ int FolderMan::setupFolders()
   dir.setFilter(QDir::Files | QDir::Hidden);
   QStringList list = dir.entryList();
 
+  if( list.count() == 0 ) {
+      // maybe the account was just migrated.
+      Account *acc = AccountManager::instance()->account();
+      if ( acc && acc->wasMigrated() ) {
+          AccountMigrator accMig;
+          list = accMig.migrateFolderDefinitons();
+      }
+  }
+
   foreach ( const QString& alias, list ) {
     Folder *f = setupFolderFromConfigFile( alias );
     if( f ) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list