diff --git a/src/gui/navigationpanehelper.cpp b/src/gui/navigationpanehelper.cpp index 3b2221f3c68d..46c2872eb8c8 100644 --- a/src/gui/navigationpanehelper.cpp +++ b/src/gui/navigationpanehelper.cpp @@ -71,6 +71,7 @@ void NavigationPaneHelper::updateCloudStorageRegistry() Utility::registryWalkSubKeys(HKEY_CURRENT_USER, nameSpaceKey, [&entriesToRemove](HKEY key, const QString &subKey) { QVariant appName = Utility::registryGetKeyValue(key, subKey, QStringLiteral("ApplicationName")); + qCDebug(lcNavPane) << "Searching for user with subKey:" << subKey; if (appName.toString() == QLatin1String(APPLICATION_NAME)) { QUuid clsid{ subKey }; Q_ASSERT(!clsid.isNull()); @@ -165,6 +166,10 @@ void NavigationPaneHelper::updateCloudStorageRegistry() qCInfo(lcNavPane) << "Explorer Cloud storage provider: now unused, removing own CLSID" << clsidStr; #ifdef Q_OS_WIN + Utility::registryDeleteKeyTree(HKEY_CURRENT_USER, clsidPath + QStringLiteral("\\DefaultIcon")); + qCInfo(lcNavPane) << "Removed" << clsidPath + QStringLiteral("\\DefaultIcon") << "for user" << clsidStr; + Utility::registryDeleteKeyTree(HKEY_CURRENT_USER, clsidPathWow64 + QStringLiteral("\\DefaultIcon")); + qCInfo(lcNavPane) << "Removed" << clsidPathWow64 + QStringLiteral("\\DefaultIcon") << "for user" << clsidStr; Utility::registryDeleteKeyTree(HKEY_CURRENT_USER, clsidPath); Utility::registryDeleteKeyTree(HKEY_CURRENT_USER, clsidPathWow64); Utility::registryDeleteKeyTree(HKEY_CURRENT_USER, namespacePath); diff --git a/src/libsync/vfs/cfapi/cfapiwrapper.cpp b/src/libsync/vfs/cfapi/cfapiwrapper.cpp index a483d2c06638..1eefd2fb2c57 100644 --- a/src/libsync/vfs/cfapi/cfapiwrapper.cpp +++ b/src/libsync/vfs/cfapi/cfapiwrapper.cpp @@ -618,6 +618,26 @@ bool deleteSyncRootRegistryKey(const QString &syncRootPath, const QString &provi const auto currentUserSyncRootIdPattern = QString("%1!%2!%3").arg(providerName).arg(windowsSid).arg(accountDisplayName); bool result = true; + struct RegistryKeyInfo { + QString subKey; + QString valueName; + int type; + QVariant value; + }; + const auto syncRootId = QString("%1!%2!%3!%4").arg(providerName).arg(windowsSid).arg(accountDisplayName).arg(syncRootPath); + qCInfo(lcCfApiWrapper) << "syncRootPath:" << syncRootPath; + qCInfo(lcCfApiWrapper) << "syncRootId:" << syncRootId; + const QString subKey = syncRootManagerRegKey + QStringLiteral("\\") + syncRootId; + const QString valueName = QStringLiteral("IconResource"); + const int type = REG_EXPAND_SZ; + const QVariant value = QString(QDir::toNativeSeparators(qApp->applicationFilePath()) + QStringLiteral(",0")); + qCInfo(lcCfApiWrapper) << "Going to delete Registry key" << subKey; + qCInfo(lcCfApiWrapper) << "with value name" << valueName; + qCInfo(lcCfApiWrapper) << "and value" << value; + + if(OCC::Utility::registryDeleteKeyTree(HKEY_LOCAL_MACHINE, subKey)) { + qCInfo(lcCfApiWrapper) << "Successfully deleted icon from" << syncRootPath; + } // walk through each registered syncRootId OCC::Utility::registryWalkSubKeys(HKEY_LOCAL_MACHINE, syncRootManagerRegKey, [&](HKEY, const QString &syncRootId) { @@ -631,6 +651,7 @@ bool deleteSyncRootRegistryKey(const QString &syncRootPath, const QString &provi } } }); + return result; } return true;