mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
fix(utility): change sync folder display name when migrating.
Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
parent
cde75c0e38
commit
fcd9d15754
@ -190,9 +190,6 @@ QString Utility::syncFolderDisplayName(const QString ¤tDisplayName, const
|
||||
|
||||
void Utility::migrateFavLink(const QString &folder)
|
||||
{
|
||||
//overwrite Desktop.ini, update icon
|
||||
setupDesktopIni(folder, true);
|
||||
|
||||
const QDir folderDir(QDir::fromNativeSeparators(folder));
|
||||
const auto oldDirName = folderDir.dirName();
|
||||
const auto nextcloud = QStringLiteral("Nextcloud");
|
||||
@ -201,6 +198,16 @@ void Utility::migrateFavLink(const QString &folder)
|
||||
return;
|
||||
}
|
||||
|
||||
const auto folderDisplayName = syncFolderDisplayName(oldDirName, QStringLiteral(APPLICATION_NAME));
|
||||
// overwrite Desktop.ini, update icon, update folder display name
|
||||
setupDesktopIni(folder, true);
|
||||
QFile desktopIni(folder + QLatin1String("/Desktop.ini"));
|
||||
desktopIni.open(QFile::WriteOnly);
|
||||
desktopIni.write("\r\nLocalizedResourceName=");
|
||||
desktopIni.write(folderDisplayName.toUtf8());
|
||||
desktopIni.write("\r\n");
|
||||
desktopIni.close();
|
||||
|
||||
const auto pathToLinks = systemPathToLinks();
|
||||
if (pathToLinks.isEmpty()) {
|
||||
qCWarning(lcUtility) << "SHGetKnownFolderPath for links has failed.";
|
||||
@ -209,7 +216,7 @@ void Utility::migrateFavLink(const QString &folder)
|
||||
|
||||
const QDir dirPathToLinks(pathToLinks);
|
||||
const auto oldLnkFilename = dirPathToLinks.filePath(oldDirName + QLatin1String(".lnk"));
|
||||
const auto newLnkFilename = dirPathToLinks.filePath(syncFolderDisplayName(oldDirName, QStringLiteral(APPLICATION_NAME)) + QLatin1String(".lnk"));
|
||||
const auto newLnkFilename = dirPathToLinks.filePath(folderDisplayName + QLatin1String(".lnk"));
|
||||
|
||||
if (QFile::exists(newLnkFilename)) {
|
||||
qCWarning(lcUtility) << "New lnk file already exists" << newLnkFilename;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user