This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 146696
Collapse All | Expand All

(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/MakeActionProvider.java (-1 / +1 lines)
Lines 203-209 Link Here
203
    private MakeConfigurationDescriptor getProjectDescriptor() {
203
    private MakeConfigurationDescriptor getProjectDescriptor() {
204
        if (projectDescriptor == null) {
204
        if (projectDescriptor == null) {
205
            ConfigurationDescriptorProvider pdp = project.getLookup().lookup(ConfigurationDescriptorProvider.class);
205
            ConfigurationDescriptorProvider pdp = project.getLookup().lookup(ConfigurationDescriptorProvider.class);
206
            projectDescriptor = pdp.getConfigurationDescriptor();
206
            projectDescriptor = pdp.getConfigurationDescriptor(false);
207
        }
207
        }
208
        return (MakeConfigurationDescriptor)projectDescriptor;
208
        return (MakeConfigurationDescriptor)projectDescriptor;
209
    }
209
    }
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/MakeProjectConfigurationProvider.java (-8 / +8 lines)
Lines 64-80 Link Here
64
    }
64
    }
65
65
66
    public Collection getConfigurations() {
66
    public Collection getConfigurations() {
67
        if (projectDescriptorProvider.getConfigurationDescriptor() == null) {
67
        if (projectDescriptorProvider.getConfigurationDescriptor(false) == null) {
68
            return Collections.EMPTY_SET;
68
            return Collections.EMPTY_SET;
69
        }
69
        }
70
        return projectDescriptorProvider.getConfigurationDescriptor().getConfs().getConfsAsCollection();
70
        return projectDescriptorProvider.getConfigurationDescriptor(false).getConfs().getConfsAsCollection();
71
    }
71
    }
72
72
73
    public ProjectConfiguration getActiveConfiguration() {
73
    public ProjectConfiguration getActiveConfiguration() {
74
        if (projectDescriptorProvider.getConfigurationDescriptor() == null) {
74
        if (projectDescriptorProvider.getConfigurationDescriptor(false) == null) {
75
            return null;
75
            return null;
76
        }
76
        }
77
        return projectDescriptorProvider.getConfigurationDescriptor().getConfs().getActive();
77
        return projectDescriptorProvider.getConfigurationDescriptor(false).getConfs().getActive();
78
    }
78
    }
