Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13023 closed enhancement (fixed)

[Patch] Replace uses of hasEditLayer() with new layer manager.

Reported by: michael2402 Owned by: team
Priority: normal Milestone: 16.06
Component: Core Version:
Keywords: gsoc-core Cc: Don-vip, bastiK, stoecker

Description

Replace uses of old Main.hasEditLayer with layer manager.

The layer manager does not provide a hasEditLayer method. You can use an != null check here. In most cases where this was used you want to work with the edit layer directly afterwards, so you can simply get it and check if it is not null.

Attachments (1)

patch-layer-manager-has-edit-layer.patch (18.7 KB) - added by michael2402 3 years ago.

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by michael2402

comment:1 Changed 3 years ago by Don-vip

Still 4 warnings:

    [javac] C:\SVN\josm\core\src\org\openstreetmap\josm\gui\dialogs\RelationListDialog.java:341: warning: [deprecation] hasEditLayer() in Main has been deprecated
    [javac]             if (!Main.main.hasEditLayer()) return;
    [javac]                           ^
    [javac] C:\SVN\josm\core\src\org\openstreetmap\josm\gui\tagging\presets\TaggingPresetSearchAction.java:32: warning: [deprecation] hasEditLayer() in Main has been deprecated
    [javac]         if (!Main.main.hasEditLayer())
    [javac]                       ^
    [javac] C:\SVN\josm\core\src\org\openstreetmap\josm\gui\tagging\presets\TaggingPresetSearchPrimitiveDialog.java:47: warning: [deprecation] hasEditLayer() in Main has been deprecated
    [javac]             if (Main.main.hasEditLayer()) {
    [javac]                          ^
    [javac] C:\SVN\josm\core\src\org\openstreetmap\josm\gui\dialogs\CommandStackDialog.java:271: warning: [deprecation] hasEditLayer() in Main has been deprecated
    [javac]         if (!Main.main.hasEditLayer())
    [javac]                       ^
Last edited 3 years ago by Don-vip (previous) (diff)

comment:2 Changed 3 years ago by Don-vip

Milestone: 16.06

comment:3 Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 10453/josm:

fix #13023 - Replace uses of hasEditLayer() with new layer manager (patch by michael2402, modified) - gsoc-core

comment:4 Changed 3 years ago by michael2402

I know. Those were the ones I want to investigate further if they are required or can be replaced by a better solution.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.