COMMON: Fixed don't delete sameicon in NewIconDialog 04/16504/1
authorchanghyun1.lee <changhyun1.lee@samsung.com>
Tue, 18 Feb 2014 01:40:37 +0000 (10:40 +0900)
committerchanghyun1.lee <changhyun1.lee@samsung.com>
Tue, 18 Feb 2014 01:40:41 +0000 (10:40 +0900)
Change-Id: I58d112ada0a445f3eca3b315a41167b64904af16
Signed-off-by: changhyun1.lee <changhyun1.lee@samsung.com>
org.tizen.common/src/org/tizen/common/ui/dialog/NewIconDialog.java

index 6a64fc5..77c9a8d 100644 (file)
@@ -268,7 +268,7 @@ public class NewIconDialog extends SelectionStatusDialog {
                 }
             } else {
                 try {
-                    if (! fPath.equals(destFilePath)) {
+                    if (!fPath.equals(destFilePath)) {
                         destFile.delete(true, null);
                     }
                 } catch (CoreException e) {
@@ -285,8 +285,10 @@ public class NewIconDialog extends SelectionStatusDialog {
                 loader.data = new ImageData[] { image.getImageData() };
                 loader.save(destFilePath, SWT.IMAGE_PNG);
             } else {
-                // Copy to raw image
-                FileUtil.copyTo(fPath, destFilePath);
+                if (!fPath.equals(destFilePath)) {
+                    // Copy to raw image
+                    FileUtil.copyTo(fPath, destFilePath);
+                }
             }
             destFile.getParent().refreshLocal(1, null);
         } catch (Exception e) {