79
79
80
    public void setActiveConfiguration(ProjectConfiguration configuration) throws IllegalArgumentException, IOException {
80
    public void setActiveConfiguration(ProjectConfiguration configuration) throws IllegalArgumentException, IOException {
Lines 84-98 Link Here
84
84
85
    public void addPropertyChangeListener(PropertyChangeListener lst) {
85
    public void addPropertyChangeListener(PropertyChangeListener lst) {
86
        pcs.addPropertyChangeListener(lst);
86
        pcs.addPropertyChangeListener(lst);
87
        if (projectDescriptorProvider != null && projectDescriptorProvider.getConfigurationDescriptor() != null) { // IZ 122372
87
        if (projectDescriptorProvider != null && projectDescriptorProvider.getConfigurationDescriptor(false) != null) { // IZ 122372
88
            projectDescriptorProvider.getConfigurationDescriptor().getConfs().addPropertyChangeListener(this);
88
            projectDescriptorProvider.getConfigurationDescriptor(false).getConfs().addPropertyChangeListener(this);
89
        }
89
        }
90
    }
90
    }
91
91
92
    public void removePropertyChangeListener(PropertyChangeListener lst) {
92
    public void removePropertyChangeListener(PropertyChangeListener lst) {
93
        pcs.removePropertyChangeListener(lst);
93
        pcs.removePropertyChangeListener(lst);
94
        if (projectDescriptorProvider != null && projectDescriptorProvider.getConfigurationDescriptor() != null) {
94
        if (projectDescriptorProvider != null && projectDescriptorProvider.getConfigurationDescriptor(false) != null) {
95
            projectDescriptorProvider.getConfigurationDescriptor().getConfs().removePropertyChangeListener(this);
95
            projectDescriptorProvider.getConfigurationDescriptor(false).getConfs().removePropertyChangeListener(this);
96
        }
96
        }
97
    }
97
    }
98
98
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/MakeSources.java (-1 / +1 lines)
Lines 97-103 Link Here
97
    private Sources initSources() {
97
    private Sources initSources() {
98
        final SourcesHelper h = new SourcesHelper(helper, project.evaluator());
98
        final SourcesHelper h = new SourcesHelper(helper, project.evaluator());
99
        ConfigurationDescriptorProvider pdp = project.getLookup().lookup(ConfigurationDescriptorProvider.class);
99
        ConfigurationDescriptorProvider pdp = project.getLookup().lookup(ConfigurationDescriptorProvider.class);
100
        ConfigurationDescriptor pd = pdp.getConfigurationDescriptor();
100
        ConfigurationDescriptor pd = pdp.getConfigurationDescriptor(false);
101
        if (pd != null) {
101
        if (pd != null) {
102
            MakeConfigurationDescriptor epd = (MakeConfigurationDescriptor) pd;
102
            MakeConfigurationDescriptor epd = (MakeConfigurationDescriptor) pd;
103
            Set<String> set = new LinkedHashSet<String>();
103
            Set<String> set = new LinkedHashSet<String>();
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/NativeProjectProvider.java (-2 / +5 lines)
Lines 92-99 Link Here
92
92
93
    public void runOnCodeModelReadiness(Runnable task) {
93
    public void runOnCodeModelReadiness(Runnable task) {
94
        if (getMakeConfigurationDescriptor() != null) {
94
        if (getMakeConfigurationDescriptor() != null) {
95
            DevelopmentHostConfiguration host = ((MakeConfiguration)getMakeConfigurationDescriptor().getConfs().getActive()).getDevelopmentHost();
95
            MakeConfiguration active = (MakeConfiguration)getMakeConfigurationDescriptor().getConfs().getActive();
96
            CompilerSetManagerEvents.get(host.getName()).runOnCodeModelReadiness(task);
96
            if (active != null) {
97
                DevelopmentHostConfiguration host = active.getDevelopmentHost();
98
                CompilerSetManagerEvents.get(host.getName()).runOnCodeModelReadiness(task);
99
            }
97
        }
100
        }
98
    }
101
    }
99
102
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/ConfigurationDescriptor.java (-2 / +16 lines)
Lines 44-51 Link Here
44
import javax.swing.Icon;
44
import javax.swing.Icon;
45
45
46
public abstract class ConfigurationDescriptor {
46
public abstract class ConfigurationDescriptor {
47
    private Configurations confs;
47
    private Configurations confs = new Configurations();
48
    int version = -1;
48
    int version = -1;
49
    private State state = State.READING;
49
50
50
    public ConfigurationDescriptor() {
51
    public ConfigurationDescriptor() {
51
    }
52
    }
Lines 81-86 Link Here
81
        this.version = version;
82
        this.version = version;
82
    }
83
    }
83
84
85
    public void setState(State state){
86
        this.state = state;
87
    }
88
    public State getState(){
89
        return state;
90
    }
91
84
    public abstract Icon getIcon();
92
    public abstract Icon getIcon();
85
93
86
    public abstract String getBaseDir();
94
    public abstract String getBaseDir();
Lines 97-102 Link Here
97
	// projectType is already cloned
105
	// projectType is already cloned
98
	clone.setConfs(confs.cloneConfs());
106
	clone.setConfs(confs.cloneConfs());
99
        clone.setVersion(getVersion());
107
        clone.setVersion(getVersion());
108
        clone.setState(this.getState());
100
    }
109
    }
101
110
102
    public abstract boolean save();
111
    public abstract boolean save();
Lines 104-107 Link Here
104
    public abstract boolean getModified();
113
    public abstract boolean getModified();
105
    public abstract void setModified();
114
    public abstract void setModified();
106
    public abstract void closed();
115
    public abstract void closed();
107
            }
116
    public enum State {
117
        READING,
118
        READY,
119
        BROKEN
120
    }
121
}
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/ConfigurationDescriptorProvider.java (-12 / +11 lines)
Lines 49-57 Link Here
49
import java.util.logging.Level;
49
import java.util.logging.Level;
50
import java.util.logging.LogRecord;
50
import java.util.logging.LogRecord;
51
import java.util.logging.Logger;
51
import java.util.logging.Logger;
52
import javax.swing.SwingUtilities;
53
import org.netbeans.modules.cnd.api.compilers.CompilerSet;
52
import org.netbeans.modules.cnd.api.compilers.CompilerSet;
54
import org.netbeans.modules.cnd.api.compilers.Tool;
53
import org.netbeans.modules.cnd.api.compilers.Tool;
54
import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptor.State;
55
import org.netbeans.modules.cnd.makeproject.api.platforms.Platforms;
55
import org.netbeans.modules.cnd.makeproject.api.platforms.Platforms;
56
import org.netbeans.modules.cnd.makeproject.configurations.ConfigurationXMLReader;
56
import org.netbeans.modules.cnd.makeproject.configurations.ConfigurationXMLReader;
57
import org.openide.filesystems.FileAttributeEvent;
57
import org.openide.filesystems.FileAttributeEvent;
Lines 82-87 Link Here
82
    
82
    
83
    private final Object readLock = new Object();
83
    private final Object readLock = new Object();
84
    public ConfigurationDescriptor getConfigurationDescriptor() {
84
    public ConfigurationDescriptor getConfigurationDescriptor() {
85
        return getConfigurationDescriptor(true);
86
    }
87
    public ConfigurationDescriptor getConfigurationDescriptor(boolean waitReading) {
85
        if (projectDescriptor == null || needReload) {
88
        if (projectDescriptor == null || needReload) {
86
            // attempt to read configuration descriptor
89
            // attempt to read configuration descriptor
87
            if (!hasTried) {
90
            if (!hasTried) {
Lines 110-125 Link Here
110
                            }
113
                            }
111
                        }
114
                        }
112
                        ConfigurationXMLReader reader = new ConfigurationXMLReader(projectDirectory);
115
                        ConfigurationXMLReader reader = new ConfigurationXMLReader(projectDirectory);
113
                        ConfigurationDescriptor newDescriptor = null;
114
116
115
                        if (SwingUtilities.isEventDispatchThread()) {
116
                            new Exception("Not allowed to use EDT for reading XML descriptor of project!").printStackTrace(System.err); // NOI18N
117
                            // PLEASE DO NOT ADD HACKS like Task.waitFinished()
118
                            // CHANGE YOUR LOGIC INSTEAD
119
120
                            // FIXUP for IZ#146696: cannot open projects: Not allowed to use EDT...
121
                            // return null;
122
                        }
123
                        try {
117
                        try {
124
                            projectDescriptor = reader.read(relativeOffset);
118
                            projectDescriptor = reader.read(relativeOffset);
125
                        } catch (java.io.IOException x) {
119
                        } catch (java.io.IOException x) {
Lines 127-142 Link Here
127
                        }
121
                        }
128
                        
122
                        
129
                        hasTried = true;
123
                        hasTried = true;
130
                        recordMetrics(USG_PROJECT_OPEN_CND, projectDescriptor);
131
                    }
124
                    }
132
                }
125
                }
