mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-28 07:54:49 +03:00
FolderMan: fix a #warning in the migration path
This commit is contained in:
parent
de9770f52a
commit
299fa2dee6
2 changed files with 10 additions and 6 deletions
|
@ -232,8 +232,10 @@ int FolderMan::setupFoldersMigration()
|
|||
dir.setFilter(QDir::Files | QDir::Hidden);
|
||||
QStringList list = dir.entryList();
|
||||
|
||||
// Normaly there should be only one account when migrating.
|
||||
AccountState* accountState = AccountManager::instance()->accounts().value(0).data();
|
||||
foreach ( const QString& alias, list ) {
|
||||
Folder *f = setupFolderFromConfigFile( alias );
|
||||
Folder *f = setupFolderFromOldConfigFile( alias, accountState );
|
||||
if( f ) {
|
||||
slotScheduleSync(f);
|
||||
emit( folderSyncStateChange( f ) );
|
||||
|
@ -325,7 +327,8 @@ QString FolderMan::unescapeAlias( const QString& alias ) const
|
|||
|
||||
// filename is the name of the file only, it does not include
|
||||
// the configuration directory path
|
||||
Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
|
||||
Folder* FolderMan::setupFolderFromOldConfigFile(const QString &file, AccountState *accountState )
|
||||
{
|
||||
Folder *folder = 0;
|
||||
|
||||
qDebug() << " ` -> setting up:" << file;
|
||||
|
@ -376,8 +379,6 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
|
|||
targetPath.remove(0,1);
|
||||
}
|
||||
|
||||
#warning fixme: which account does this folder use?
|
||||
AccountState* accountState = AccountManager::instance()->accounts().value(0).data();
|
||||
if (!accountState) {
|
||||
qWarning() << "can't create folder without an account";
|
||||
return 0;
|
||||
|
|
|
@ -55,8 +55,11 @@ public:
|
|||
/** Returns the folder by alias or NULL if no folder with the alias exists. */
|
||||
Folder *folder( const QString& );
|
||||
|
||||
/** Creates a folder for a specific configuration, identified by alias. */
|
||||
Folder* setupFolderFromConfigFile(const QString & );
|
||||
/**
|
||||
* Migrate accounts from owncloud < 2.0
|
||||
* Creates a folder for a specific configuration, identified by alias.
|
||||
*/
|
||||
Folder* setupFolderFromOldConfigFile(const QString &, AccountState *account );
|
||||
|
||||
/**
|
||||
* Ensures that a given directory does not contain a .csync_journal.
|
||||
|
|
Loading…
Reference in a new issue