|
From: <vz...@us...> - 2008-03-05 17:32:22
|
Revision: 49
http://kbarcode.svn.sourceforge.net/kbarcode/?rev=49&view=rev
Author: vzsolt
Date: 2008-03-05 09:32:22 -0800 (Wed, 05 Mar 2008)
Log Message:
-----------
I've taken a different approach now, I've ported every KConfig use in the code.
Also, I've fixed a (potential) bug where the setting 'gridenabled' wasn't read correctly.
Modified Paths:
--------------
trunk/src/batchprinter.cpp
trunk/src/batchwizard.cpp
trunk/src/definition.cpp
trunk/src/dialogs/configdialog.cpp
trunk/src/dialogs/previewdialog.cpp
trunk/src/kbarcodesettings.cpp
trunk/src/labeleditor.cpp
trunk/src/mainwindow.cpp
trunk/src/printersettings.cpp
trunk/src/sqltables.cpp
Modified: trunk/src/batchprinter.cpp
===================================================================
--- trunk/src/batchprinter.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/batchprinter.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -37,7 +37,7 @@
#include <kabc/addressee.h>
#include <kabc/addresseelist.h>
#include <kapplication.h>
-#include <kconfig.h>
+#include <kconfiggroup.h>
#include <kimageio.h>
#include <klocale.h>
#include <kmessagebox.h>
Modified: trunk/src/batchwizard.cpp
===================================================================
--- trunk/src/batchwizard.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/batchwizard.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -58,6 +58,7 @@
#include <kapplication.h>
#include <kcombobox.h>
#include <kcompletion.h>
+#include <kconfiggroup.h>
#include <kfiledialog.h>
#include <kiconloader.h>
#include <kimageio.h>
@@ -910,12 +911,10 @@
return;
}
- // new config entry!!!
- KConfig* config = KGlobal::config();
- config->setGroup("FileFormat");
- int pos[3] = { config->readNumEntry("Data0", 0 ),
- config->readNumEntry("Data1", 1 ),
- config->readNumEntry("Data2", 2 ) };
+ KConfigGroup config = KGlobal::config()->group("FileFormat");
+ int pos[3] = { config.readEntry("Data0", 0 ),
+ config.readEntry("Data1", 1 ),
+ config.readEntry("Data2", 2 ) };
bool custom_article_no = lpdata->useCustomNo;
QBuffer buf( data.utf8() );
@@ -976,12 +975,8 @@
}
if( !dropped.isEmpty() )
-#if QT_VERSION >= 0x030100
KMessageBox::informationList( this, i18n("<qt>The following items can not be added:" )+ "</qt>", dropped );
-#else
- KMessageBox::questionYesNoList( this, i18n("<qt>The following items can not be added:" )+ "</qt>", dropped );
-#endif
-
+
enableControls();
}
Modified: trunk/src/definition.cpp
===================================================================
--- trunk/src/definition.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/definition.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -25,6 +25,7 @@
// KDE includes
#include <kapplication.h>
+#include <kconfiggroup.h>
#include <kfiledialog.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -299,11 +300,10 @@
QString f = KStandardDirs::locateLocal( "data", "kbarcode/labeldefinitions.sql" );
if( !QFile::exists( f ) ) {
- KConfig* config = KGlobal::config();
- config->setGroup( "Definitions" );
-
+ KConfigGroup config = KGlobal::config()->group( "Definitions" );
+
// copy file to new location
- QString fname = config->readEntry( "defpath", locate( "data", "kbarcode/labeldefinitions.sql" ) );
+ QString fname = config.readEntry( "defpath", locate( "data", "kbarcode/labeldefinitions.sql" ) );
if( !QFile::exists( fname ) || fname.isEmpty() )
return ( showFileError() ? openFile() : false );
@@ -553,10 +553,9 @@
QString f = KFileDialog::getOpenFileName( QString::null, QString::null, 0 );
if( !f.isEmpty() && QFile::exists( f ) ) {
- KConfig* config = KGlobal::config();
- config->setGroup( "Definitions" );
- config->writeEntry( "defpath", f );
- config->sync();
+ KConfigGroup config = KGlobal::config()->group( "Definitions" );
+ config.writeEntry( "defpath", f );
+ config.sync();
}
nodefmsg = false;
return openFile();
Modified: trunk/src/dialogs/configdialog.cpp
===================================================================
--- trunk/src/dialogs/configdialog.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/dialogs/configdialog.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -35,7 +35,7 @@
// KDE includes
#include <kabc/addressee.h>
#include <kapplication.h>
-#include <kconfig.h>
+#include <kconfiggroup.h>
#include <kcolorbutton.h>
#include <kiconloader.h>
#include <kimageio.h>
Modified: trunk/src/dialogs/previewdialog.cpp
===================================================================
--- trunk/src/dialogs/previewdialog.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/dialogs/previewdialog.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -39,7 +39,7 @@
#include <kabc/addresseedialog.h>
#include <kapplication.h>
#include <kcombobox.h>
-#include <kconfig.h>
+#include <kconfiggroup.h>
#include <kiconloader.h>
#include <klineedit.h>
#include <klocale.h>
@@ -146,21 +146,21 @@
connect( customerName, SIGNAL( activated(int) ), this, SLOT( customerNameChanged(int) ) );
connect( customerId, SIGNAL( activated(int) ), this, SLOT( customerIdChanged(int) ) );
- KConfig* config = KGlobal::config();
- config->setGroup( "PreviewDialog" );
- resize( config->readNumEntry( "width", width() ), config->readNumEntry( "height", height() ) );
+ KConfigGroup config = KGlobal::config()->group( "PreviewDialog" );
+ resize( config.readEntry( "width", width() ), config.readEntry( "height", height() ) );
+
if( SqlTables::isConnected() )
setupSql();
}
PreviewDialog::~PreviewDialog()
{
- KConfig* config = KGlobal::config();
- config->setGroup( "PreviewDialog" );
- config->writeEntry( "width", width() );
- config->writeEntry( "height", height() );
- config->sync();
+ KConfigGroup config = KGlobal::config()->group( "PreviewDialog" );
+
+ config.writeEntry( "width", width() );
+ config.writeEntry( "height", height() );
+ config.sync();
}
void PreviewDialog::setupSql()
Modified: trunk/src/kbarcodesettings.cpp
===================================================================
--- trunk/src/kbarcodesettings.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/kbarcodesettings.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -23,7 +23,7 @@
// KDE includes
#include <kapplication.h>
#include <kcolorbutton.h>
-#include <kconfig.h>
+#include <kconfiggroup.h>
#include <klineedit.h>
#include <knuminput.h>
@@ -57,25 +57,24 @@
void KBarcodeSettings::saveConfig()
{
- KConfig* config = KGlobal::config();
+ KConfigGroup config = KGlobal::config()->group( "LabelEditor" );
- config->setGroup("LabelEditor");
- config->writeEntry("grid", gridsize );
- config->writeEntry("gridcolor", gridcolor );
- config->writeEntry("AskNewDlg", newdlg );
- config->writeEntry("DateFormat", dateFormat );
+ config.writeEntry("grid", gridsize );
+ config.writeEntry("gridcolor", gridcolor );
+ config.writeEntry("AskNewDlg", newdlg );
+ config.writeEntry("DateFormat", dateFormat );
}
void KBarcodeSettings::loadConfig()
{
- KConfig* config = KGlobal::config();
+ KConfigGroup config = KGlobal::config()->group( "LabelEditor" );
QColor tmpc( Qt::lightGray );
- config->setGroup("LabelEditor");
- gridsize = config->readNumEntry("grid", 5);
- gridcolor = config->readColorEntry("gridcolor", &tmpc );
- newdlg = config->readBoolEntry("AskNewDlg", true );
- dateFormat = config->readEntry("DateFormat", "dd-MM-yyyy" );
+
+ gridsize = config.readEntry("grid", 5);
+ gridcolor = config.readEntry("gridcolor", &tmpc );
+ newdlg = config.readEntry("AskNewDlg", true );
+ dateFormat = config.readEntry("DateFormat", "dd-MM-yyyy" );
}
void KBarcodeSettings::configure()
Modified: trunk/src/labeleditor.cpp
===================================================================
--- trunk/src/labeleditor.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/labeleditor.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -183,31 +183,31 @@
void LabelEditor::loadConfig()
{
- KConfig* config = KGlobal::config();
- recentAct->loadEntries( config, "RecentFiles" );
+ KConfigGroup config = KGlobal::config()->group( "RecentFiles" );
+ recentAct->loadEntries( config );
- gridAct->setChecked( config->readBoolEntry("gridenabled", false ) );
+ config = KGlobal::config()->group( "LabelEditor" );
+
+ gridAct->setChecked( config.readEntry("gridenabled", false ) );
toggleGrid();
}
void LabelEditor::saveConfig()
{
- KConfig* config = KGlobal::config();
+ KConfigGroup config = KGlobal::config()->group( "RecentFiles" );
- recentAct->saveEntries( config, "RecentFiles" );
+ recentAct->saveEntries( config );
- config->setGroup("LabelEditor");
- config->writeEntry("gridenabled", gridAct->isChecked() );
+ config = KGlobal::config()->group( "LabelEditor" );
+ config.writeEntry("gridenabled", gridAct->isChecked() );
- config->sync();
+ config.sync();
MainWindow::saveConfig();
}
void LabelEditor::createCommandHistory()
{
- KConfig* config = KGlobal::config();
-
if( undoAct && redoAct )
{
undoAct->unplug( editMenu );
@@ -221,7 +221,6 @@
history = new KCommandHistory( actionCollection(), false );
cv->setHistory( history );
- config->setGroup("LabelEditor");
history->setUndoLimit( KBARCODE_UNDO_LIMIT );
history->setRedoLimit( KBARCODE_UNDO_LIMIT );
}
Modified: trunk/src/mainwindow.cpp
===================================================================
--- trunk/src/mainwindow.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/mainwindow.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -24,7 +24,7 @@
// KDE includes
#include <kaction.h>
#include <kapplication.h>
-#include <kconfig.h>
+#include <kconfiggroup.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kmenubar.h>
@@ -121,11 +121,9 @@
void MainWindow::loadConfig()
{
- // TODO: rewrite with KConfigGroup
- KConfig* config = KGlobal::config();
+ KConfigGroup config = KGlobal::config()->group("Wizard");
- config->setGroup("Wizard");
- first = config->readBoolEntry("firststart2", true );
+ first = config.readEntry("firststart2", true );
SqlTables* tables = SqlTables::getInstance();
if( tables->getData().autoconnect && !first && autoconnect && connectAct ) {
@@ -141,27 +139,25 @@
void MainWindow::saveConfig()
{
- // TODO: rewrite with KConfigGroup
- KConfig* config = KGlobal::config();
+ KConfigGroup config = KGlobal::config()->group("Wizard");
- config->setGroup("Wizard");
- config->writeEntry("firststart2", false );
+ config.writeEntry("firststart2", false );
PrinterSettings::getInstance()->saveConfig();
SqlTables::getInstance()->saveConfig();
KBarcodeSettings::getInstance()->saveConfig();
- config->sync();
+ config.sync();
}
void MainWindow::assistant()
{
- // TODO: create an assistant
- /* ConfWizard* wiz = new ConfWizard( 0, "wiz", true );
+ // FIXME: create an assistant
+ ConfWizard* wiz = new ConfWizard( 0, "wiz", true );
if( wiz->exec() == QDialog::Accepted && wiz->checkDatabase->isChecked() )
SqlTables::getInstance()->connectMySQL();
- delete wiz; */
+ delete wiz;
}
void MainWindow::connectMySQL()
Modified: trunk/src/printersettings.cpp
===================================================================
--- trunk/src/printersettings.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/printersettings.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -21,7 +21,7 @@
// KDE includes
#include <kapplication.h>
#include <kcombobox.h>
-#include <kconfig.h>
+#include <kconfiggroup.h>
#include <kglobal.h>
#include <klocale.h>
#include <kurl.h>
@@ -93,29 +93,30 @@
void PrinterSettings::loadConfig()
{
- KConfig* config = KGlobal::config();
+ KConfigGroup config = KGlobal::config()->group( "Printer" );
- config->setGroup("Printer");
- lpdata->articleEvent1 = (enum linebreak)config->readNumEntry("articleEvent1", NO_BREAK );
- lpdata->articleEvent2 = (enum linebreak)config->readNumEntry("articleEvent2", NO_BREAK );
- lpdata->articleEvent3 = (enum linebreak)config->readNumEntry("articleEvent3", NO_BREAK );
- lpdata->articleEvent4 = (enum linebreak)config->readNumEntry("articleEvent4", NO_BREAK );
- lpdata->groupEvent1 = (enum linebreak)config->readNumEntry("groupEvent1", NO_BREAK );
- lpdata->groupEvent2 = (enum linebreak)config->readNumEntry("groupEvent2", NO_BREAK );
- lpdata->groupEvent3 = (enum linebreak)config->readNumEntry("groupEvent3", NO_BREAK );
- lpdata->groupEvent4 = (enum linebreak)config->readNumEntry("groupEvent4", NO_BREAK );
- lpdata->useCustomNo = config->readBoolEntry("UseArticleCustomerNo", false );
- lpdata->quality = config->readNumEntry( "quality", Middle );
- // screen resolution was removed before 1.5.4, use middle instead
+ lpdata->articleEvent1 = (enum linebreak)config.readEntry("articleEvent1", NO_BREAK );
+ lpdata->articleEvent2 = (enum linebreak)config.readEntry("articleEvent2", NO_BREAK );
+ lpdata->articleEvent3 = (enum linebreak)config.readEntry("articleEvent3", NO_BREAK );
+ lpdata->articleEvent4 = (enum linebreak)config.readEntry("articleEvent4", NO_BREAK );
+ lpdata->groupEvent1 = (enum linebreak)config.readEntry("groupEvent1", NO_BREAK );
+ lpdata->groupEvent2 = (enum linebreak)config.readEntry("groupEvent2", NO_BREAK );
+ lpdata->groupEvent3 = (enum linebreak)config.readEntry("groupEvent3", NO_BREAK );
+ lpdata->groupEvent4 = (enum linebreak)config.readEntry("groupEvent4", NO_BREAK );
+ lpdata->useCustomNo = config.readEntry("UseArticleCustomerNo", false );
+ lpdata->quality = config.readEntry( "quality", Middle );
+
if( lpdata->quality != High && lpdata->quality != Middle && lpdata->quality != VeryHigh )
lpdata->quality = Middle;
- config->setGroup("BatchPrinting");
- lpdata->comment = config->readEntry("comment", "#" );
- lpdata->separator = config->readEntry("separator", ";" );
- lpdata->quote = config->readEntry("quote", "");
- lpdata->border = config->readBoolEntry("border", false );
- lpdata->format = config->readNumEntry("PageSize", -1 );
+ config = KGlobal::config()->group( "BatchPrinting" );
+
+ lpdata->comment = config.readEntry("comment", "#" );
+ lpdata->separator = config.readEntry("separator", ";" );
+ lpdata->quote = config.readEntry("quote", "");
+ lpdata->border = config.readEntry("border", false );
+ lpdata->format = config.readEntry("PageSize", -1 );
+
// get default page size from KDE
if( lpdata->format == -1 )
for( unsigned int i = 0; i < sizeof( pageFormatInfo ) / sizeof( PageFormatInfo ); i++ )
@@ -128,28 +129,28 @@
void PrinterSettings::saveConfig()
{
- KConfig* config = KGlobal::config();
+ KConfigGroup config = KGlobal::config()->group( "Printer" );
- config->setGroup("Printer");
- config->writeEntry("articleEvent1", lpdata->articleEvent1 );
- config->writeEntry("articleEvent2", lpdata->articleEvent2 );
- config->writeEntry("articleEvent3", lpdata->articleEvent3 );
- config->writeEntry("articleEvent4", lpdata->articleEvent4 );
- config->writeEntry("groupEvent1", lpdata->groupEvent1 );
- config->writeEntry("groupEvent2", lpdata->groupEvent2 );
- config->writeEntry("groupEvent3", lpdata->groupEvent3 );
- config->writeEntry("groupEvent4", lpdata->groupEvent4 );
- config->writeEntry("quality", lpdata->quality );
- config->writeEntry("UseArticleCustomerNo", lpdata->useCustomNo );
+ config.writeEntry("articleEvent1", lpdata->articleEvent1 );
+ config.writeEntry("articleEvent2", lpdata->articleEvent2 );
+ config.writeEntry("articleEvent3", lpdata->articleEvent3 );
+ config.writeEntry("articleEvent4", lpdata->articleEvent4 );
+ config.writeEntry("groupEvent1", lpdata->groupEvent1 );
+ config.writeEntry("groupEvent2", lpdata->groupEvent2 );
+ config.writeEntry("groupEvent3", lpdata->groupEvent3 );
+ config.writeEntry("groupEvent4", lpdata->groupEvent4 );
+ config.writeEntry("quality", lpdata->quality );
+ config.writeEntry("UseArticleCustomerNo", lpdata->useCustomNo );
- config->setGroup("BatchPrinting");
- config->writeEntry("comment", lpdata->comment );
- config->writeEntry("separator", lpdata->separator );
- config->writeEntry("quote", lpdata->quote );
- config->writeEntry("border", lpdata->border );
- config->writeEntry("PageSize", lpdata->format );
+ config = KGlobal::config()->group( "BatchPrinting" );
+
+ config.writeEntry("comment", lpdata->comment );
+ config.writeEntry("separator", lpdata->separator );
+ config.writeEntry("quote", lpdata->quote );
+ config.writeEntry("border", lpdata->border );
+ config.writeEntry("PageSize", lpdata->format );
- config->sync();
+ config.sync();
}
int PrinterSettings::getQuality() const
Modified: trunk/src/sqltables.cpp
===================================================================
--- trunk/src/sqltables.cpp 2008-03-05 16:38:32 UTC (rev 48)
+++ trunk/src/sqltables.cpp 2008-03-05 17:32:22 UTC (rev 49)
@@ -35,7 +35,7 @@
// KDE includes
#include <kapplication.h>
#include <kcombobox.h>
-#include <kconfig.h>
+#include <kconfiggroup.h>
#include <klineedit.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -288,9 +288,8 @@
QString f = KStandardDirs::locateLocal( "data", "kbarcode/labeldefinitions.sql" );
if( !QFile::exists( f ) ) {
- KConfig* config = KGlobal::config();
- config->setGroup( "Definitions" );
- f = config->readEntry( "defpath", locate( "data", "kbarcode/labeldefinitions.sql" ) );
+ KConfigGroup config = KGlobal::config()->group( "Definitions" );
+ f = config.readEntry( "defpath", locate( "data", "kbarcode/labeldefinitions.sql" ) );
}
importData( f, db );
@@ -347,30 +346,28 @@
void SqlTables::loadConfig()
{
- KConfig* config = KGlobal::config();
+ KConfigGroup config = KGlobal::config()->group( "SQL" );
- config->setGroup("SQL");
- sqldata.username = config->readEntry("username", "root");
- sqldata.password = config->readEntry("password", "" );
- sqldata.hostname = config->readEntry("hostname", "localhost" );
- sqldata.database = config->readEntry("database", "kbarcode" );
- sqldata.driver = config->readEntry("driver", "QMYSQL3" );
- sqldata.autoconnect = config->readBoolEntry("autoconnect", false );
+ sqldata.username = config.readEntry("username", "root");
+ sqldata.password = config.readEntry("password", "" );
+ sqldata.hostname = config.readEntry("hostname", "localhost" );
+ sqldata.database = config.readEntry("database", "kbarcode" );
+ sqldata.driver = config.readEntry("driver", "QMYSQL3" );
+ sqldata.autoconnect = config.readEntry("autoconnect", false );
}
void SqlTables::saveConfig()
{
- KConfig* config = KGlobal::config();
+ KConfigGroup config = KGlobal::config()->group( "SQL" );
- config->setGroup("SQL");
- config->writeEntry("username", sqldata.username );
- config->writeEntry("password", sqldata.password );
- config->writeEntry("hostname", sqldata.hostname );
- config->writeEntry("database", sqldata.database );
- config->writeEntry("driver", sqldata.driver );
- config->writeEntry("autoconnect", sqldata.autoconnect );
+ config.writeEntry("username", sqldata.username );
+ config.writeEntry("password", sqldata.password );
+ config.writeEntry("hostname", sqldata.hostname );
+ config.writeEntry("database", sqldata.database );
+ config.writeEntry("driver", sqldata.driver );
+ config.writeEntry("autoconnect", sqldata.autoconnect );
- config->sync();
+ config.sync();
}
void SqlTables::updateTables()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Dominik S. <dom...@we...> - 2008-02-27 08:27:24
|
Great job! :-D Am Dienstag, 26. Februar 2008 schrieb vz...@us...: > 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. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Kbarcode-svn mailing list > Kba...@li... > https://lists.sourceforge.net/lists/listinfo/kbarcode-svn -- ********************************************************************** Dominik Seichter - dom...@we... KRename - http://www.krename.net - Powerful batch renamer for KDE KBarcode - http://www.kbarcode.net - Barcode and label printing PoDoFo - http://podofo.sf.net - PDF generation and parsing library SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game, for KDE Alan - http://alan.sf.net - A Turing Machine in Java ********************************************************************** |