fix: test if it's green edition
This commit is contained in:
parent
daaf0b69cc
commit
7b60c9fa1d
|
@ -5626,7 +5626,7 @@ void MainWindow::onFileRenamedInFileSystemModel(const QString &path, const QStri
|
|||
QString oldFile = folder.absoluteFilePath(oldName);
|
||||
QString newFile = folder.absoluteFilePath(newName);
|
||||
|
||||
Editor *e = mEditorList->getOpenedEditorByFilename(path);
|
||||
Editor *e = mEditorList->getOpenedEditorByFilename(oldFile);
|
||||
if (e) {
|
||||
e->setFilename(newFile);
|
||||
}
|
||||
|
|
|
@ -327,12 +327,20 @@ bool isGreenEdition()
|
|||
QString keyString = R"(Software\Microsoft\Windows\CurrentVersion\Uninstall\RedPanda-C++)";
|
||||
QString systemInstallPath;
|
||||
readRegistry(HKEY_LOCAL_MACHINE, keyString, "InstallLocation", systemInstallPath);
|
||||
if (!systemInstallPath.isEmpty())
|
||||
if (systemInstallPath.isEmpty()) {
|
||||
readRegistry(HKEY_LOCAL_MACHINE, keyString, "UninstallString", systemInstallPath);
|
||||
systemInstallPath = excludeTrailingPathDelimiter(extractFileDir(systemInstallPath));
|
||||
} else
|
||||
systemInstallPath = excludeTrailingPathDelimiter(systemInstallPath);
|
||||
QString userInstallPath;
|
||||
readRegistry(HKEY_CURRENT_USER, keyString, "InstallLocation", userInstallPath);
|
||||
if (!userInstallPath.isEmpty())
|
||||
if (userInstallPath.isEmpty()) {
|
||||
readRegistry(HKEY_CURRENT_USER, keyString, "UninstallString", userInstallPath);
|
||||
userInstallPath = excludeTrailingPathDelimiter(extractFileDir(userInstallPath));
|
||||
} else
|
||||
userInstallPath = excludeTrailingPathDelimiter(userInstallPath);
|
||||
systemInstallPath = localizePath(systemInstallPath);
|
||||
userInstallPath = localizePath(userInstallPath);
|
||||
gIsGreenEdition = appPath.compare(systemInstallPath, Qt::CaseInsensitive) != 0 &&
|
||||
appPath.compare(userInstallPath, Qt::CaseInsensitive) != 0;
|
||||
gIsGreenEditionInited = true;
|
||||
|
|
Loading…
Reference in New Issue