// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.util.progress

import com.intellij.openapi.progress.ProgressIndicator

class StepsProgressIndicator(private val indicator: ProgressIndicator, private val totalSteps: Int) : ProgressIndicator by indicator {
  private var finishedTasks = 0

  fun nextStep() {
    finishedTasks++
    fraction = 0.0
  }

  override fun setFraction(fraction: Double) {
    indicator.fraction = (finishedTasks + fraction) / totalSteps.toDouble()
  }
}
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.util.progress

import com.intellij.ide.util.DelegatingProgressIndicator
import com.intellij.openapi.progress.ProgressIndicator

class StepsProgressIndicator(private val indicator: ProgressIndicator, private val totalSteps: Int) :
  DelegatingProgressIndicator(indicator) {

  private var finishedTasks = 0

  fun nextStep() {
    finishedTasks++
    fraction = 0.0
  }

  override fun setFraction(fraction: Double) {
    indicator.fraction = (finishedTasks + fraction) / totalSteps.toDouble()
  }
}
Use DelegatingProgressIndicator instead of kotlin's delegation to properly implement StandardProgressIndicator
[vcs] Use DelegatingProgressIndicator instead of kotlin's delegation to properly implement StandardProgressIndicator

GitOrigin-RevId: ef59cf70c02668e62b5f26541a470c738ba8d520
allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community