]> git.lyx.org Git - features.git/blobdiff - src/frontends/controllers/ControlAboutlyx.C
Replace LString.h with support/std_string.h,
[features.git] / src / frontends / controllers / ControlAboutlyx.C
index 125660ec475e8652551e71de71dd7c240e5945eb..179f12c647657e4e1e0589e3ca03c556cc9738a4 100644 (file)
@@ -1,52 +1,48 @@
 /**
  * \file ControlAboutlyx.C
- * 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
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
-#include <fstream>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "ControlAboutlyx.h"
-#include "Lsstream.h"
 #include "gettext.h"
-#include "support/filetools.h" // FileSearch
 #include "version.h"
+#include "support/std_sstream.h"
 
-// needed for the browser
-extern string system_lyxdir;
-extern string user_lyxdir;
+#include "support/filetools.h" // FileSearch
+#include "support/path_defines.h"
+
+#include <fstream>
 
+using namespace lyx::support;
 
-ControlAboutlyx::ControlAboutlyx(LyXView & lv, Dialogs & d)
-       : ControlDialogBI(lv, d)
+using std::ostream;
+
+
+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");
+       string const name = FileSearch(system_lyxdir(), "CREDITS");
 
        bool found(!name.empty());
 
        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) {
@@ -54,8 +50,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;
 }
 
 
@@ -79,7 +73,7 @@ string const ControlAboutlyx::getDisclaimer() const
 
 string const ControlAboutlyx::getVersion() const
 {
-       stringstream ss;
+       ostringstream ss;
 
        ss << _("LyX Version ")
           << lyx_version
@@ -87,10 +81,10 @@ string const ControlAboutlyx::getVersion() const
           << lyx_release_date
           << "\n"
           << _("Library directory: ")
-          << MakeDisplayPath(system_lyxdir)
+          << MakeDisplayPath(system_lyxdir())
           << "\n"
           << _("User directory: ")
-          << MakeDisplayPath(user_lyxdir);
+          << MakeDisplayPath(user_lyxdir());
 
-       return ss.str().c_str();
+       return STRCONV(ss.str());
 }