]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlShowFile.C
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlShowFile.C
index b95351316fec4d95c6312baab1610c5b89e7e1d6..6ffe52a18e805e2fce0a864e756a1829b106601f 100644 (file)
@@ -3,31 +3,41 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Herbert Voss
+ * \author Herbert Voß
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "ControlShowFile.h"
+#include "support/filetools.h"
+
+using std::string;
+
+namespace lyx {
 
-#include "support/filetools.h" // FileSearch
+using support::GetFileContents;
+using support::OnlyFilename;
 
+namespace frontend {
 
-ControlShowFile::ControlShowFile(LyXView & lv, Dialogs & d)
-       : ControlDialogBI(lv, d)
+
+ControlShowFile::ControlShowFile(Dialog & parent)
+       : Dialog::Controller(parent)
 {}
 
 
-void ControlShowFile::showFile(string const & file)
+bool ControlShowFile::initialiseParams(string const & data)
 {
-       filename_ = file;
-       show();
+       filename_ = data;
+       return true;
+}
+
+
+void ControlShowFile::clearParams()
+{
+       filename_.erase();
 }
 
 
@@ -41,3 +51,6 @@ string ControlShowFile::getFileName()
 {
        return OnlyFilename(filename_);
 }
+
+} // namespace frontend
+} // namespace lyx