Index: trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc
===================================================================
--- trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc	(revision 733)
+++ trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc	(revision 735)
@@ -301,8 +301,7 @@
   ,fHoldRotateEvent(false)
   ,fAutoMove(false)
-  ,fEncoderPath("")
-  ,fTempFolderPath("/temp")
   ,fMovieParametersDialog(NULL)
 {
+  initMovieParameters();
 #ifdef GEANT4_QT_DEBUG
   printf("G4OpenGLQtViewer::G4OpenGLQtViewer \n");
@@ -2145,14 +2144,122 @@
   
 
-/** @return if encoder path was not specified, try to guess it.
- * if path was already specified, return it.Else return ""
+/** @return encoder path or "" if it does not exist
  */
 QString G4OpenGLQtViewer::getEncoderPath() {
 
-   if (fEncoderPath.isNull())
-     fEncoderPath ="";
-   if (fEncoderPath.isEmpty()) {
-  
-     //look for encoderPath
+   if (!fEncoderPath.isNull())
+    return fEncoderPath ;
+   return "";
+}
+ 
+
+/**
+ * set the new encoder path
+ * @return "" if correct. The error otherwise
+*/
+QString G4OpenGLQtViewer::setEncoderPath(QString path) {
+  if (path == "") {
+    return "Path does not exist";
+  }
+  QFile *f = new QFile(path);
+  if (!f->exists()) {
+    return "Path does not exist";
+  }
+  if (!(f->permissions() & QFile::ExeUser)) {
+    return "File exist but is not executable";
+  }
+  fEncoderPath = path;
+  return "";
+}
+
+/**
+ * set the temp folder path
+ * @return "" if correct. The error otherwise
+*/
+QString G4OpenGLQtViewer::setTempFolderPath(QString path) {
+
+  if (path == "") {
+    return "Path does not exist";
+  }
+  QDir *d = new QDir(path);
+  if (!d->exists(path)) {
+    return "Path does not exist";
+  }
+
+  d->setFilter( QDir::Dirs | QDir::Readable | QDir::Writable );
+  QStringList subDirList = d->entryList();
+  bool found = false;
+
+  for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) {
+    const QString currentDir = *it;
+    
+    if (currentDir == ".") { // we found it
+      found = true;
+    }
+  }
+
+  if (!found)
+    return "Path exist, but is not write accessible";
+  
+  fTempFolderPath = path;
+  return "";
+}
+
+/** @return the temp folder path or "" if it does not exist
+ */
+QString G4OpenGLQtViewer::getTempFolderPath() {
+  if (!fTempFolderPath.isNull())
+    return fTempFolderPath ;
+return "";
+}
+ 
+/**
+ * set the save file name path
+ * @return "" if correct. The error otherwise
+*/
+QString G4OpenGLQtViewer::setSaveFileName(QString path) {
+
+  if (path == "") {
+    return "Path does not exist";
+  }
+  QDir *d = new QDir(path);
+  if (!d->exists(path)) {
+    return "Path does not exist";
+  }
+
+  d->setFilter( QDir::Dirs | QDir::Readable | QDir::Writable );
+  QStringList subDirList = d->entryList();
+  bool found = false;
+
+  for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) {
+    const QString currentDir = *it;
+    
+    if (currentDir == ".") { // we found it
+      found = true;
+    }
+  }
+
+  if (!found)
+    return "Path exist, but is not write accessible";
+  
+  fSaveFileName = path;
+  return "";
+}
+
+/** @return the save file path
+ */
+QString G4OpenGLQtViewer::getSaveFileName() {
+  return fSaveFileName ;
+}
+
+/** Init the movie parameters. Temp dir and encoder path
+*/
+void G4OpenGLQtViewer::initMovieParameters() {
+#ifdef GEANT4_QT_DEBUG
+  printf("G4OpenGLQtViewer::--------\n");
+#endif
+  //init encoder
+  
+   //look for encoderPath
      QProcess search;
      search.setReadChannelMode(QProcess::MergedChannels);
@@ -2168,104 +2275,11 @@
        }
      }
-   }
-  return fEncoderPath ;
-}
- 
-
-/**
- * set the new encoder path
- * @return "" if correct. The error otherwise
-*/
-QString G4OpenGLQtViewer::setEncoderPath(QString path) {
-  QFile *f = new QFile(path);
-  if (!f->exists()) {
-#ifdef GEANT4_QT_DEBUG
-  printf("G4OpenGLQtViewer::setEncoderPath NOT EXIST\n");
-#endif
-    return "Path does not exist";
-  }
-  if (!(f->permissions() & QFile::ExeUser)) {
-#ifdef GEANT4_QT_DEBUG
-  printf("G4OpenGLQtViewer::setEncoderPath No WRITE ACCES\n");
-#endif
-    return "File exist but is not executable";
-  }
-  fEncoderPath = path;
-  return "";
-}
-
-/**
- * set the temp folder path
- * @return "" if correct. The error otherwise
-*/
-QString G4OpenGLQtViewer::setTempFolderPath(QString path) {
-
-  QDir *d = new QDir(path);
-  if (!d->exists(path)) {
-    return "Path does not exist";
-  }
-
-  d->setFilter( QDir::Dirs | QDir::Readable | QDir::Writable );
-  QStringList subDirList = d->entryList();
-  bool found = false;
-
-  for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) {
-    const QString currentDir = *it;
-    
-    if (currentDir == ".") { // we found it
-      found = true;
-    }
-  }
-
-  if (!found)
-    return "Path exist, but is not write accessible";
-  
-  fTempFolderPath = path;
-  return "";
-}
-
-/** @return the temp folder path
- */
-QString G4OpenGLQtViewer::getTempFolderPath() {
-  return fTempFolderPath ;
-}
- 
-/**
- * set the save file name path
- * @return "" if correct. The error otherwise
-*/
-QString G4OpenGLQtViewer::setSaveFileName(QString path) {
-
-  QDir *d = new QDir(path);
-  if (!d->exists(path)) {
-    return "Path does not exist";
-  }
-
-  d->setFilter( QDir::Dirs | QDir::Readable | QDir::Writable );
-  QStringList subDirList = d->entryList();
-  bool found = false;
-
-  for (QStringList::ConstIterator it = subDirList.begin() ;(it != subDirList.end()) ; it++) {
-    const QString currentDir = *it;
-    
-    if (currentDir == ".") { // we found it
-      found = true;
-    }
-  }
-
-  if (!found)
-    return "Path exist, but is not write accessible";
-  
-  fSaveFileName = path;
-  return "";
-}
-
-/** @return the save file path
- */
-QString G4OpenGLQtViewer::getSaveFileName() {
-  return fSaveFileName ;
-}
-
- 
+     setEncoderPath(fEncoderPath);
+// init temp folder
+  setTempFolderPath(QDir::temp ().absolutePath ());
+#ifdef GEANT4_QT_DEBUG
+  printf("G4OpenGLQtViewer::--------\n");
+#endif
+}
 
 
