|
From: <vz...@us...> - 2008-02-26 21:46:02
|
Revision: 12
http://kbarcode.svn.sourceforge.net/kbarcode/?rev=12&view=rev
Author: vzsolt
Date: 2008-02-26 13:46:07 -0800 (Tue, 26 Feb 2008)
Log Message:
-----------
As a first manual step, I've replaced KPrinter with QPrinter everywhere.
With this simple change, the number of build errors went down from 3400 to 3000 :)
Modified Paths:
--------------
trunk/src/barcodedialog.cpp
trunk/src/barkode.cpp
trunk/src/batchprinter.cpp
trunk/src/batchprinter.h
trunk/src/batchwizard.cpp
trunk/src/label.cpp
trunk/src/label.h
trunk/src/labeleditor.cpp
trunk/src/labeleditor.h
trunk/src/labelutils.h
trunk/src/printersettings.cpp
trunk/src/printersettings.h
trunk/src/tec.cpp
trunk/src/tec.h
Modified: trunk/src/barcodedialog.cpp
===================================================================
--- trunk/src/barcodedialog.cpp 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/barcodedialog.cpp 2008-02-26 21:46:07 UTC (rev 12)
@@ -29,7 +29,7 @@
#include <kimageio.h>
#include <klocale.h>
#include <kmessagebox.h>
-#include <kprinter.h>
+#include <qprinter.h>
#include <kpushbutton.h>
// Qt includes
@@ -168,7 +168,7 @@
if( d.isValid() )
return;
- KPrinter* printer = PrinterSettings::getInstance()->setupPrinter( "kbarcode", this );
+ QPrinter* printer = PrinterSettings::getInstance()->setupPrinter( "kbarcode", this );
if( !printer )
return;
Modified: trunk/src/barkode.cpp
===================================================================
--- trunk/src/barkode.cpp 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/barkode.cpp 2008-02-26 21:46:07 UTC (rev 12)
@@ -693,6 +693,7 @@
s_havePurePostscript = !KStandardDirs::findExe( "gs" ).isNull()
&& PurePostscriptBarcode::hasPurePostscriptBarcode();
+// TODO: I think this functionality should be moved to the engines. - VZsolt
if( s_haveGnuBarcode )
{
s_info.append( createInfo( "128raw", i18n("Raw code 128"), GNU_BARCODE, 0, BARCODE_128RAW ) );
Modified: trunk/src/batchprinter.cpp
===================================================================
--- trunk/src/batchprinter.cpp 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/batchprinter.cpp 2008-02-26 21:46:07 UTC (rev 12)
@@ -40,7 +40,7 @@
#include <kimageio.h>
#include <klocale.h>
#include <kmessagebox.h>
-#include <kprinter.h>
+#include <qprinter.h>
// Other includes
#include <stdlib.h>
@@ -49,7 +49,7 @@
#include <krun.h>
#define MAXDATASIZE 32550
-BatchPrinter::BatchPrinter( KPrinter* p, QWidget* _parent )
+BatchPrinter::BatchPrinter( QPrinter* p, QWidget* _parent )
: printer( p ), parent( _parent )
{
m_events = true;
Modified: trunk/src/batchprinter.h
===================================================================
--- trunk/src/batchprinter.h 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/batchprinter.h 2008-02-26 21:46:07 UTC (rev 12)
@@ -29,7 +29,7 @@
class Definition;
class Label;
-class KPrinter;
+class QPrinter;
class Measurements;
class QBuffer;
class QPainter;
@@ -58,7 +58,7 @@
/** Use this constructor if you want to print to
* a printer.
*/
- BatchPrinter( KPrinter* p, QWidget* _parent );
+ BatchPrinter( QPrinter* p, QWidget* _parent );
/** This constructor is used in image gernaration mode.
* @p path is the path to an existing directory where
* the images are saved.
@@ -202,7 +202,7 @@
QPaintDevice* m_paintDevice;
QBuffer* buffer;
- KPrinter* printer;
+ QPrinter* printer;
QPainter* painter;
/** parent for dialogs
*/
Modified: trunk/src/batchwizard.cpp
===================================================================
--- trunk/src/batchwizard.cpp 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/batchwizard.cpp 2008-02-26 21:46:07 UTC (rev 12)
@@ -561,7 +561,7 @@
void BatchWizard::printNow( const QString & printer, bool bUserInteraction )
{
BatchPrinter* batch = NULL;
- KPrinter* prn = NULL;
+ QPrinter* prn = NULL;
int batchType = 0;
// let's check if the label file does even exist!
Modified: trunk/src/label.cpp
===================================================================
--- trunk/src/label.cpp 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/label.cpp 2008-02-26 21:46:07 UTC (rev 12)
@@ -41,7 +41,7 @@
// KDE includes
#include <kapplication.h>
#include <klocale.h>
-#include <kprinter.h>
+#include <qprinter.h>
Label::Label( Definition* _def, QIODevice* device, QString labelname, QPaintDevice* _printer, QString customer_id, QString _article_no, QString _group )
: TokenProvider( _printer )
Modified: trunk/src/label.h
===================================================================
--- trunk/src/label.h 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/label.h 2008-02-26 21:46:07 UTC (rev 12)
@@ -33,7 +33,7 @@
class QPainter;
class QPaintDevice;
class Q3TextStream;
-class KPrinter;
+class QPrinter;
/** Creates a QPicture from the XML KBarcode file. If a SQL connections is available
* the data from the SQL tables will be used, too.
*/
@@ -52,7 +52,7 @@
int getId() const;
static void getXLabel( double x, double y, double width, double height, QPainter* painter, int mode, QString value = "" );
- //void setPrinter( KPrinter* p ) { m_printer = p; }
+ //void setPrinter( QPrinter* p ) { m_printer = p; }
/** reimplemented from TokenProvider
* returns wether this label has to be regenerated everytime
Modified: trunk/src/labeleditor.cpp
===================================================================
--- trunk/src/labeleditor.cpp 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/labeleditor.cpp 2008-02-26 21:46:07 UTC (rev 12)
@@ -101,7 +101,7 @@
#include <knuminput.h>
#include <kmenu.h>
#include <kpushbutton.h>
-#include <kprinter.h>
+#include <qprinter.h>
#include <krun.h>
#include <kspell.h>
#include <kstatusbar.h>
@@ -767,7 +767,7 @@
PrinterSettings::getInstance()->getData()->border = pld.border();
- KPrinter* printer = PrinterSettings::getInstance()->setupPrinter( KUrl( filename ), this );
+ QPrinter* printer = PrinterSettings::getInstance()->setupPrinter( KUrl( filename ), this );
if( !printer )
return;
Modified: trunk/src/labeleditor.h
===================================================================
--- trunk/src/labeleditor.h 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/labeleditor.h 2008-02-26 21:46:07 UTC (rev 12)
@@ -72,7 +72,7 @@
class QPaintDevice;
class QString;
class KPushButton;
-class KPrinter;
+class QPrinter;
class Q3CanvasItem;
class TCanvasItem;
class RectItem;
Modified: trunk/src/labelutils.h
===================================================================
--- trunk/src/labelutils.h 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/labelutils.h 2008-02-26 21:46:07 UTC (rev 12)
@@ -22,7 +22,7 @@
#define LABELUTILS_H
class Definition;
-class KPrinter;
+class QPrinter;
class QDomElement;
class QFont;
class QImage;
Modified: trunk/src/printersettings.cpp
===================================================================
--- trunk/src/printersettings.cpp 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/printersettings.cpp 2008-02-26 21:46:07 UTC (rev 12)
@@ -36,35 +36,35 @@
const PageFormatInfo pageFormatInfo[]=
{
- { KPrinter::A3, "A3", I18N_NOOP("ISO A3"), 297.0, 420.0 },
- { KPrinter::A4, "A4", I18N_NOOP("ISO A4"), 210.0, 297.0 },
- { KPrinter::A5, "A5", I18N_NOOP("ISO A5"), 148.0, 210.0 },
- { KPrinter::Letter, "Letter", I18N_NOOP("US Letter"), 216.0, 279.0 }, // should be 215.9 mm x 279.4 mm
- { KPrinter::Legal, "Legal", I18N_NOOP("US Legal"), 216.0, 356.0 }, // should be 215.9 mm x 335.6 mm
- { KPrinter::A4, "Screen", I18N_NOOP("Screen"), 297.0, 210.0 }, // Custom, so fall back to A4
- { KPrinter::A4, "Custom", I18N_NOOP("Custom"), 210.0, 297.0 }, // Custom, so fall back to A4
- { KPrinter::B5, "B5", I18N_NOOP("ISO B5"), 182.0, 257.0 },
- { KPrinter::Executive, "Executive", I18N_NOOP("US Executive"), 191.0, 254.0 }, // should be 190.5 mm x 254.0 mm
- { KPrinter::A0, "A0", I18N_NOOP("ISO A0"), 841.0, 1189.0 },
- { KPrinter::A1, "A1", I18N_NOOP("ISO A1"), 594.0, 841.0 },
- { KPrinter::A2, "A2", I18N_NOOP("ISO A2"), 420.0, 594.0 },
- { KPrinter::A6, "A6", I18N_NOOP("ISO A6"), 105.0, 148.0 },
- { KPrinter::A7, "A7", I18N_NOOP("ISO A7"), 74.0, 105.0 },
- { KPrinter::A8, "A8", I18N_NOOP("ISO A8"), 52.0, 74.0 },
- { KPrinter::A9, "A9", I18N_NOOP("ISO A9"), 37.0, 52.0 },
- { KPrinter::B0, "B0", I18N_NOOP("ISO B0"), 1030.0, 1456.0 },
- { KPrinter::B1, "B1", I18N_NOOP("ISO B1"), 728.0, 1030.0 },
- { KPrinter::B10, "B10", I18N_NOOP("ISO B10"), 32.0, 45.0 },
- { KPrinter::B2, "B2", I18N_NOOP("ISO B2"), 515.0, 728.0 },
- { KPrinter::B3, "B3", I18N_NOOP("ISO B3"), 364.0, 515.0 },
- { KPrinter::B4, "B4", I18N_NOOP("ISO B4"), 257.0, 364.0 },
- { KPrinter::B6, "B6", I18N_NOOP("ISO B6"), 128.0, 182.0 },
- { KPrinter::C5E, "C5", I18N_NOOP("ISO C5"), 163.0, 229.0 }, // Some sources tells: 162 mm x 228 mm
- { KPrinter::Comm10E, "Comm10", I18N_NOOP("US Common 10"), 105.0, 241.0 }, // should be 104.775 mm x 241.3 mm
- { KPrinter::DLE, "DL", I18N_NOOP("ISO DL"), 110.0, 220.0 },
- { KPrinter::Folio, "Folio", I18N_NOOP("US Folio"), 210.0, 330.0 }, // should be 209.54 mm x 330.2 mm
- { KPrinter::Ledger, "Ledger", I18N_NOOP("US Ledger"), 432.0, 279.0 }, // should be 431.8 mm x 297.4 mm
- { KPrinter::Tabloid, "Tabloid", I18N_NOOP("US Tabloid"), 279.0, 432.0 } // should be 297.4 mm x 431.8 mm
+ { QPrinter::A3, "A3", I18N_NOOP("ISO A3"), 297.0, 420.0 },
+ { QPrinter::A4, "A4", I18N_NOOP("ISO A4"), 210.0, 297.0 },
+ { QPrinter::A5, "A5", I18N_NOOP("ISO A5"), 148.0, 210.0 },
+ { QPrinter::Letter, "Letter", I18N_NOOP("US Letter"), 216.0, 279.0 }, // should be 215.9 mm x 279.4 mm
+ { QPrinter::Legal, "Legal", I18N_NOOP("US Legal"), 216.0, 356.0 }, // should be 215.9 mm x 335.6 mm
+ { QPrinter::A4, "Screen", I18N_NOOP("Screen"), 297.0, 210.0 }, // Custom, so fall back to A4
+ { QPrinter::A4, "Custom", I18N_NOOP("Custom"), 210.0, 297.0 }, // Custom, so fall back to A4
+ { QPrinter::B5, "B5", I18N_NOOP("ISO B5"), 182.0, 257.0 },
+ { QPrinter::Executive, "Executive", I18N_NOOP("US Executive"), 191.0, 254.0 }, // should be 190.5 mm x 254.0 mm
+ { QPrinter::A0, "A0", I18N_NOOP("ISO A0"), 841.0, 1189.0 },
+ { QPrinter::A1, "A1", I18N_NOOP("ISO A1"), 594.0, 841.0 },
+ { QPrinter::A2, "A2", I18N_NOOP("ISO A2"), 420.0, 594.0 },
+ { QPrinter::A6, "A6", I18N_NOOP("ISO A6"), 105.0, 148.0 },
+ { QPrinter::A7, "A7", I18N_NOOP("ISO A7"), 74.0, 105.0 },
+ { QPrinter::A8, "A8", I18N_NOOP("ISO A8"), 52.0, 74.0 },
+ { QPrinter::A9, "A9", I18N_NOOP("ISO A9"), 37.0, 52.0 },
+ { QPrinter::B0, "B0", I18N_NOOP("ISO B0"), 1030.0, 1456.0 },
+ { QPrinter::B1, "B1", I18N_NOOP("ISO B1"), 728.0, 1030.0 },
+ { QPrinter::B10, "B10", I18N_NOOP("ISO B10"), 32.0, 45.0 },
+ { QPrinter::B2, "B2", I18N_NOOP("ISO B2"), 515.0, 728.0 },
+ { QPrinter::B3, "B3", I18N_NOOP("ISO B3"), 364.0, 515.0 },
+ { QPrinter::B4, "B4", I18N_NOOP("ISO B4"), 257.0, 364.0 },
+ { QPrinter::B6, "B6", I18N_NOOP("ISO B6"), 128.0, 182.0 },
+ { QPrinter::C5E, "C5", I18N_NOOP("ISO C5"), 163.0, 229.0 }, // Some sources tells: 162 mm x 228 mm
+ { QPrinter::Comm10E, "Comm10", I18N_NOOP("US Common 10"), 105.0, 241.0 }, // should be 104.775 mm x 241.3 mm
+ { QPrinter::DLE, "DL", I18N_NOOP("ISO DL"), 110.0, 220.0 },
+ { QPrinter::Folio, "Folio", I18N_NOOP("US Folio"), 210.0, 330.0 }, // should be 209.54 mm x 330.2 mm
+ { QPrinter::Ledger, "Ledger", I18N_NOOP("US Ledger"), 432.0, 279.0 }, // should be 431.8 mm x 297.4 mm
+ { QPrinter::Tabloid, "Tabloid", I18N_NOOP("US Tabloid"), 279.0, 432.0 } // should be 297.4 mm x 431.8 mm
};
// end stolen
@@ -119,7 +119,7 @@
// get default page size from KDE
if( lpdata->format == -1 )
for( unsigned int i = 0; i < sizeof( pageFormatInfo ) / sizeof( PageFormatInfo ); i++ )
- if( pageFormatInfo[i].kprinter == KGlobal::locale()->pageSize() ) {
+ if( pageFormatInfo[i].qprinter == KGlobal::locale()->pageSize() ) {
lpdata->format = i;
break;
}
@@ -157,9 +157,9 @@
return lpdata->quality == Middle || lpdata->quality == VeryHigh? High : lpdata->quality;
};
-KPrinter* PrinterSettings::setupPrinter( const KUrl & url, QWidget* parent, bool immediately, const QString & prn )
+QPrinter* PrinterSettings::setupPrinter( const KUrl & url, QWidget* parent, bool immediately, const QString & prn )
{
- KPrinter* printer = new KPrinter( true, (enum QPrinter::PrinterMode)getQuality() );
+ QPrinter* printer = new QPrinter( true, (enum QPrinter::PrinterMode)getQuality() );
if( getData()->quality == Middle )
printer->setResolution( 300 );
else if( getData()->quality == VeryHigh )
Modified: trunk/src/printersettings.h
===================================================================
--- trunk/src/printersettings.h 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/printersettings.h 2008-02-26 21:46:07 UTC (rev 12)
@@ -20,7 +20,7 @@
#include <qobject.h>
#include <qstring.h>
-#include <kprinter.h>
+#include <qprinter.h>
class KUrl;
@@ -48,14 +48,14 @@
typedef struct PageFormatInfo
{
- KPrinter::PageSize kprinter;
+ QPrinter::PageSize qprinter;
const char* shortName; // Short name
const char* descriptiveName; // Full name, which will be translated
double width; // in mm
double height; // in mm
};
-class KPrinter;
+class QPrinter;
class KComboBox;
class PrinterSettings: public QObject {
Q_OBJECT
@@ -80,7 +80,7 @@
static PrinterSettings* getInstance();
// don't forget to delete printer
- KPrinter* setupPrinter( const KUrl & url, QWidget* parent, bool immediately = false, const QString & prn = QString::null );
+ QPrinter* setupPrinter( const KUrl & url, QWidget* parent, bool immediately = false, const QString & prn = QString::null );
public slots:
void loadConfig();
Modified: trunk/src/tec.cpp
===================================================================
--- trunk/src/tec.cpp 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/tec.cpp 2008-02-26 21:46:07 UTC (rev 12)
@@ -47,7 +47,7 @@
#include <kmessagebox.h>
#include <kmenu.h>
#include <knuminput.h>
-#include <kprinter.h>
+#include <qprinter.h>
#include <kurlrequester.h>
#define MAXDATASIZE 32550
Modified: trunk/src/tec.h
===================================================================
--- trunk/src/tec.h 2008-02-09 13:35:39 UTC (rev 11)
+++ trunk/src/tec.h 2008-02-26 21:46:07 UTC (rev 12)
@@ -45,7 +45,7 @@
#include <kmessagebox.h>
#include <kmenu.h>
#include <knuminput.h>
-#include <kprinter.h>
+#include <qprinter.h>
#include <kurlrequester.h>
QString tec452(const QString &file, int count, const QString &art, const QString &group, const QString &id);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|