]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlAboutlyx.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ControlAboutlyx.C
index f7815b97cc0fcfcbc6f23c15350a837f9d79a9fe..4b456e47ab92d64409bfd7cb37a120ad10a6154e 100644 (file)
@@ -1,38 +1,42 @@
 /**
  * \file ControlAboutlyx.C
- * Copyright 2001 The LyX Team.
- * See the file COPYING.
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Edwin Leuven, leuven@fee.uva.nl
- * \author Angus Leeming, a.leeming@.ac.uk
+ * \author Edwin Leuven
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
-#include <fstream>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "ControlAboutlyx.h"
-#include "frontends/LyXView.h"
-#include "Lsstream.h"
-#include "BufferView.h"
 #include "gettext.h"
-#include "support/filetools.h" // FileSearch
 #include "version.h"
+#include "Lsstream.h"
+
+#include "support/LOstream.h"
+#include "support/filetools.h" // FileSearch
+
+#include <fstream>
+
+using namespace lyx::support;
+
+using std::ostream;
 
 // needed for the browser
 extern string system_lyxdir;
 extern string user_lyxdir;
 
 
-ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d)
-       : ControlDialogBI(lv, d)
+ControlAboutlyx::ControlAboutlyx(Dialog & parent)
+       : Dialog::Controller(parent)
 {}
 
 
-stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
+void ControlAboutlyx::getCredits(ostream & ss) const
 {
        string const name = FileSearch(system_lyxdir, "CREDITS");
 
@@ -40,14 +44,9 @@ stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
 
        if (found) {
                std::ifstream in(name.c_str());
-               found = (in.get());
-
-               if (found) {
-                       in.seekg(0, std::ios::beg); // rewind to the beginning
 
-                       ss << in.rdbuf();
-                       found = (ss.good());
-               }
+               ss << in.rdbuf();
+               found = ss.good();
        }
 
        if (!found) {
@@ -55,8 +54,6 @@ stringstream & ControlAboutlyx::getCredits(stringstream & ss) const
                   << _("Please install correctly to estimate the great\n")
                   << _("amount of work other people have done for the LyX project.");
        }
-
-       return ss;
 }
 
 
@@ -80,7 +77,7 @@ string const ControlAboutlyx::getDisclaimer() const
 
 string const ControlAboutlyx::getVersion() const
 {
-       stringstream ss;
+       ostringstream ss;
 
        ss << _("LyX Version ")
           << lyx_version
@@ -93,5 +90,5 @@ string const ControlAboutlyx::getVersion() const
           << _("User directory: ")
           << MakeDisplayPath(user_lyxdir);
 
-       return ss.str().c_str();
+       return STRCONV(ss.str());
 }