Account Migrator: Switch to string comparison for URLs.

QUrl does not normalize trailing slashes, so there is no benefit
of using QUrl here.
This commit is contained in:
Daniel Molkentin 2014-08-31 19:50:20 +02:00
parent 9d3b09159e
commit d770f9cc1a

View File

@ -141,13 +141,15 @@ Account* Account::restore()
// Check the theme url to see if it is the same url that the oC config was for
QString overrideUrl = Theme::instance()->overrideServerUrl();
if( !overrideUrl.isEmpty() ) {
if (overrideUrl.endsWith('/')) { overrideUrl.chop(1); }
QString oCUrl = oCSettings->value(QLatin1String(urlC)).toString();
if (oCUrl.endsWith('/')) { oCUrl.chop(1); }
// in case the urls are equal reset the settings object to read from
// the ownCloud settings object
qDebug() << "Migrate oC config if " << oCUrl << " == " << overrideUrl << ":"
<< (QUrl(oCUrl) == QUrl(overrideUrl) ? "Yes" : "No");
if( QUrl(oCUrl) == QUrl(overrideUrl) ) {
<< (oCUrl == overrideUrl ? "Yes" : "No");
if( oCUrl == overrideUrl ) {
migratedCreds = true;
settings.reset( oCSettings );
} else {