[Pkg-owncloud-commits] [owncloud-client] 10/38: AccountMigrator: Read path from QDir::fromNativeSeperators(), add debug.

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 e17243bc1fd5d774a3a4d4d59c0a621f907edecd
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Jun 25 11:11:27 2014 +0200

    AccountMigrator: Read path from QDir::fromNativeSeperators(), add debug.
---
 src/mirall/account.cpp         | 9 +++++++--
 src/mirall/accountmigrator.cpp | 8 ++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/mirall/account.cpp b/src/mirall/account.cpp
index f057324..80be336 100644
--- a/src/mirall/account.cpp
+++ b/src/mirall/account.cpp
@@ -29,6 +29,7 @@
 #include <QSslSocket>
 #include <QNetworkCookieJar>
 #include <QFileInfo>
+#include <QDir>
 
 #include <QDebug>
 
@@ -124,12 +125,14 @@ Account* Account::restore()
     // if the settings file could not be opened, the childKeys list is empty
     if( settings->childKeys().isEmpty() ) {
         // Now try to open the original ownCloud settings to see if they exist.
-        QString oCCfgFile = settings->fileName();
+        QString oCCfgFile = QDir::fromNativeSeparators( settings->fileName() );
         // replace the last two segments with ownCloud/owncloud.cfg
         oCCfgFile = oCCfgFile.left( oCCfgFile.lastIndexOf('/'));
         oCCfgFile = oCCfgFile.left( oCCfgFile.lastIndexOf('/'));
         oCCfgFile += QLatin1String("/ownCloud/owncloud.cfg");
 
+        qDebug() << "Migrate: checking old config " << oCCfgFile;
+
         QFileInfo fi( oCCfgFile );
         if( fi.isReadable() ) {
             QSettings *oCSettings = new QSettings(oCCfgFile, QSettings::IniFormat);
@@ -142,7 +145,9 @@ Account* Account::restore()
 
                 // in case the urls are equal reset the settings object to read from
                 // the ownCloud settings object
-                if( oCUrl == overrideUrl ) {
+                qDebug() << "Migrate oC config if " << oCUrl << " == " << overrideUrl << ":"
+                         << (QUrl(oCUrl) == QUrl(overrideUrl) ? "Yes" : "No");
+                if( QUrl(oCUrl) == QUrl(overrideUrl) ) {
                     migratedCreds = true;
                     settings.reset( oCSettings );
                 } else {
diff --git a/src/mirall/accountmigrator.cpp b/src/mirall/accountmigrator.cpp
index 51e3f2e..ba4d49f 100644
--- a/src/mirall/accountmigrator.cpp
+++ b/src/mirall/accountmigrator.cpp
@@ -21,6 +21,7 @@
 #include <QStringList>
 #include <QDir>
 #include <QFileInfo>
+#include <QDebug>
 
 namespace Mirall {
 
@@ -55,7 +56,10 @@ QStringList AccountMigrator::migrateFolderDefinitons()
     oCPath = oCPath.left( oCPath.lastIndexOf('/'));
 
     themePath += QLatin1String( "folders");
-    oCPath += QLatin1String( "ownCloud/folders" );
+    oCPath += QLatin1String( "/ownCloud/folders" );
+
+    qDebug() << "Migrator: theme-path: " << themePath;
+    qDebug() << "Migrator: ownCloud path: " << oCPath;
 
     // get a dir listing of the ownCloud folder definitions and copy
     // them over to the theme dir
@@ -69,6 +73,7 @@ QStringList AccountMigrator::migrateFolderDefinitons()
         QString oCFile = oCPath+QDir::separator()+file;
         if( QFile::copy( oCFile, themeFile ) ) {
             re.append(file);
+            qDebug() << "Migrator: Folder definition migrated: " << file;
 
             // fix the connection entry of the folder definition
             QSettings settings(themeFile, QSettings::IniFormat);
@@ -79,7 +84,6 @@ QStringList AccountMigrator::migrateFolderDefinitons()
     }
 
     return re;
-
 }
 
 }

-- 
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