133
            }
126
            }
127
        }
128
        if (waitReading && projectDescriptor instanceof MakeConfigurationDescriptor) {
129
            ((MakeConfigurationDescriptor)projectDescriptor).waitInitTask();
134
        }
130
        }
135
        return projectDescriptor;
131
        return projectDescriptor;
136
    }
132
    }
137
133
138
    public boolean gotDescriptor() {
134
    public boolean gotDescriptor() {
139
        return projectDescriptor != null;   
135
        return projectDescriptor != null && projectDescriptor.getState() != State.READING;   
140
    }
136
    }
141
    
137
    
142
    public static ConfigurationAuxObjectProvider[] getAuxObjectProviders() {
138
    public static ConfigurationAuxObjectProvider[] getAuxObjectProviders() {
Lines 163-168 Link Here
163
        Logger logger = Logger.getLogger("org.netbeans.ui.metrics.cnd"); // NOI18N
159
        Logger logger = Logger.getLogger("org.netbeans.ui.metrics.cnd"); // NOI18N
164
        if (logger.isLoggable(Level.INFO)) {
160
        if (logger.isLoggable(Level.INFO)) {
165
            LogRecord rec = new LogRecord(Level.INFO, msg);
161
            LogRecord rec = new LogRecord(Level.INFO, msg);
162
            if (descr.getConfs() == null || descr.getConfs().getActive() == null){
163
                return;
164
            }
166
                MakeConfiguration makeConfiguration = (MakeConfiguration) descr.getConfs().getActive();
165
                MakeConfiguration makeConfiguration = (MakeConfiguration) descr.getConfs().getActive();
167
                String type;
166
                String type;
168
                switch (makeConfiguration.getConfigurationType().getValue()) {
167
                switch (makeConfiguration.getConfigurationType().getValue()) {
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/Configurations.java (-4 / +4 lines)
Lines 55-61 Link Here
55
    public static final String PROP_ACTIVE_CONFIGURATION = "activeconfiguration"; // NOI18N
55
    public static final String PROP_ACTIVE_CONFIGURATION = "activeconfiguration"; // NOI18N
56
56
57
    private PropertyChangeSupport pcs;
57
    private PropertyChangeSupport pcs;
58
    private List<Configuration> configurations;
58
    private List<Configuration> configurations = new ArrayList();
59
59
60
    public Configurations() {
60
    public Configurations() {
61
        pcs = new PropertyChangeSupport(this);
61
        pcs = new PropertyChangeSupport(this);
Lines 100-106 Link Here
100
    }
100
    }
101
    */
101
    */
102
    public Configurations init(Configuration[] confs, int defaultConf) {
102
    public Configurations init(Configuration[] confs, int defaultConf) {
103
	configurations = new ArrayList();
103
	configurations.clear();
104
	for (int i = 0; i < confs.length; i ++)
104
	for (int i = 0; i < confs.length; i ++)
105
	    configurations.add(confs[i]);
105
	    configurations.add(confs[i]);
106
	if (defaultConf >= 0 && confs != null && confs.length > 0)
106
	if (defaultConf >= 0 && confs != null && confs.length > 0)
Lines 279-286 Link Here
279
     */
279
     */
280
    private void checkValidIndex(int index) {
280
    private void checkValidIndex(int index) {
281
	if (index < 0 || index >= size()) {
281
	if (index < 0 || index >= size()) {
282
	    ;// Error ???
282
	    // Error ???
283
	    ;// FIXUP ???
283
	    // FIXUP ???
284
	}
284
	}
285
    }
285
    }
286
286
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/MakeConfiguration.java (-1 / +3 lines)
Lines 502-508 Link Here
502
            // Base it on actual files added to project
502
            // Base it on actual files added to project
503
            for (int x = 0; x < items.length; x++) {
503
            for (int x = 0; x < items.length; x++) {
504
                ItemConfiguration itemConfiguration = items[x].getItemConfiguration(this);
504
                ItemConfiguration itemConfiguration = items[x].getItemConfiguration(this);
505
                if (itemConfiguration.getExcluded().getValue()) {
505
                if (itemConfiguration == null || 
506
                    itemConfiguration.getExcluded() == null || 
507
                    itemConfiguration.getExcluded().getValue()) {
506
                    continue;
508
                    continue;
507
                }
509
                }
508
                if (itemConfiguration.getTool() == Tool.CCompiler) {
510
                if (itemConfiguration.getTool() == Tool.CCompiler) {
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/api/configurations/MakeConfigurationDescriptor.java (+17 lines)
Lines 53-58 Link Here
53
import java.util.Vector;
53
import java.util.Vector;
54
import javax.swing.Icon;
54
import javax.swing.Icon;
55
import javax.swing.ImageIcon;
55
import javax.swing.ImageIcon;
56
import javax.swing.SwingUtilities;
56
import javax.swing.event.ChangeEvent;
57
import javax.swing.event.ChangeEvent;
57
import javax.swing.event.ChangeListener;
58
import javax.swing.event.ChangeListener;
58
import javax.swing.filechooser.FileFilter;
59
import javax.swing.filechooser.FileFilter;
Lines 85-90 Link Here
85
import org.openide.filesystems.FileUtil;
86
import org.openide.filesystems.FileUtil;
86
import org.openide.util.NbBundle;
87
import org.openide.util.NbBundle;
87
import org.openide.util.RequestProcessor;
88
import org.openide.util.RequestProcessor;
89
import org.openide.util.RequestProcessor.Task;
88
import org.openide.util.Utilities;
90
import org.openide.util.Utilities;
89
import org.w3c.dom.Document;
91
import org.w3c.dom.Document;
90
import org.w3c.dom.Element;
92
import org.w3c.dom.Element;
Lines 111-116 Link Here
111
    private NativeProject nativeProject = null;
113
    private NativeProject nativeProject = null;
112
    public static String DEFAULT_PROJECT_MAKFILE_NAME = "Makefile"; // NOI18N
114
    public static String DEFAULT_PROJECT_MAKFILE_NAME = "Makefile"; // NOI18N
113
    private String projectMakefileName = DEFAULT_PROJECT_MAKFILE_NAME;
115
    private String projectMakefileName = DEFAULT_PROJECT_MAKFILE_NAME;
116
    private Task initTask = null;
114
117
115
    public MakeConfigurationDescriptor(String baseDir) {
118
    public MakeConfigurationDescriptor(String baseDir) {
116
        super();
119
        super();
Lines 178-183 Link Here
178
        setModified(true);
181
        setModified(true);
179
    }
182
    }
180
183
184
    public void setInitTask(Task task){
185
        initTask = task;
186
    }
187
    
188
    public synchronized void waitInitTask(){
189
        new Exception("Avoid waiting reading in EDT").printStackTrace();
190
        if (initTask == null){
191
            return;
192
        }
193
        System.out.println("Waiting for finish loading"+baseDir);
194
        initTask.waitFinished();
195
        initTask = null;
196
    }
197
    
181
    public void initLogicalFolders(Iterator sourceFileFolders, boolean createLogicalFolders, Iterator importantItems) {
198
    public void initLogicalFolders(Iterator sourceFileFolders, boolean createLogicalFolders, Iterator importantItems) {
182
        if (createLogicalFolders) {
199
        if (createLogicalFolders) {
183
            rootFolder.addNewFolder(SOURCE_FILES_FOLDER, getString("SourceFilesTxt"), true);
200
            rootFolder.addNewFolder(SOURCE_FILES_FOLDER, getString("SourceFilesTxt"), true);
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/configurations/ConfigurationXMLReader.java (-11 / +40 lines)
Lines 49-59 Link Here
49
import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfigurationDescriptor;
49
import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfigurationDescriptor;
50
import org.netbeans.modules.cnd.api.xml.XMLDecoder;
50
import org.netbeans.modules.cnd.api.xml.XMLDecoder;
51
import org.netbeans.modules.cnd.api.xml.XMLDocReader;
51
import org.netbeans.modules.cnd.api.xml.XMLDocReader;
52
import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptor.State;
53
import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider;
52
import org.openide.DialogDisplayer;
54
import org.openide.DialogDisplayer;
53
import org.openide.NotifyDescriptor;
55
import org.openide.NotifyDescriptor;
54
import org.openide.filesystems.FileObject;
56
import org.openide.filesystems.FileObject;
55
import org.openide.filesystems.FileUtil;
57
import org.openide.filesystems.FileUtil;
56
import org.openide.util.NbBundle;
58
import org.openide.util.NbBundle;
59
import org.openide.util.RequestProcessor;
60
import org.openide.util.RequestProcessor.Task;
57
import org.xml.sax.Attributes;
61
import org.xml.sax.Attributes;
58
62
59
/**
63
/**
Lines 76-103 Link Here
76
     * was: readFromDisk
80
     * was: readFromDisk
77
     */
81
     */
78
    
82
    
79
    public ConfigurationDescriptor read(String relativeOffset) throws IOException {
83
    public ConfigurationDescriptor read(final String relativeOffset) throws IOException {
80
        
84
        final String tag;
81
        String tag = null;
85
        final FileObject xml;
82
        
83
        // Try first new style file
86
        // Try first new style file
84
        tag = CommonConfigurationXMLCodec.CONFIGURATION_DESCRIPTOR_ELEMENT;
87
        FileObject fo = projectDirectory.getFileObject("nbproject/configurations.xml"); // NOI18N
85
        FileObject xml = projectDirectory.getFileObject("nbproject/configurations.xml"); // NOI18N
88
        if (fo == null){
86
        if (xml == null) {
87
            // then try old style file....
89
            // then try old style file....
88
            tag = CommonConfigurationXMLCodec.PROJECT_DESCRIPTOR_ELEMENT;
90
            tag = CommonConfigurationXMLCodec.PROJECT_DESCRIPTOR_ELEMENT;
89
            xml = projectDirectory.getFileObject("nbproject/projectDescriptor.xml"); // NOI18N
91
            xml = projectDirectory.getFileObject("nbproject/projectDescriptor.xml"); // NOI18N
92
        } else {
93
            tag = CommonConfigurationXMLCodec.CONFIGURATION_DESCRIPTOR_ELEMENT;
94
            xml = fo;
90
        }
95
        }
91
        
96
        
92
        if (xml == null) {
97
        if (xml == null) {
93
            displayErrorDialog();
98
            displayErrorDialog();
94
            return null;
99
            return null;
95
        }
100
        }
101
        String path = FileUtil.toFile(projectDirectory).getPath();
102
        final MakeConfigurationDescriptor configurationDescriptor = new MakeConfigurationDescriptor(path);
103
        Task task = RequestProcessor.getDefault().post(new Runnable() {
104
            public void run() {
105
                try {
106
                    try {
107
                        // To emulate long work
108
                        Thread.sleep(10000);
109
                    } catch (InterruptedException ex) {
110
                    }
111
                    if (_read(relativeOffset, tag, xml, configurationDescriptor) == null){
112
                        // TODO configurationDescriptor is broken
113
                        configurationDescriptor.setState(State.BROKEN);
114
                    }
115
                } catch (IOException ex) {
116
                    configurationDescriptor.setState(State.BROKEN);
117
                }
118
            }
119
        });
120
        configurationDescriptor.setInitTask(task);
121
        return configurationDescriptor;
122
    }
123
    
124
    public ConfigurationDescriptor _read(String relativeOffset,
125
            String tag, FileObject xml, final MakeConfigurationDescriptor configurationDescriptor) throws IOException {
96
        
126
        
97
        boolean success;
127
        boolean success;
98
        
128
        
99
        String path = FileUtil.toFile(projectDirectory).getPath();
100
        final MakeConfigurationDescriptor configurationDescriptor = new MakeConfigurationDescriptor(path);
101
        XMLDecoder decoder =
129
        XMLDecoder decoder =
102
                new ConfigurationXMLCodec(tag,
130
                new ConfigurationXMLCodec(tag,
103
                projectDirectory,
131
                projectDirectory,
Lines 133-139 Link Here
133
                return configurationDescriptor;
161
                return configurationDescriptor;
134
            }
162
            }
135
        }
163
        }
136
        
164
        configurationDescriptor.setState(State.READY);
165
137
        // Some samples are generated without generated makefile. Don't mark these 'not modified'. Then
166
        // Some samples are generated without generated makefile. Don't mark these 'not modified'. Then
138
        // the makefiles will be generated before the project is being built
167
        // the makefiles will be generated before the project is being built
139
        FileObject makeImpl = projectDirectory.getFileObject("nbproject/Makefile-impl.mk"); // NOI18N
168
        FileObject makeImpl = projectDirectory.getFileObject("nbproject/Makefile-impl.mk"); // NOI18N
Lines 162-168 Link Here
162
            // Project is modified and will be saved with current version. This includes samples.
191
            // Project is modified and will be saved with current version. This includes samples.
163
            configurationDescriptor.setVersion(CommonConfigurationXMLCodec.CURRENT_VERSION);
192
            configurationDescriptor.setVersion(CommonConfigurationXMLCodec.CURRENT_VERSION);
164
        }
193
        }
165
        
194
        ConfigurationDescriptorProvider.recordMetrics(ConfigurationDescriptorProvider.USG_PROJECT_OPEN_CND, configurationDescriptor);
166
        return configurationDescriptor;
195
        return configurationDescriptor;
167
    }
196
    }
168
    
197
    
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/MakeLogicalViewProvider.java (-2 / +10 lines)
Lines 748-754 Link Here
748
748
749
        protected Collection getKeys() {
749
        protected Collection getKeys() {
750
            Collection collection = getFolder().getElements();
750
            Collection collection = getFolder().getElements();
751
751
            switch (getFolder().getConfigurationDescriptor().getState()){
752
                case READING:
753
                    if(collection.size() == 0) {
754
                        collection = Collections.singletonList(new LoadingNode());
755
                    }
756
                    break;
757
                case BROKEN:
758
                    // TODO show broken node
759
            }
752
            if ("root".equals(getFolder().getName())) { // NOI18N
760
            if ("root".equals(getFolder().getName())) { // NOI18N
753
                LogicalViewNodeProvider[] providers = LogicalViewNodeProviders.getInstance().getProvidersAsArray();
761
                LogicalViewNodeProvider[] providers = LogicalViewNodeProviders.getInstance().getProvidersAsArray();
754
                if (providers.length > 0) {
762
                if (providers.length > 0) {
Lines 766-772 Link Here
766
774
767
    private MakeConfigurationDescriptor getMakeConfigurationDescriptor() {
775
    private MakeConfigurationDescriptor getMakeConfigurationDescriptor() {
768
        ConfigurationDescriptorProvider pdp = (ConfigurationDescriptorProvider)project.getLookup().lookup(ConfigurationDescriptorProvider.class );
776
        ConfigurationDescriptorProvider pdp = (ConfigurationDescriptorProvider)project.getLookup().lookup(ConfigurationDescriptorProvider.class );
769
        MakeConfigurationDescriptor makeConfigurationDescriptor = (MakeConfigurationDescriptor)pdp.getConfigurationDescriptor();
777
        MakeConfigurationDescriptor makeConfigurationDescriptor = (MakeConfigurationDescriptor)pdp.getConfigurationDescriptor(false);
770
        return makeConfigurationDescriptor;
778
        return makeConfigurationDescriptor;
771
    }
779
    }
772
780
(-)a/cnd.makeproject/src/org/netbeans/modules/cnd/makeproject/ui/SetConfigurationAction.java (-1 / +1 lines)
Lines 105-111 Link Here
105
	if (pdp == null)
105
	if (pdp == null)
106
	    return;
106
	    return;
107
107
108
	ConfigurationDescriptor projectDescriptor = pdp.getConfigurationDescriptor();
108
	ConfigurationDescriptor projectDescriptor = pdp.getConfigurationDescriptor(false);
109
	Configuration[] confs = projectDescriptor.getConfs().getConfs();
109
	Configuration[] confs = projectDescriptor.getConfs().getConfs();
110
        // Fill menu with items
110
        // Fill menu with items
111
        for ( int i = 0; i < confs.length; i++ ) {
111
        for ( int i = 0; i < confs.length; i++ ) {

Return to bug 146696