mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-187755: start trial automatically if a trial is available after importing configs from another product
In this case we consider the user new GitOrigin-RevId: 9af22c07c0ddc7330bc8d8852e4cb20ca9f0fd72
This commit is contained in:
committed by
intellij-monorepo-bot
parent
10c9faeefd
commit
8ca83f9d19
+2
-1
@@ -289,10 +289,11 @@ class JbImportServiceImpl(private val coroutineScope: CoroutineScope) : JbServic
|
||||
}
|
||||
|
||||
private fun toJbProductInfo(confDir: Path): JbProductInfo? {
|
||||
val ideName: String = IDEData.IDE_MAP.keys.filter { confDir.name.startsWith(it) }.maxByOrNull { it.length } ?: run {
|
||||
val ideData = IDEData.getForConfigDir(confDir) ?: run {
|
||||
logger.info("$confDir is not prefixed with with any known IDE name. Skipping it")
|
||||
return null
|
||||
}
|
||||
val ideName: String = ideData.folderName
|
||||
val ideVersion = confDir.name.substring(ideName.length)
|
||||
if (ideVersion.isEmpty()) {
|
||||
logger.info("$confDir doesn't contain any version info. Skipping it")
|
||||
|
||||
+9
@@ -5,7 +5,9 @@ import com.intellij.ide.startup.importSettings.StartupImportIcons.IdeIcons.*
|
||||
import com.intellij.ide.startup.importSettings.data.IconProductSize
|
||||
import com.intellij.ide.startup.importSettings.jb.IDEData.Companion.IDE_MAP
|
||||
import com.intellij.util.PlatformUtils
|
||||
import java.nio.file.Path
|
||||
import javax.swing.Icon
|
||||
import kotlin.io.path.name
|
||||
|
||||
object NameMappings {
|
||||
fun getIcon(ideName: String, iconSize: IconProductSize): Icon? = when (iconSize) {
|
||||
@@ -78,5 +80,12 @@ enum class IDEData(
|
||||
PlatformUtils.isWebStorm() -> WEBSTORM
|
||||
else -> null
|
||||
}
|
||||
|
||||
fun getForConfigDir(configDir: Path): IDEData? {
|
||||
return IDEData.IDE_MAP
|
||||
.filter { configDir.name.startsWith(it.key) }
|
||||
.maxByOrNull { it.key.length }
|
||||
?.value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user