mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-13 03:12:22 +00:00
s/KShellProcess/KProcess/
svn path=/trunk/KDE/kdegraphics/kviewshell/plugins/dvi/; revision=488799
This commit is contained in:
parent
ef88281c04
commit
24fbb04410
|
@ -706,7 +706,7 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen
|
||||||
{
|
{
|
||||||
KMessageBox::sorry(parentWidget, QString("<qt>") +
|
KMessageBox::sorry(parentWidget, QString("<qt>") +
|
||||||
i18n("The DVI-file refers to the TeX-file "
|
i18n("The DVI-file refers to the TeX-file "
|
||||||
"<strong>%1</strong> which could not be found.").arg(KShellProcess::quote(TeXfile)) +
|
"<strong>%1</strong> which could not be found.").arg(KProcess::quote(TeXfile)) +
|
||||||
QString("</qt>"),
|
QString("</qt>"),
|
||||||
i18n( "Could Not Find File" ));
|
i18n( "Could Not Find File" ));
|
||||||
return;
|
return;
|
||||||
|
@ -727,7 +727,7 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
command = command.replace( "%l", QString::number(splitter.line()) ).replace( "%f", KShellProcess::quote(TeXfile) );
|
command = command.replace( "%l", QString::number(splitter.line()) ).replace( "%f", KProcess::quote(TeXfile) );
|
||||||
|
|
||||||
#ifdef DEBUG_SPECIAL
|
#ifdef DEBUG_SPECIAL
|
||||||
kdDebug(kvs::dvi) << "Calling program: " << command << endl;
|
kdDebug(kvs::dvi) << "Calling program: " << command << endl;
|
||||||
|
@ -744,7 +744,7 @@ void dviRenderer::handleSRCLink(const QString &linkText, QMouseEvent *e, Documen
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up a shell process with the editor command.
|
// Set up a shell process with the editor command.
|
||||||
proc = new KShellProcess();
|
proc = new KProcess();
|
||||||
if (proc == 0) {
|
if (proc == 0) {
|
||||||
kdError(kvs::dvi) << "Could not allocate ShellProcess for the editor command." << endl;
|
kdError(kvs::dvi) << "Could not allocate ShellProcess for the editor command." << endl;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -33,7 +33,6 @@ class KDVIMultiPage;
|
||||||
class KPrinter;
|
class KPrinter;
|
||||||
class KProcess;
|
class KProcess;
|
||||||
class KProgressDialog;
|
class KProgressDialog;
|
||||||
class KShellProcess;
|
|
||||||
class PreBookmark;
|
class PreBookmark;
|
||||||
class TeXFontDefinition;
|
class TeXFontDefinition;
|
||||||
|
|
||||||
|
@ -281,7 +280,7 @@ private:
|
||||||
|
|
||||||
/** Used to run and to show the progress of dvips and friends. */
|
/** Used to run and to show the progress of dvips and friends. */
|
||||||
fontProgressDialog *progress;
|
fontProgressDialog *progress;
|
||||||
KShellProcess *proc;
|
KProcess *proc;
|
||||||
KPrinter *export_printer;
|
KPrinter *export_printer;
|
||||||
QString export_fileName;
|
QString export_fileName;
|
||||||
QString export_tmpFileName;
|
QString export_tmpFileName;
|
||||||
|
|
|
@ -120,7 +120,7 @@ void dviRenderer::exportPDF()
|
||||||
qApp->connect(progress, SIGNAL(finished()), this, SLOT(abortExternalProgramm()));
|
qApp->connect(progress, SIGNAL(finished()), this, SLOT(abortExternalProgramm()));
|
||||||
}
|
}
|
||||||
|
|
||||||
proc = new KShellProcess();
|
proc = new KProcess();
|
||||||
if (proc == 0) {
|
if (proc == 0) {
|
||||||
kdError(kvs::dvi) << "Could not allocate ShellProcess for the dvipdfm command." << endl;
|
kdError(kvs::dvi) << "Could not allocate ShellProcess for the dvipdfm command." << endl;
|
||||||
return;
|
return;
|
||||||
|
@ -134,13 +134,13 @@ void dviRenderer::exportPDF()
|
||||||
export_errorString = i18n("<qt>The external program 'dvipdf', which was used to export the file, reported an error. "
|
export_errorString = i18n("<qt>The external program 'dvipdf', which was used to export the file, reported an error. "
|
||||||
"You might wish to look at the <strong>document info dialog</strong> which you will "
|
"You might wish to look at the <strong>document info dialog</strong> which you will "
|
||||||
"find in the File-Menu for a precise error report.</qt>") ;
|
"find in the File-Menu for a precise error report.</qt>") ;
|
||||||
info->clear(i18n("Export: %1 to PDF").arg(KShellProcess::quote(dviFile->filename)));
|
info->clear(i18n("Export: %1 to PDF").arg(KProcess::quote(dviFile->filename)));
|
||||||
|
|
||||||
proc->clearArguments();
|
proc->clearArguments();
|
||||||
finfo.setFile(dviFile->filename);
|
finfo.setFile(dviFile->filename);
|
||||||
*proc << QString("cd %1; dvipdfm").arg(KShellProcess::quote(finfo.dirPath(true)));
|
*proc << QString("cd %1; dvipdfm").arg(KProcess::quote(finfo.dirPath(true)));
|
||||||
*proc << QString("-o %1").arg(KShellProcess::quote(fileName));
|
*proc << QString("-o %1").arg(KProcess::quote(fileName));
|
||||||
*proc << KShellProcess::quote(dviFile->filename);
|
*proc << KProcess::quote(dviFile->filename);
|
||||||
proc->closeStdin();
|
proc->closeStdin();
|
||||||
if (proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) {
|
if (proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) == false) {
|
||||||
kdError(kvs::dvi) << "dvipdfm failed to start" << endl;
|
kdError(kvs::dvi) << "dvipdfm failed to start" << endl;
|
||||||
|
@ -286,7 +286,7 @@ void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinte
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate and initialize the shell process.
|
// Allocate and initialize the shell process.
|
||||||
proc = new KShellProcess();
|
proc = new KProcess();
|
||||||
if (proc == 0) {
|
if (proc == 0) {
|
||||||
kdError(kvs::dvi) << "Could not allocate ShellProcess for the dvips command." << endl;
|
kdError(kvs::dvi) << "Could not allocate ShellProcess for the dvips command." << endl;
|
||||||
return;
|
return;
|
||||||
|
@ -298,17 +298,17 @@ void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinte
|
||||||
export_errorString = i18n("<qt>The external program 'dvips', which was used to export the file, reported an error. "
|
export_errorString = i18n("<qt>The external program 'dvips', which was used to export the file, reported an error. "
|
||||||
"You might wish to look at the <strong>document info dialog</strong> which you will "
|
"You might wish to look at the <strong>document info dialog</strong> which you will "
|
||||||
"find in the File-Menu for a precise error report.</qt>") ;
|
"find in the File-Menu for a precise error report.</qt>") ;
|
||||||
info->clear(i18n("Export: %1 to PostScript").arg(KShellProcess::quote(dviFile->filename)));
|
info->clear(i18n("Export: %1 to PostScript").arg(KProcess::quote(dviFile->filename)));
|
||||||
|
|
||||||
proc->clearArguments();
|
proc->clearArguments();
|
||||||
QFileInfo finfo(dviFile->filename);
|
QFileInfo finfo(dviFile->filename);
|
||||||
*proc << QString("cd %1; dvips").arg(KShellProcess::quote(finfo.dirPath(true)));
|
*proc << QString("cd %1; dvips").arg(KProcess::quote(finfo.dirPath(true)));
|
||||||
if (printer == 0)
|
if (printer == 0)
|
||||||
*proc << "-z"; // export Hyperlinks
|
*proc << "-z"; // export Hyperlinks
|
||||||
if (options.isEmpty() == false)
|
if (options.isEmpty() == false)
|
||||||
*proc << options;
|
*proc << options;
|
||||||
*proc << QString("%1").arg(KShellProcess::quote(sourceFileName));
|
*proc << QString("%1").arg(KProcess::quote(sourceFileName));
|
||||||
*proc << QString("-o %1").arg(KShellProcess::quote(fileName));
|
*proc << QString("-o %1").arg(KProcess::quote(fileName));
|
||||||
proc->closeStdin();
|
proc->closeStdin();
|
||||||
if (proc->start(KProcess::NotifyOnExit, KProcess::Stderr) == false) {
|
if (proc->start(KProcess::NotifyOnExit, KProcess::Stderr) == false) {
|
||||||
kdError(kvs::dvi) << "dvips failed to start" << endl;
|
kdError(kvs::dvi) << "dvips failed to start" << endl;
|
||||||
|
@ -360,7 +360,7 @@ void dviRenderer::editorCommand_terminated(KProcess *sproc)
|
||||||
KMessageBox::error( parentWidget, export_errorString );
|
KMessageBox::error( parentWidget, export_errorString );
|
||||||
|
|
||||||
// Let's hope that this is not all too nasty... killing a
|
// Let's hope that this is not all too nasty... killing a
|
||||||
// KShellProcess from a slot that was called from the KShellProcess
|
// KProcess from a slot that was called from the KShellProcess
|
||||||
// itself. Until now, there weren't any problems.
|
// itself. Until now, there weren't any problems.
|
||||||
|
|
||||||
// Perhaps it was a bad idea, after all.
|
// Perhaps it was a bad idea, after all.
|
||||||
|
|
Loading…
Reference in a new issue