remove the syscall constructor, adjust other code

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3555 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2002-02-16 18:34:30 +00:00
parent 7ea7dabed1
commit edf3fcf8f9
7 changed files with 34 additions and 17 deletions

View File

@ -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);
}

View File

@ -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"),

View File

@ -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..."));

View File

@ -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";

View File

@ -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;
}

View File

@ -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

View File

@ -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.
*/