# HG changeset patch # User Ed Swartz # Date 1278948779 18000 # Node ID 231c47d08fe4651e708f8c90e54c9b629508b1ba # Parent 36d484a2e6801ff3b1581f3e6c3c5f934de0f5c1# Parent 40a2929cde0dc41e59e5b7669d51dc7c646d9dd1 Merge commit diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/menu_vew_expressions_01.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/menu_vew_expressions_02.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/menu_view_variables_01.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/menu_view_variables_02.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/view_expressions.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/view_variables.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/wnd_add_watch_expr.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/wnd_add_watchpoint.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/wnd_cast_to_type.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/wnd_display_as_array.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/wnd_find_expressions.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/wnd_find_variables.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/wnd_global_variables.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.carbide.cpp.doc.user/html/debugger/images/wnd_set_value.png diff -r 40a2929cde0d -r 231c47d08fe4 core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/ExternalFileInfoCache.java --- a/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/ExternalFileInfoCache.java Fri Jul 09 16:58:09 2010 -0500 +++ b/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/ExternalFileInfoCache.java Mon Jul 12 10:32:59 2010 -0500 @@ -167,7 +167,7 @@ // update info info.put(file, newInfo); - return finfo.isChangedFrom(newInfo); + return finfo == null || finfo.isChangedFrom(newInfo); } /** diff -r 40a2929cde0d -r 231c47d08fe4 debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/FileTransferTab.java --- a/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/FileTransferTab.java Fri Jul 09 16:58:09 2010 -0500 +++ b/debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/ui/FileTransferTab.java Mon Jul 12 10:32:59 2010 -0500 @@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.ui.PlatformUI; +import java.io.File; import java.util.*; public class FileTransferTab extends CLaunchConfigurationTab { @@ -127,11 +128,11 @@ */ public void performApply(ILaunchConfigurationWorkingCopy configuration) { FileToTransfer[] files = fFilesBlock.getFiles(); - String filesString = ""; //$NON-NLS-1$ + StringBuilder filesString = new StringBuilder(); for (int i=0; i> fFileInfoCache = new LinkedHashMap>(); + private static long fFileInfoCacheFlushTime = 0; + private static final int CACHE_CHECK_QUANTUM = 60 * 1000; + /** * Content provider to show a list of files to be transferred */ @@ -149,7 +158,7 @@ // add warning icon for any host files that don't exist FileToTransfer file = (FileToTransfer)element; File hostFile = new Path(file.getHostPath()).toFile(); - if (!hostFile.exists()) { + if (!fileExists(hostFile)) { return LaunchPlugin.getImageDescriptor("icons/Launch/etool16/warning_obj.gif").createImage(); } } @@ -160,6 +169,7 @@ FilesBlock(FileTransferTab launchTab) { fLaunchTab = launchTab; + fFileInfoCacheFlushTime = System.currentTimeMillis(); } /** @@ -541,7 +551,7 @@ private void removeFiles() { IStructuredSelection selection= (IStructuredSelection)fFileList.getSelection(); FileToTransfer[] files = new FileToTransfer[selection.size()]; - Iterator iter = selection.iterator(); + Iterator iter = selection.iterator(); int i = 0; while (iter.hasNext()) { files[i] = (FileToTransfer)iter.next(); @@ -633,4 +643,32 @@ Viewer getViewer() { return fFileList; } + + boolean fileExists(File file) { + Pair entry = fFileInfoCache.get(file); + + // recheck the status occasionally, either after time passes or + // whenever the UI is recreated (as in constructor) + if (System.currentTimeMillis() >= fFileInfoCacheFlushTime) { + // remove entries not checked at all in a while + long deadLine = System.currentTimeMillis() - CACHE_CHECK_QUANTUM; + Iterator> iter = fFileInfoCache.values().iterator(); + while (iter.hasNext()) { + Pair ientry = iter.next(); + if (ientry.first < deadLine) { + iter.remove(); + } + } + fFileInfoCacheFlushTime = System.currentTimeMillis() + CACHE_CHECK_QUANTUM; + } + + if (entry == null) { + //System.out.println("Checking " + file); + entry = new Pair(System.currentTimeMillis(), file.exists()); + fFileInfoCache.put(file, entry); + } else { + //System.out.println("Not checking " + file); + } + return entry.second; + } }