[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kviewshell-0.7/kviewshell/plugins/dvi
From:       Angus Leeming <leeming () lyx ! org>
Date:       2005-12-30 20:29:50
Message-ID: 1135974590.368858.17624.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 492700 by leeming:

Sync with trunk.


 M  +1 -1      dviRenderer.cpp  
 M  +1 -1      dviRenderer.h  
 M  +7 -7      dviexport.cpp  
 M  +1 -1      dviexport.h  
 M  +42 -41    kdvi_multipage.cpp  


--- branches/work/kviewshell-0.7/kviewshell/plugins/dvi/dviRenderer.cpp \
#492699:492700 @@ -723,7 +723,7 @@
 }
 
 
-void dviRenderer::exportPS(const QString& fname, const QString& options, KPrinter* \
printer) +void dviRenderer::exportPS(const QString& fname, const QStringList& \
options, KPrinter* printer)  {
   KSharedPtr<DVIExport> exporter(new DVIExportToPS(*this, parentWidget, fname, \
options, printer));  if (exporter->started())
--- branches/work/kviewshell-0.7/kviewshell/plugins/dvi/dviRenderer.h #492699:492700
@@ -136,7 +136,7 @@
   void          editor_finished(const DVISourceEditor*);
 
 public slots:
-  void          exportPS(const QString& fname = QString::null, const QString& \
options = QString::null, KPrinter* printer = 0); +  void          exportPS(const \
QString& fname = QString::null, const QStringList& options = QStringList(), KPrinter* \
printer = 0);  void          exportPDF();
 
   void          showInfo();
--- branches/work/kviewshell-0.7/kviewshell/plugins/dvi/dviexport.cpp #492699:492700
@@ -86,7 +86,7 @@
 {
   assert(!process_);
 
-  process_ = new KShellProcess;
+  process_ = new KProcess;
   connect(process_, SIGNAL(receivedStderr(KProcess* , char* , int)), this, \
SLOT(output_receiver(KProcess* , char* , int)));  connect(process_, \
SIGNAL(receivedStdout(KProcess* , char* , int)), this, SLOT(output_receiver(KProcess* \
, char* , int)));  connect(process_, SIGNAL(processExited(KProcess* )), this, \
SLOT(finished(KProcess*))); @@ -268,8 +268,8 @@
 
   start("dvipdfm",
         QStringList() << "-o"
-                      << KProcess::quote(output_name)
-                      << KProcess::quote(dvi.filename),
+                      << output_name
+                      << dvi.filename,
         QFileInfo(dvi.filename).dirPath(true),
         i18n("<qt>The external program 'dvipdfm', 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 " @@ -280,7 +280,7 @@
 DVIExportToPS::DVIExportToPS(dviRenderer& parent,
                              QWidget* parent_widget,
                              const QString& output_name,
-                             const QString& options,
+                             const QStringList& options,
                              KPrinter* printer)
   : DVIExport(parent, parent_widget),
     printer_(printer)
@@ -426,11 +426,11 @@
     args << "-z";
 
   if (!options.isEmpty())
-    args << options;
+    args += options;
 
-  args << KProcess::quote(input_name)
+  args << input_name
        << "-o"
-       << KProcess::quote(output_name_);
+       << output_name_;
 
   start("dvips",
         args,
--- branches/work/kviewshell-0.7/kviewshell/plugins/dvi/dviexport.h #492699:492700
@@ -128,7 +128,7 @@
   DVIExportToPS(dviRenderer& parent,
                 QWidget* parent_widget,
                 const QString& output_name,
-                const QString& options,
+                const QStringList& options,
                 KPrinter* printer);
 
 private:
--- branches/work/kviewshell-0.7/kviewshell/plugins/dvi/kdvi_multipage.cpp \
#492699:492700 @@ -220,16 +220,16 @@
 
   // Turn the results of the options requestor into a list arguments
   // which are used by dvips.
-  QString dvips_options = QString::null;
+  QStringList dvips_options;
   // Print in reverse order.
   if ( printer->pageOrder() == KPrinter::LastPageFirst )
-    dvips_options += "-r ";
+    dvips_options << "-r";
   // Print only odd pages.
   if ( printer->pageSet() == KPrinter::OddPages )
-    dvips_options += "-A ";
+    dvips_options << "-A";
   // Print only even pages.
   if ( printer->pageSet() == KPrinter::EvenPages )
-    dvips_options += "-B ";
+    dvips_options << "-B";
   // We use the printer->pageSize() method to find the printer page
   // size, and pass that information on to dvips. Unfortunately, dvips
   // does not understand all of these; what exactly dvips understands,
@@ -237,114 +237,115 @@
   // with unusual paper sizes.
   switch( printer->pageSize() ) {
   case KPrinter::A4:
-    dvips_options += "-t a4 ";
+    dvips_options << "-t" << "a4";
     break;
   case KPrinter::B5:
-    dvips_options += "-t b5 ";
+    dvips_options << "-t" << "b5";
     break;
     case KPrinter::Letter:
-      dvips_options += "-t letter ";
+      dvips_options << "-t" << "letter";
       break;
   case KPrinter::Legal:
-    dvips_options += "-t legal ";
+    dvips_options << "-t" << "legal";
     break;
-    case KPrinter::Executive:
-      dvips_options += "-t executive ";
-      break;
+  case KPrinter::Executive:
+    dvips_options << "-t" << "executive";
+    break;
   case KPrinter::A0:
-    dvips_options += "-t a0 ";
+    dvips_options << "-t" << "a0";
     break;
   case KPrinter::A1:
-    dvips_options += "-t a1 ";
+    dvips_options << "-t" << "a1";
     break;
   case KPrinter::A2:
-    dvips_options += "-t a2 ";
+    dvips_options << "-t" << "a2";
     break;
   case KPrinter::A3:
-    dvips_options += "-t a3 ";
+    dvips_options << "-t" << "a3";
     break;
   case KPrinter::A5:
-    dvips_options += "-t a5 ";
+    dvips_options << "-t" << "a5";
     break;
   case KPrinter::A6:
-    dvips_options += "-t a6 ";
+    dvips_options << "-t" << "a6";
     break;
   case KPrinter::A7:
-    dvips_options += "-t a7 ";
+    dvips_options << "-t" << "a7";
     break;
   case KPrinter::A8:
-    dvips_options += "-t a8 ";
+    dvips_options << "-t" << "a8";
       break;
   case KPrinter::A9:
-    dvips_options += "-t a9 ";
+    dvips_options << "-t" << "a9";
     break;
   case KPrinter::B0:
-    dvips_options += "-t b0 ";
+    dvips_options << "-t" << "b0";
     break;
   case KPrinter::B1:
-    dvips_options += "-t b1 ";
+    dvips_options << "-t" << "b1";
     break;
   case KPrinter::B10:
-    dvips_options += "-t b10 ";
+    dvips_options << "-t" << "b10";
     break;
   case KPrinter::B2:
-    dvips_options += "-t b2 ";
+    dvips_options << "-t" << "b2";
     break;
   case KPrinter::B3:
-    dvips_options += "-t b3 ";
+    dvips_options << "-t" << "b3";
     break;
   case KPrinter::B4:
-    dvips_options += "-t b4 ";
+    dvips_options << "-t" << "b4";
     break;
   case KPrinter::B6:
-    dvips_options += "-t b6 ";
+    dvips_options << "-t" << "b6";
     break;
   case KPrinter::B7:
-    dvips_options += "-t b7 ";
+    dvips_options << "-t" << "b7";
     break;
   case KPrinter::B8:
-    dvips_options += "-t b8 ";
+    dvips_options << "-t" << "b8";
     break;
   case KPrinter::B9:
-    dvips_options += "-t b9 ";
+    dvips_options << "-t" << "b9";
     break;
   case KPrinter::C5E:
-    dvips_options += "-t c5e ";
+    dvips_options << "-t" << "c5e";
     break;
   case KPrinter::Comm10E:
-    dvips_options += "-t comm10e ";
+    dvips_options << "-t" << "comm10e";
     break;
   case KPrinter::DLE:
-    dvips_options += "-t dle ";
+    dvips_options << "-t" << "dle";
     break;
   case KPrinter::Folio:
-    dvips_options += "-t folio ";
+    dvips_options << "-t" << "folio";
     break;
   case KPrinter::Ledger:
-    dvips_options += "-t ledger ";
+    dvips_options << "-t" << "ledger";
     break;
   case KPrinter::Tabloid:
-    dvips_options += "-t tabloid ";
+    dvips_options << "-t" << "tabloid";
     break;
   default:
     break;
   }
   // Orientation
   if ( printer->orientation() == KPrinter::Landscape )
-    dvips_options += "-t landscape ";
+    dvips_options << "-t" << "landscape";
 
-
   // List of pages to print.
   QValueList<int> pageList = printer->pageList();
-  dvips_options += "-pp ";
+  QString pages;
   int commaflag = 0;
   for( QValueList<int>::ConstIterator it = pageList.begin(); it != pageList.end(); \
++it ) {  if (commaflag == 1)
-      dvips_options +=  QString(",");
+      pages +=  QString(",");
     else
       commaflag = 1;
-    dvips_options += QString("%1").arg(*it);
+    pages += QString("%1").arg(*it);
   }
+  if (!pages.isEmpty())
+    dvips_options << "-pp" << pages;
 
   // Now print. For that, export the DVI-File to PostScript. Note that
   // dvips will run concurrently to keep the GUI responsive, keep log


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic