mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-11 15:16:07 +01:00
2018-10-19 Fred Gleason <fredg@paravelsystems.com>
* Removed 'build_win32.bat'. * Removed all conditional compilation based on 'WIN32'.
This commit is contained in:
@@ -18,9 +18,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -40,32 +38,11 @@ bool RDTextFile(const QString &data)
|
||||
QString editor;
|
||||
|
||||
if(getenv("VISUAL")==NULL) {
|
||||
#ifdef WIN32
|
||||
editor=RD_WIN32_EDITOR;
|
||||
#else
|
||||
editor=RD_LINUX_EDITOR;
|
||||
#endif // WIN32
|
||||
}
|
||||
else {
|
||||
editor=getenv("VISUAL");
|
||||
}
|
||||
#ifdef WIN32
|
||||
QString tempfile=RDTempDirectory::basePath()+"\\rd-"+
|
||||
QTime::currentTime().toString("hhmmsszzz");
|
||||
FILE *f=fopen(tempfile,"w");
|
||||
if(f==NULL) {
|
||||
QMessageBox::warning(NULL,"File Error","Unable to create temporary file");
|
||||
return false;
|
||||
}
|
||||
fprintf(f,"%s",(const char *)data.utf8());
|
||||
fclose(f);
|
||||
QStringList args;
|
||||
args+=editor;
|
||||
args+=tempfile;
|
||||
Q3Process *proc=new Q3Process(args);
|
||||
proc->launch("");
|
||||
delete proc;
|
||||
#else
|
||||
strcpy(tmpfile,RDTempDirectory::basePath()+"/rdreportXXXXXX");
|
||||
int fd=mkstemp(tmpfile);
|
||||
if(fd<0) {
|
||||
@@ -79,6 +56,5 @@ bool RDTextFile(const QString &data)
|
||||
unlink(tmpfile);
|
||||
exit(0);
|
||||
}
|
||||
#endif // WIN32
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user