Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004805 [Squeak] Kernel minor always 09-09-06 15:43 09-09-06 15:43
Reporter Krivanek View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 3.10
Summary 0004805: [KernelImageOverride] Project
Description In Kernel image the Project class were modified to support only one (default) project. So there's no isolation too. This is big problem because Projects are too much nested in the system to get rid of them and they are too much Morphic dependent to let them be in form they have today. Kernel image currently process only the most important patches for projects. This whole class needs refactoring.

original definition:

Model subclass: #Project
    instanceVariableNames: 'world changeSet transcript parentProject previousProject displayDepth viewSize thumbnail nextProject guards projectParameters isolatedHead inForce version urlList environment lastDirectory lastSavedAtSeconds projectPreferenceFlagDictionary resourceManager'
    classVariableNames: 'AllProjects CurrentProject GoalFreePercent GoalNotMoreThan UIProcess'
    poolDictionaries: ''
    category: 'System-Support'

new definition:

Model subclass: #Project
    instanceVariableNames: 'changeSet transcript displayDepth projectParameters environment lastDirectory projectPreferenceFlagDictionary'
    classVariableNames: 'CurrentProject'
    poolDictionaries: ''
    category: 'System-Support'

original:

storeDataOn: aDataStream
    "Write me out. All references to other projects are weak references. They only go out if they are written for another reason."
    | cntInstVars cntIndexedVars localInstVars offset |

    cntInstVars _ self class instSize.
    cntIndexedVars _ self basicSize.
    localInstVars _ Project instVarNames.
    offset _ Project superclass instSize.
    aDataStream
        beginInstance: self class
        size: cntInstVars + cntIndexedVars.
    1 to: cntInstVars do:
        [:ii |
        (ii between: offset+1 and: offset + localInstVars size)
            ifTrue: [(#('parentProject' 'previousProject' 'nextProject') includes:
                (localInstVars at: ii-offset))
                    ifTrue: [aDataStream nextPutWeak: (self instVarAt: ii)]
                                "owner only written if in our tree"
                    ifFalse: [aDataStream nextPut: (self instVarAt: ii)]]
            ifFalse: [aDataStream nextPut: (self instVarAt: ii)]].

    1 to: cntIndexedVars do:
        [:i | aDataStream nextPut: (self basicAt: i)]


override:

storeDataOn: aDataStream

    self error: 'Can not store projects'

original:

compileAll: newClass from: oldClass
    "Make sure that shadowed methods in isolation layers get recompiled.
    Traversal is done elsewhere. This simply handles the current project."

    isolatedHead == true ifFalse: [^ self]. "only isolated projects need to act on this."
    
    changeSet compileAll: newClass from: oldClass

override:

compileAll: newClass from: oldClass
    "Make sure that shadowed methods in isolation layers get recompiled.
    Traversal is done elsewhere. This simply handles the current project."

    changeSet compileAll: newClass from: oldClass

original:

initialize
    "Initialize the project, seting the CurrentProject as my parentProject and initializing my project preferences from those of the CurrentProject"

    changeSet _ ChangeSet new.
    transcript _ TranscriptStream new.
    displayDepth _ Display depth.
    parentProject _ CurrentProject.
    isolatedHead _ false.
    self initializeProjectPreferences

override:

initialize
    "Initialize the project, seting the CurrentProject as my parentProject and initializing my project preferences from those of the CurrentProject"

    changeSet := ChangeSet new.
    transcript := TranscriptStream new.
    displayDepth := Display depth.
    self initializeProjectPreferences

original

invoke
    "Install all methods changed here into method dictionaries.
    Make my versions be the ones that will be called."

    isolatedHead ifFalse: [^ self error: 'This isnt an isolation layer.'].
    inForce ifTrue: [^ self error: 'This layer is already in force.'].
    changeSet invoke.
    inForce _ true.

override:

invoke
    "Install all methods changed here into method dictionaries.
    Make my versions be the ones that will be called."

    isolatedHead ifFalse: [^ self error: 'This isnt an isolation layer.'].
    inForce ifTrue: [^ self error: 'This layer is already in force.'].
    changeSet invoke.
    inForce _ true.

original:

updateLocaleDependents
    "Set the project's natural language as indicated"

    ActiveWorld allTileScriptingElements do: [:viewerOrScriptor |
            viewerOrScriptor localeChanged].

    Flaps disableGlobalFlaps: false.
    Preferences eToyFriendly
        ifTrue: [
            Flaps addAndEnableEToyFlaps.
            ActiveWorld addGlobalFlaps]
        ifFalse: [Flaps enableGlobalFlaps].

    (Project current isFlapIDEnabled: 'Navigator' translated)
        ifFalse: [Flaps enableDisableGlobalFlapWithID: 'Navigator' translated].

    Utilities emptyScrapsBook.
    MenuIcons initializeTranslations.

    LanguageEnvironment localeChanged.

    "self setFlaps.
    self setPaletteFor: aLanguageSymbol."

override:

updateLocaleDependents
    "Set the project's natural language as indicated"

    LanguageEnvironment localeChanged.

original:

isolationSet

    "Return the changeSet for this isolation layer or nil"
    isolatedHead == true ifTrue: [^ changeSet].
    self isTopProject ifTrue: [^ nil]. "At the top, but not isolated"
    ^ parentProject isolationSet


override:

isolationSet

    "Return the changeSet for this isolation layer or nil"
    
    ^ nil

original:

setChangeSet: aChangeSet

    isolatedHead == true ifTrue: [^ self]. "ChangeSet of an isolated project cannot be changed"
    changeSet _ aChangeSet


override:

setChangeSet: aChangeSet

    changeSet := aChangeSet

original

class initialize
    "This is the Top Project."

    CurrentProject ifNil:
        [CurrentProject _ super new initialProject.
        Project spawnNewProcessAndTerminateOld: true].

    "Project initialize"

override:

class initialize
    "This is the Top Project."

    CurrentProject ifNil:
        [CurrentProject _ super new initialProject.
        Project spawnNewProcessAndTerminateOld: true].

    "Project initialize"

original:

class allProjects

    ^AllProjects ifNil: [
        Smalltalk garbageCollect.
        AllProjects _ self allSubInstances select: [:p | p name notNil].
    ].

override:

class allProjects


    ^ { self current }.
Additional Information
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
09-09-06 15:43 Krivanek New Issue


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
27 total queries executed.
24 unique queries executed.
Powered by Mantis Bugtracker