@@ -115,8 +115,8 @@ static constexpr int deleteFilesThresholdDefaultValue = 100;
115115constexpr auto accountsC = " Accounts" ;
116116constexpr auto legacyRelativeConfigLocationC = " /ownCloud/owncloud.cfg" ;
117117constexpr auto legacyCfgFileNameC = " owncloud.cfg" ;
118- constexpr auto unbrandedRelativeConfigLocationC = " /copyNextcloud/copyNextcloud .cfg" ;
119- constexpr auto unbrandedCfgFileNameC = " copyNextcloud .cfg" ;
118+ constexpr auto unbrandedRelativeConfigLocationC = " /Nextcloud/nextcloud .cfg" ;
119+ constexpr auto unbrandedCfgFileNameC = " nextcloud .cfg" ;
120120}
121121
122122namespace OCC {
@@ -1342,7 +1342,7 @@ void ConfigFile::setDiscoveredLegacyConfigFile(const QString &discoveredLegacyCo
13421342 _discoveredLegacyConfigFile = discoveredLegacyConfigFile;
13431343}
13441344
1345- bool ConfigFile::setupConfigFolderFromLegacyLocation (const QString &legacyLocation) const
1345+ bool ConfigFile::copyConfigFolderFromLegacyLocation (const QString &legacyLocation) const
13461346{
13471347 // Migrate from version <= 2.4
13481348 qApp->setApplicationName (Theme::instance ()->appNameGUI ());
@@ -1395,27 +1395,26 @@ QT_WARNING_POP
13951395 return false ;
13961396}
13971397
1398- QString ConfigFile::findLegacyClientConfigFile () const
1398+ void ConfigFile::findLegacyClientConfigFile ()
13991399{
14001400 qCInfo (lcConfigFile) << " Migrate: restoreFromLegacySettings, checking settings group"
14011401 << Theme::instance ()->appName ();
14021402
14031403 // try to open the correctly themed settings
14041404 auto settings = ConfigFile::settingsWithGroup (Theme::instance ()->appName ());
14051405
1406- QString validLegacyConfigFile;
14071406 // if the settings file could not be opened, the childKeys list is empty
14081407 // then try to load settings from a very old place
14091408 if (settings->childKeys ().isEmpty ()) {
14101409 // Legacy settings used QDesktopServices to get the location for the config folder in 2.4 and before
14111410 const auto legacy2_4CfgSettingsLocation = QString (QStandardPaths::writableLocation (QStandardPaths::GenericDataLocation) + QStringLiteral (" /data" ));
14121411 const auto legacy2_4CfgFileParentFolder = legacy2_4CfgSettingsLocation.left (legacy2_4CfgSettingsLocation.lastIndexOf (' /' ));
14131412
1414- // 2.5+ (rest of 2.x series)
1413+ // 2.5+ (rest of 2.x series)
14151414 const auto legacy2_5CfgSettingsLocation = QStandardPaths::writableLocation (Utility::isWindows () ? QStandardPaths::AppDataLocation : QStandardPaths::AppConfigLocation);
14161415 const auto legacy2_5CfgFileParentFolder = legacy2_5CfgSettingsLocation.left (legacy2_5CfgSettingsLocation.lastIndexOf (' /' ));
14171416
1418- // Now try the locations we use today
1417+ // Now try the locations we use today
14191418 const auto fullLegacyCfgFile = QDir::fromNativeSeparators (settings->fileName ());
14201419 const auto legacyCfgFileParentFolder = fullLegacyCfgFile.left (fullLegacyCfgFile.lastIndexOf (' /' ));
14211420 const auto legacyCfgFileGrandParentFolder = legacyCfgFileParentFolder.left (legacyCfgFileParentFolder.lastIndexOf (' /' ));
@@ -1443,8 +1442,7 @@ QString ConfigFile::findLegacyClientConfigFile() const
14431442
14441443 if (const QFileInfo configFileInfo (configFile);
14451444 configFileInfo.exists () && configFileInfo.isReadable ()) {
1446- qCInfo (lcConfigFile) << " Migrate: checking old config " << configFile;
1447- validLegacyConfigFile = configFile;
1445+ qCInfo (lcConfigFile) << " Migrate: saving old config file" << configFile;
14481446 setDiscoveredLegacyConfigFile (configFileInfo.filePath ());
14491447 setDiscoveredLegacyConfigPath (configFileInfo.canonicalPath ());
14501448 break ;
@@ -1453,7 +1451,5 @@ QString ConfigFile::findLegacyClientConfigFile() const
14531451 }
14541452 }
14551453 }
1456-
1457- return validLegacyConfigFile;
14581454}
14591455}
0 commit comments