mail[Wesnoth-commits] r44240 - in /trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin: Activator.java Logger.java


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by timotei_cluj on July 17, 2010 - 13:08:
Author: timotei
Date: Sat Jul 17 13:08:19 2010
New Revision: 44240

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44240&view=rev
Log:
eclipse plugin: fix a stackoverflow, and remove checkConditions until a 
better idea comes

Modified:
    trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Activator.java
    trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Activator.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Activator.java?rev=44240&r1=44239&r2=44240&view=diff
==============================================================================
--- trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Activator.java 
(original)
+++ trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Activator.java 
Sat Jul 17 13:08:19 2010
@@ -8,23 +8,16 @@
  
*******************************************************************************/
 package wesnoth_eclipse_plugin;
 
-import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
-
-import wesnoth_eclipse_plugin.handlers.SetupWorkspaceHandler;
-import wesnoth_eclipse_plugin.preferences.Preferences;
-import wesnoth_eclipse_plugin.preferences.WesnothEditorPreferences;
-import wesnoth_eclipse_plugin.utils.WorkspaceUtils;
 
 /**
  * The activator class controls the plug-in life cycle
  */
 public class Activator extends AbstractUIPlugin
 {
-
        // The plug-in ID
        public static final String      PLUGIN_ID       = 
"Wesnoth_Eclipse_Plugin";
 
@@ -60,9 +53,6 @@
         */
        public static Activator getDefault()
        {
-               if (!SetupWorkspaceHandler.WorkspaceSetupStarted &&
-                       !WesnothEditorPreferences.EditorPreferencesStarted)
-                       checkConditions();
                return plugin;
        }
 
@@ -88,25 +78,25 @@
                return plugin.getWorkbench().getDisplay().getActiveShell();
        }
 
-       /**
-        * Checks if the user has set some needed preferences and if the 
workspace
-        * is setup (there exists the "User Addons" project)
-        */
-       private static void checkConditions()
-       {
-               String execDir = 
Preferences.getString(Constants.P_WESNOTH_EXEC_PATH);
-               String userDir = 
Preferences.getString(Constants.P_WESNOTH_USER_DIR);
-               String wmltoolsDir = 
Preferences.getString(Constants.P_WESNOTH_WMLTOOLS_DIR);
-               String workingDir = 
Preferences.getString(Constants.P_WESNOTH_WORKING_DIR);
-
-               if (!WorkspaceUtils.validPath(execDir) || 
!WorkspaceUtils.validPath(userDir) ||
-                       !WorkspaceUtils.validPath(wmltoolsDir) || 
!WorkspaceUtils.validPath(workingDir) ||
-                       
!ResourcesPlugin.getWorkspace().getRoot().getProject("User Addons").exists())
-               {
-                       Logger.getInstance().log("checkConditions: workspace 
not setup",
-                               "Please setup the workspace before using the 
plugin. Go to \"Wesnoth\" menu," +
-                               " and then click on the \"Setup Workspace\" 
entry following the instructions on the screen.");
-                       return;
-               }
-       }
+//     /**
+//      * Checks if the user has set some needed preferences and if the 
workspace
+//      * is setup (there exists the "User Addons" project)
+//      */
+//     private static void checkConditions()
+//     {
+//             String execDir = 
Preferences.getString(Constants.P_WESNOTH_EXEC_PATH);
+//             String userDir = 
Preferences.getString(Constants.P_WESNOTH_USER_DIR);
+//             String wmltoolsDir = 
Preferences.getString(Constants.P_WESNOTH_WMLTOOLS_DIR);
+//             String workingDir = 
Preferences.getString(Constants.P_WESNOTH_WORKING_DIR);
+//
+//             if (!WorkspaceUtils.validPath(execDir) || 
!WorkspaceUtils.validPath(userDir) ||
+//                     !WorkspaceUtils.validPath(wmltoolsDir) || 
!WorkspaceUtils.validPath(workingDir) ||
+//                     
!ResourcesPlugin.getWorkspace().getRoot().getProject("User Addons").exists())
+//             {
+//                     Logger.getInstance().log("checkConditions: workspace 
not setup",
+//                             "Please setup the workspace before using the 
plugin. Go to \"Wesnoth\" menu," +
+//                             " and then click on the \"Setup Workspace\" 
entry following the instructions on the screen.");
+//                     return;
+//             }
+//     }
 }

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java?rev=44240&r1=44239&r2=44240&view=diff
==============================================================================
--- trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java 
(original)
+++ trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/Logger.java 
Sat Jul 17 13:08:19 2010
@@ -44,6 +44,8 @@
         */
        public void startLogger()
        {
+               if (logWriter_ != null)
+                       return;
                try
                {
                        String logFilePath = String.format("%s/log%s.txt",




Related Messages


Powered by MHonArc, Updated Sat Jul 17 13:20:18 2010