mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-17 03:11:51 +03:00
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.
This commit is contained in:
parent
6ed6f84f6e
commit
653b8494f5
1 changed files with 12 additions and 0 deletions
|
@ -13,10 +13,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mirall/folderman.h"
|
#include "mirall/folderman.h"
|
||||||
|
#include "mirall/account.h"
|
||||||
|
|
||||||
#include "mirall/mirallconfigfile.h"
|
#include "mirall/mirallconfigfile.h"
|
||||||
#include "mirall/folder.h"
|
#include "mirall/folder.h"
|
||||||
#include "mirall/syncresult.h"
|
#include "mirall/syncresult.h"
|
||||||
#include "mirall/theme.h"
|
#include "mirall/theme.h"
|
||||||
|
#include "mirall/accountmigrator.h"
|
||||||
|
|
||||||
#include <neon/ne_socket.h>
|
#include <neon/ne_socket.h>
|
||||||
|
|
||||||
|
@ -147,6 +150,15 @@ int FolderMan::setupFolders()
|
||||||
dir.setFilter(QDir::Files | QDir::Hidden);
|
dir.setFilter(QDir::Files | QDir::Hidden);
|
||||||
QStringList list = dir.entryList();
|
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 ) {
|
foreach ( const QString& alias, list ) {
|
||||||
Folder *f = setupFolderFromConfigFile( alias );
|
Folder *f = setupFolderFromConfigFile( alias );
|
||||||
if( f ) {
|
if( f ) {
|
||||||
|
|
Loading…
Reference in a new issue