Skip to content

Commit

Permalink
Refactor when to use setLastFileOpened
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiromu Hota committed Jul 14, 2017
1 parent 8a8a74d commit a5536a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions ui/src/org/pentaho/di/ui/spoon/Spoon.java
Original file line number Diff line number Diff line change
Expand Up @@ -7989,6 +7989,7 @@ public void loadLastUsedFiles() {
|| lastUsedFile.isSourceRepository() && rep != null
&& rep.getName().equals( lastUsedFile.getRepositoryName() ) ) {
loadLastUsedFile( lastUsedFile, rep == null ? null : rep.getName(), false );
setLastFileOpened( lastUsedFile.getFilename() );
}
} catch ( Exception e ) {
hideSplash();
Expand Down
13 changes: 3 additions & 10 deletions ui/src/org/pentaho/di/ui/spoon/WebSpoonEntryPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,12 @@ protected void createContents( Composite parent ) {
LogChannel.GENERAL.logError( "Error calling extension points", e );
}

// For VFS browser, set the user data directory. This will be overwritten by the last open file if exists.
Spoon.getInstance().setLastFileOpened( Const.getKettleUserDataDirectory() );

// Load last used files
Spoon.getInstance().loadLastUsedFiles();

// For VFS browser set the last open file if exists, otherwise set the user data directory
Spoon.getInstance().setLastFileOpened( Const.getKettleUserDataDirectory() );
List<LastUsedFile> lastUsedFiles = Spoon.getInstance().getProperties().getOpenTabFiles();
if ( lastUsedFiles.size() != 0 ) {
LastUsedFile lastUsedFile = lastUsedFiles.get( lastUsedFiles.size() - 1 );
if ( !lastUsedFile.isSourceRepository() ) {
Spoon.getInstance().setLastFileOpened( lastUsedFile.getFilename() );
}
}

/*
* The following lines are webSpoon additional functions
*/
Expand Down

0 comments on commit a5536a4

Please sign in to comment.