crashanalysis/crashanalyser/com.nokia.s60tools.crashanalyser/src/com/nokia/s60tools/crashanalyser/model/CrashFileManager.java
equal
deleted
inserted
replaced
25 import org.eclipse.core.runtime.jobs.Job; |
25 import org.eclipse.core.runtime.jobs.Job; |
26 import org.eclipse.core.runtime.jobs.ILock; |
26 import org.eclipse.core.runtime.jobs.ILock; |
27 import org.eclipse.swt.widgets.Display; |
27 import org.eclipse.swt.widgets.Display; |
28 import com.nokia.s60tools.crashanalyser.data.*; |
28 import com.nokia.s60tools.crashanalyser.data.*; |
29 import com.nokia.s60tools.crashanalyser.interfaces.*; |
29 import com.nokia.s60tools.crashanalyser.interfaces.*; |
|
30 import com.nokia.s60tools.crashanalyser.containers.Thread; |
30 |
31 |
31 /** |
32 /** |
32 * This class is responsible for providing crash files to MainView's content provider. |
33 * This class is responsible for providing crash files to MainView's content provider. |
33 * This class read workspace specific crash files from disk and prepares them for main view. |
34 * This class read workspace specific crash files from disk and prepares them for main view. |
34 * |
35 * |
202 return null; |
203 return null; |
203 } |
204 } |
204 } |
205 } |
205 |
206 |
206 /** |
207 /** |
|
208 * Returns threads in one crash file |
|
209 */ |
|
210 public CrashFileBundle[] getThreads(CrashFileBundle crashFile) { |
|
211 |
|
212 List<CrashFileBundle> threadBundles = new ArrayList<CrashFileBundle>(); |
|
213 List<Thread> threads = crashFile.getThreads(); |
|
214 for(Thread thread : threads) { |
|
215 if(crashFile.isFullyDecoded()) |
|
216 threadBundles.add(new CrashFileBundle(crashFile.getCrashFile(), crashFile.getOriginatingDirectory(), thread)); |
|
217 else if(crashFile.isPartiallyDecoded()) |
|
218 threadBundles.add(new CrashFileBundle(crashFile.getSummaryFile(), crashFile.getOriginatingDirectory(), thread)); |
|
219 } |
|
220 return threadBundles.toArray(new CrashFileBundle[threadBundles.size()]); |
|
221 } |
|
222 |
|
223 /** |
|
224 * Returns the number of threads totally in all processes. |
|
225 * @param crashFilebundle Crash file |
|
226 * @return number of threads in the crash file |
|
227 */ |
|
228 public int getTotalThreadCount(CrashFileBundle crashFileBundle) { |
|
229 return crashFileBundle.getTotalThreadCount(); |
|
230 } |
|
231 |
|
232 |
|
233 /** |
207 * Starts reading all files from files system |
234 * Starts reading all files from files system |
208 */ |
235 */ |
209 public void refresh() { |
236 public void refresh() { |
210 accessLock.acquire(); |
237 accessLock.acquire(); |
211 try { |
238 try { |