Skip to content

Commit

Permalink
Merge branch 'private-release/v2.0.0' into private-release/v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KUGDev committed Sep 26, 2024
2 parents 25ef30d + 56475e0 commit 352e653
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package eu.ibagroup.formainframe.dataops.attributes
import com.intellij.openapi.util.io.FileAttributes
import eu.ibagroup.formainframe.config.connect.ConnectionConfigBase
import eu.ibagroup.formainframe.dataops.DataOpsManager
import eu.ibagroup.formainframe.utils.runWriteActionInEdtAndWait
import eu.ibagroup.formainframe.utils.sendTopic
import eu.ibagroup.formainframe.vfs.MFVirtualFile
import eu.ibagroup.formainframe.vfs.MFVirtualFileSystem
Expand Down Expand Up @@ -102,9 +101,7 @@ abstract class MFRemoteAttributesServiceBase<Connection : ConnectionConfigBase,
*/
private fun reassignAttributesToFile(file: MFVirtualFile, oldAttributes: Attributes, newAttributes: Attributes) {
obtainAndRenameUrlDirIfNeeded(newAttributes)
runWriteActionInEdtAndWait {
reassignAttributesAfterUrlFolderRenaming(file, oldAttributes, newAttributes)
}
reassignAttributesAfterUrlFolderRenaming(file, oldAttributes, newAttributes)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ abstract class RemoteFileFetchProviderBase<Connection : ConnectionConfigBase, Re
progressIndicator: ProgressIndicator
): List<File> {
val fetched = fetchResponse(query, progressIndicator)
return fetched.mapNotNull {
convertResponseToFile(it)
return runWriteActionInEdtAndWait {
fetched.mapNotNull {
convertResponseToFile(it)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,12 @@ fun runWriteActionInEdt(block: () -> Unit) {
}
}

fun runWriteActionInEdtAndWait(block: () -> Unit) {
fun <T> runWriteActionInEdtAndWait(block: () -> T): T {
var result: T? = null
runInEdtAndWait {
runWriteAction(block)
result = runWriteAction(block)
}
return result ?: throw Exception("runWriteAction did not return any result")
}

/** Return the specified logger instance */
Expand Down

0 comments on commit 352e653

Please sign in to comment.