[Pkg-owncloud-commits] [owncloud-client] 90/498: FolderMan: fix a #warning in the migration path
Sandro Knauß
hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:38 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 299fa2dee6df441247c6c3e6337ebe038f8b2ce3
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Tue May 12 16:48:19 2015 +0200
FolderMan: fix a #warning in the migration path
---
src/gui/folderman.cpp | 9 +++++----
src/gui/folderman.h | 7 +++++--
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp
index 0135e1e..ec99dac 100644
--- a/src/gui/folderman.cpp
+++ b/src/gui/folderman.cpp
@@ -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;
diff --git a/src/gui/folderman.h b/src/gui/folderman.h
index 9b6ff4e..9fc0119 100644
--- a/src/gui/folderman.h
+++ b/src/gui/folderman.h
@@ -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.
--
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