Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java	(revision 1102)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java	(revision 1103)
@@ -42,6 +42,7 @@
 import org.txm.edition.rcp.editors.SynopticEditionEditor;
 import org.txm.edition.rcp.editors.SynopticEditorInput;
 import org.txm.edition.rcp.messages.EditionUIMessages;
+import org.txm.objects.Project;
 import org.txm.objects.Text;
 import org.txm.rcp.editors.TXMEditor;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -117,8 +118,13 @@
 		}
 		return null;
 	}
+	
+	public static String[] getDefaultEditions(Project p) {
+		return p.getDefaultEdition().split(","); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+	
 	public static String[] getDefaultEditions(CQPCorpus c) {
-		return c.getProject().getDefaultEdition().split(","); //$NON-NLS-1$ //$NON-NLS-2$
+		return getDefaultEditions(c.getProject());
 	}
 
 	/**
Index: tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 1102)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 1103)
@@ -582,6 +582,9 @@
 	 * @throws IllegalArgumentException 
 	 */
 	public final boolean isDirtyFromHistory() throws Exception {
+		
+		if (hasBeenComputedOnce) return false; // can't be dirty from history if the result has never been computed
+		
 		Class clazz = this.getClass();
 
 		Field[] fields = clazz.getDeclaredFields();
@@ -1305,7 +1308,7 @@
 	 */
 	synchronized public TXMResult getFirstParent(Class type) {
 		TXMResult node = null;
-		TXMResult parent = this;
+		TXMResult parent = this.parent;
 		do {
 			if(parent.getClass().equals(type)) {
 				node = parent;	
@@ -1669,7 +1672,7 @@
 			// TODO where do we put this parent compute ? :o
 			//		if (parent != null && !parent.getHasBeenComputedOnce()) { // parent must be computed at least one time
 			// SJ: other way, test the object itself
-			if (parent != null && !parent.hasBeenComputedOnce()) { 
+			if (parent != null) { 
 				if (!this.parent.compute(monitor, false, updateLastParameters)) {
 					Log.severe("TXMResult.compute(): " + this.getClass().getSimpleName() + ": failed to compute parent result.");
 
@@ -1984,9 +1987,14 @@
 	 */
 	public void setUserPersistable(boolean userPersistable) {
 		this.userPersistable = userPersistable;
-		if (this.parent != null && !this.parent.isPersistable()) {
+		if (userPersistable && this.parent != null && !this.parent.isPersistable()) {
 			this.parent.setUserPersistable(true);
 		}
+		if (!userPersistable) {
+			for (TXMResult child : getChildren()) {
+				child.setUserPersistable(userPersistable);
+			}
+		}
 		Log.finest("TXMResult.setUserPersistable(): " + userPersistable);
 	}
 
Index: tmp/org.txm.core/src/java/org/txm/objects/Project.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 1102)
+++ tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 1103)
@@ -666,7 +666,6 @@
 			rcpProject.move(destination, true, null);
 		}
 
-
 		ImportEngines engines = Toolbox.getImportEngines();
 		System.out.println("RUNNING IMPORT MODULE WITH NAME="+getImportModuleName());
 		//File scriptfile = new File(Toolbox.getTxmHomePath(), "scripts/groovy/user/org/txm/scripts/importer/"+importName+"/"+importName+"Loader.groovy"); //$NON-NLS-1$
Index: tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java	(revision 1102)
+++ tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java	(revision 1103)
@@ -168,6 +168,10 @@
 		return (Project) getFirstParent(Project.class);
 	}
 	
+	public String getID() {
+		return pID;
+	}
+	
 	/**
 	 * Gets the base directory.
 	 *
Index: tmp/org.txm.core/src/java/org/txm/objects/Workspace.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Workspace.java	(revision 1102)
+++ tmp/org.txm.core/src/java/org/txm/objects/Workspace.java	(revision 1103)
@@ -299,6 +299,7 @@
 
 	@Override
 	protected boolean _compute() throws Exception {
+		//TODO should ensure its files are up to date
 		return true;
 	}
 
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java	(revision 1102)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java	(revision 1103)
@@ -45,6 +45,7 @@
 import org.txm.core.results.TXMParameters;
 import org.txm.core.results.TXMResult;
 import org.txm.index.core.messages.IndexCoreMessages;
+import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.ICqiClient;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -54,6 +55,7 @@
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.Subcorpus;
 import org.txm.searchengine.cqp.corpus.query.CQLQuery;
+import org.txm.searchengine.cqp.serverException.CqiServerError;
 import org.txm.statsengine.core.StatException;
 import org.txm.statsengine.core.data.Vector;
 import org.txm.statsengine.r.core.data.VectorImpl;
@@ -245,27 +247,25 @@
 		Log.finest(TXMCoreMessages.SUBCORPUS_LEXICON + corpus.getName());
 		//long start = System.currentTimeMillis();
 		int[][] fdist = null;
-		Subcorpus tmp = null;
+		AbstractCqiClient cqi = CorpusManager.getCorpusManager().getCqiClient();
+		String tmp = "S" + corpus.getNextSubcorpusCounter();
+		String qtmp = corpus.getMainCorpus().getQualifiedCqpId()+":"+tmp;
 		try {
 			this.subTask("Computing lexicon frequencies...");
-			tmp = corpus.createSubcorpus(new CQLQuery("[]"), "S" + corpus.getNextSubcorpusCounter(), true); //$NON-NLS-1$
-			if (tmp != null) {
-				fdist = CorpusManager.getCorpusManager().getCqiClient().fdist1(tmp.getQualifiedCqpId(), 0, ICqiClient.CQI_CONST_FIELD_MATCH, property.getName());
-
-				corpus.dropSubcorpus(tmp);
-				tmp.delete();
-			}
+			cqi.cqpQuery(corpus.getQualifiedCqpId(), tmp, "[]");
+			fdist = CorpusManager.getCorpusManager().getCqiClient().fdist1(qtmp, 0, ICqiClient.CQI_CONST_FIELD_MATCH, property.getName());
 			//System.out.println("nb lines: "+fdist.length);
 		} catch (Exception e) {
 			throw new CqiClientException(e);
 		} finally {
-			if (tmp != null) {
-				try {
-					corpus.dropSubcorpus(tmp);
-					tmp.delete();
-				}
-				catch (Exception e2) {
-				}
+			try {
+				cqi.dropSubCorpus(qtmp);
+			} catch (IOException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			} catch (CqiServerError e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
 			}
 		}
 		int lexiconSize = fdist.length;
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 1102)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 1103)
@@ -546,7 +546,10 @@
 	 * @see org.txm.searchengine.cqp.corpus.CqpObject#getMotherMainCorpus()
 	 */
 	public CQPCorpus getCorpusParent() {
-		return (CQPCorpus) getFirstParent(CQPCorpus.class);
+		//return (CQPCorpus) getFirstParent(CQPCorpus.class);
+		TXMResult p = getFirstParent(Subcorpus.class);
+		if (p != null) return (Subcorpus)p;
+		return (MainCorpus) getFirstParent(MainCorpus.class);
 	}
 
 	abstract public List<Match> getMatches();
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 1102)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 1103)
@@ -110,7 +110,12 @@
 	protected boolean _compute() throws Exception {
 		if (pQuery != null) {
 			this.qresult = null; // reset
-			this.qresult = new QueryResult(this.pID, this.pName, this, pQuery);
+			
+			CorpusManager.getCorpusManager().getCqiClient().cqpQuery(
+					this.getCorpusParent().getQualifiedCqpId(), pID,
+					pQuery.getQueryString());
+			
+			this.qresult = new QueryResult(pID, pName, this.getCorpusParent(), pQuery); // getCorpusParent().query(pQuery, this.pID, true);
 		}
 		return qresult != null;
 	}
@@ -137,7 +142,8 @@
 
 			try {
 				AbstractCqiClient cqiClient = CorpusManager.getCorpusManager().getCqiClient();
-				int nMatch = cqiClient.subCorpusSize(this.getQualifiedCqpId());
+				String qid= this.getQualifiedCqpId();
+				int nMatch = cqiClient.subCorpusSize(qid);
 				//System.out.println("n matchs: "+nMatch);
 				if (nMatch == 0) {
 					this.size = 0;
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 1102)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 1103)
@@ -437,9 +437,12 @@
 
 	@Override
 	public boolean hasIndexes(CorpusBuild corpus) {
+		if (corpus instanceof CQPCorpus) return true;
+		
 		try {
-			CQPCorpus cqpcorpus = (CQPCorpus) corpus;
-			return CorpusManager.getCorpusManager().getCorpus(cqpcorpus.getMainCorpus().getName()) != null;
+			String id = corpus.getID();
+			
+			return CorpusManager.getCorpusManager().getCorpus(id) != null;
 		} catch (Exception e) {
 			e.printStackTrace();
 			return false;
