diff --git a/src/LyXSendto.C b/src/LyXSendto.C index fba1db3682..e7fcebc4b5 100644 --- a/src/LyXSendto.C +++ b/src/LyXSendto.C @@ -95,7 +95,8 @@ void SendtoApplyCB(FL_OBJECT *, long) // create the .txt file in tmp_dir if this filetype is requested if (fl_get_button(fd_form_sendto->radio_ftype_ascii)) buffer->writeFileAscii(fname, lyxrc.ascii_linelen); - Systemcalls one(Systemcalls::Wait, command); + Systemcalls one; + one.startscript(Systemcalls::Wait, command); } diff --git a/src/frontends/controllers/ControlTexinfo.C b/src/frontends/controllers/ControlTexinfo.C index 9a266a985f..0166eee2a2 100644 --- a/src/frontends/controllers/ControlTexinfo.C +++ b/src/frontends/controllers/ControlTexinfo.C @@ -32,19 +32,22 @@ extern string user_lyxdir; // home of *Files.lst + ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d) : ControlDialogBI(lv, d) { d_.showTexinfo.connect(SigC::slot(this, &ControlTexinfo::show)); } + // build filelists of all availabe bst/cls/sty-files. done through // kpsewhich and an external script, saved in *Files.lst void ControlTexinfo::rescanStyles() const { // Run rescan in user lyx directory Path p(user_lyxdir); - Systemcalls one(Systemcalls::Wait, + Systemcalls one; + one.startscript(Systemcalls::Wait, LibFileSearch("scripts", "TeXFiles.sh")); p.pop(); } @@ -56,7 +59,9 @@ void ControlTexinfo::runTexhash() const Path p(user_lyxdir); //path to texhash through system - Systemcalls one(Systemcalls::Wait, "texhash"); + Systemcalls one; + one.startscript(Systemcalls::Wait, "texhash"); + p.pop(); // Alert::alert(_("texhash run!"), // _("rebuilding of the TeX-tree could only be successfull"), diff --git a/src/lyx_cb.C b/src/lyx_cb.C index da4a2717d2..f32d2cb03a 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -537,7 +537,8 @@ void Reconfigure(BufferView * bv) // Run configure in user lyx directory Path p(user_lyxdir); - Systemcalls one(Systemcalls::Wait, + Systemcalls one; + one.startscript(Systemcalls::Wait, AddName(system_lyxdir, "configure")); p.pop(); bv->owner()->message(_("Reloading configuration...")); diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 121bef4c55..e2b609de65 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -60,7 +60,8 @@ namespace { string outfile = lyx::tempName(string(), "mathextern"); string full = "echo '" + data + "' | (" + cmd + ") > " + outfile; lyxerr << "calling: " << full << "\n"; - Systemcalls dummy(Systemcalls::Wait, full); + Systemcalls dummy; + dummy.startscript(Systemcalls::Wait, full); string out = GetFileContents(outfile); lyx::unlink(outfile); lyxerr << "result: '" << out << "'\n"; diff --git a/src/support/filetools.C b/src/support/filetools.C index c8b405d6bb..cc78a772bf 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -1043,22 +1043,26 @@ string const getExtFromContents(string const & filename) { /// check for zipped file -bool zippedFile(string const & name) { +bool zippedFile(string const & name) +{ string const type = getExtFromContents(name); - if (contains("gzip zip compress",type) && !type.empty()) - return true; + if (contains("gzip zip compress", type) && !type.empty()) + return true; return false; } + string const unzipFile(string const & zipped_file) { - string const file = ChangeExtension(zipped_file, string()); - string const tempfile = lyx::tempName(string(), file); - // Run gunzip - string const command = "gunzip -c "+zipped_file+" > "+tempfile; - Systemcalls one(Systemcalls::Wait, command); - // test that command was executed successfully - return tempfile; + string const file = ChangeExtension(zipped_file, string()); + string const tempfile = lyx::tempName(string(), file); + // Run gunzip + string const command = "gunzip -c " + zipped_file + " > " + tempfile; + Systemcalls one; + one.startscript(Systemcalls::Wait, command); + // test that command was executed successfully (anon) + // yes, please do. (Lgb) + return tempfile; } diff --git a/src/support/syscall.C b/src/support/syscall.C index 9a9e1ecc54..35b09df93f 100644 --- a/src/support/syscall.C +++ b/src/support/syscall.C @@ -25,10 +25,13 @@ #include "syscall.h" #include "os.h" + +#if 0 Systemcalls::Systemcalls(Starttype how, string const & what) { startscript(how, what); } +#endif // Reuse of instance diff --git a/src/support/syscall.h b/src/support/syscall.h index 598fbc13dc..64bcab242c 100644 --- a/src/support/syscall.h +++ b/src/support/syscall.h @@ -38,13 +38,15 @@ public: /// Systemcalls() {} - + +#if 0 /** Generate instance and start child process. * The string "what" contains a commandline with arguments separated * by spaces. */ Systemcalls(Starttype how, string const & what); - +#endif + /** Start child process. * This is for reuse of the Systemcalls instance. */