From eba47f8f0637f451e21348187591e1f1fd58ac74 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 2 Aug 2010 19:23:46 +0000 Subject: TQt conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kooka/dwmenuaction.cpp | 10 +- kooka/dwmenuaction.h | 6 +- kooka/imageselectline.cpp | 30 +++--- kooka/imageselectline.h | 12 +-- kooka/img_saver.cpp | 200 +++++++++++++++++------------------ kooka/img_saver.h | 110 ++++++++++---------- kooka/imgnamecombo.cpp | 26 ++--- kooka/imgnamecombo.h | 12 +-- kooka/imgprintdialog.cpp | 88 ++++++++-------- kooka/imgprintdialog.h | 40 +++---- kooka/kadmosocr.cpp | 56 +++++----- kooka/kadmosocr.h | 42 ++++---- kooka/kocrbase.cpp | 116 ++++++++++----------- kooka/kocrbase.h | 50 ++++----- kooka/kocrgocr.cpp | 40 +++---- kooka/kocrgocr.h | 16 +-- kooka/kocrkadmos.cpp | 122 +++++++++++----------- kooka/kocrkadmos.h | 70 ++++++------- kooka/kocrocrad.cpp | 62 +++++------ kooka/kocrocrad.h | 28 ++--- kooka/kooka.cpp | 118 ++++++++++----------- kooka/kooka.h | 10 +- kooka/kookaimage.cpp | 42 ++++---- kooka/kookaimage.h | 28 ++--- kooka/kookapref.cpp | 166 ++++++++++++++--------------- kooka/kookapref.h | 38 +++---- kooka/kookaprint.cpp | 106 +++++++++---------- kooka/kookaprint.h | 32 +++--- kooka/kookaview.cpp | 230 ++++++++++++++++++++--------------------- kooka/kookaview.h | 44 ++++---- kooka/ksaneocr.cpp | 258 +++++++++++++++++++++++----------------------- kooka/ksaneocr.h | 64 ++++++------ kooka/main.cpp | 6 +- kooka/ocrresedit.cpp | 30 +++--- kooka/ocrresedit.h | 22 ++-- kooka/ocrword.cpp | 42 ++++---- kooka/ocrword.h | 44 ++++---- kooka/scanpackager.cpp | 174 +++++++++++++++---------------- kooka/scanpackager.h | 70 ++++++------- kooka/thumbview.cpp | 64 ++++++------ kooka/thumbview.h | 40 +++---- kooka/thumbviewitem.cpp | 4 +- kooka/thumbviewitem.h | 6 +- 43 files changed, 1387 insertions(+), 1387 deletions(-) (limited to 'kooka') diff --git a/kooka/dwmenuaction.cpp b/kooka/dwmenuaction.cpp index abe57f23..920fb433 100644 --- a/kooka/dwmenuaction.cpp +++ b/kooka/dwmenuaction.cpp @@ -31,14 +31,14 @@ #include "dwmenuaction.moc" //------------------------------------- -dwMenuAction::dwMenuAction( const QString& text, const KShortcut& cut, - KDockWidget *dw,QObject* parent, +dwMenuAction::dwMenuAction( const TQString& text, const KShortcut& cut, + KDockWidget *dw,TQObject* parent, KDockMainWindow *mw, const char* name ) :KToggleAction(text,cut,parent,name),m_dw(dw),m_mw(mw) { - connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool))); - connect(m_dw->dockManager(),SIGNAL(change()),this,SLOT(anDWChanged())); - connect(m_dw,SIGNAL(destroyed()),this,SLOT(slotWidgetDestroyed())); + connect(this,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotToggled(bool))); + connect(m_dw->dockManager(),TQT_SIGNAL(change()),this,TQT_SLOT(anDWChanged())); + connect(m_dw,TQT_SIGNAL(destroyed()),this,TQT_SLOT(slotWidgetDestroyed())); setChecked(m_dw->mayBeHide()); } diff --git a/kooka/dwmenuaction.h b/kooka/dwmenuaction.h index 9b1698ed..e260a094 100644 --- a/kooka/dwmenuaction.h +++ b/kooka/dwmenuaction.h @@ -30,7 +30,7 @@ #ifndef __DW_MENU_ACTION #define __DW_MENU_ACTION #include -#include +#include #include /** @@ -44,9 +44,9 @@ class dwMenuAction:public KToggleAction { Q_OBJECT public: - dwMenuAction( const QString& text, + dwMenuAction( const TQString& text, const KShortcut& cut = KShortcut(), - KDockWidget *dw=0, QObject* parent = 0, + KDockWidget *dw=0, TQObject* parent = 0, KDockMainWindow * mw=0, const char* name = 0 ); virtual ~dwMenuAction(); diff --git a/kooka/imageselectline.cpp b/kooka/imageselectline.cpp index f8677f1f..4145cc30 100644 --- a/kooka/imageselectline.cpp +++ b/kooka/imageselectline.cpp @@ -25,11 +25,11 @@ * without including the source code for Qt in the source distribution. * * * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -47,22 +47,22 @@ * together in a row. The button opens a file selector box to pick a file. */ -ImageSelectLine::ImageSelectLine( QWidget *parent, const QString& text ) - : QHBox( parent ) +ImageSelectLine::ImageSelectLine( TQWidget *parent, const TQString& text ) + : TQHBox( parent ) { setSpacing( 5 ); - (void) new QLabel( text, this ); + (void) new TQLabel( text, this ); m_urlCombo = new KURLComboBox( KURLComboBox::Files, this ); - m_buttFileSelect = new QPushButton( this ); + m_buttFileSelect = new TQPushButton( this ); m_buttFileSelect->setPixmap( SmallIcon( "fileopen" ) ); m_urlCombo->setMaxItems(5); - connect( m_urlCombo, SIGNAL( urlActivated( const KURL& )), - this, SLOT( slUrlActivated( const KURL& ))); + connect( m_urlCombo, TQT_SIGNAL( urlActivated( const KURL& )), + this, TQT_SLOT( slUrlActivated( const KURL& ))); - connect( m_buttFileSelect, SIGNAL( clicked() ), - this, SLOT( slSelectFile())); + connect( m_buttFileSelect, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slSelectFile())); } void ImageSelectLine::slSelectFile() @@ -70,7 +70,7 @@ void ImageSelectLine::slSelectFile() KURL newUrl; newUrl = KFileDialog::getImageOpenURL(); - QStringList l = m_urlCombo->urls(); + TQStringList l = m_urlCombo->urls(); if( ! newUrl.isEmpty()) { @@ -97,7 +97,7 @@ void ImageSelectLine::setURL( const KURL& url ) m_currUrl = url; } -void ImageSelectLine::setURLs( const QStringList& list ) +void ImageSelectLine::setURLs( const TQStringList& list ) { if( m_urlCombo ) m_urlCombo->setURLs( list ); } diff --git a/kooka/imageselectline.h b/kooka/imageselectline.h index 991cb3fd..92cfec17 100644 --- a/kooka/imageselectline.h +++ b/kooka/imageselectline.h @@ -29,7 +29,7 @@ #ifndef __IMGSELECTLINE_H__ #define __IMGSELECTLINE_H__ -#include +#include /** * @@ -37,18 +37,18 @@ class KURL; class KURLComboBox; -class QPushButton; -class QStringList; +class TQPushButton; +class TQStringList; class ImageSelectLine:public QHBox { Q_OBJECT public: - ImageSelectLine( QWidget *parent, const QString& text ); + ImageSelectLine( TQWidget *parent, const TQString& text ); KURL selectedURL() const; void setURL( const KURL& ); - void setURLs( const QStringList& ); + void setURLs( const TQStringList& ); protected slots: void slSelectFile(); @@ -58,7 +58,7 @@ private: KURL m_currUrl; KURLComboBox *m_urlCombo; - QPushButton *m_buttFileSelect; + TQPushButton *m_buttFileSelect; }; diff --git a/kooka/img_saver.cpp b/kooka/img_saver.cpp index 1d7cf1d7..b8c789fc 100644 --- a/kooka/img_saver.cpp +++ b/kooka/img_saver.cpp @@ -45,20 +45,20 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "resource.h" #include "img_saver.h" #include "previewer.h" #include "kookaimage.h" -FormatDialog::FormatDialog( QWidget *parent, const QString&, const char *name ) +FormatDialog::FormatDialog( TQWidget *parent, const TQString&, const char *name ) :KDialogBase( parent, name, true, /* Tabbed,*/ i18n( "Kooka Save Assistant" ), Ok|Cancel, Ok ) @@ -66,17 +66,17 @@ FormatDialog::FormatDialog( QWidget *parent, const QString&, const char *name ) { buildHelp(); // readConfig(); - // QFrame *page = addPage( QString( "Save the image") ); - QFrame *page = new QFrame( this ); - page->setFrameStyle( QFrame::Box | QFrame::Sunken ); + // TQFrame *page = addPage( TQString( "Save the image") ); + TQFrame *page = new TQFrame( this ); + page->setFrameStyle( TQFrame::Box | TQFrame::Sunken ); Q_CHECK_PTR( page ); setMainWidget( page ); - QVBoxLayout *bigdad = new QVBoxLayout( page, marginHint(), spacingHint()); + TQVBoxLayout *bigdad = new TQVBoxLayout( page, marginHint(), spacingHint()); Q_CHECK_PTR(bigdad); // some nice words - QLabel *l0 = new QLabel( page ); + TQLabel *l0 = new TQLabel( page ); Q_CHECK_PTR(l0); l0->setText( i18n( "Save Assistant

Select an image format to save the scanned image." )); bigdad->addWidget( l0 ); @@ -85,55 +85,55 @@ FormatDialog::FormatDialog( QWidget *parent, const QString&, const char *name ) bigdad->addWidget( sep ); // Layout-Boxes - // QHBoxLayout *hl1= new QHBoxLayout( ); // Caption - QHBoxLayout *lhBigMiddle = new QHBoxLayout( spacingHint() ); // Big middle + // TQHBoxLayout *hl1= new TQHBoxLayout( ); // Caption + TQHBoxLayout *lhBigMiddle = new TQHBoxLayout( spacingHint() ); // Big middle Q_CHECK_PTR(lhBigMiddle); bigdad->addLayout( lhBigMiddle ); - QVBoxLayout *lvFormatSel = new QVBoxLayout( spacingHint() ); // Selection List + TQVBoxLayout *lvFormatSel = new TQVBoxLayout( spacingHint() ); // Selection List Q_CHECK_PTR(lvFormatSel); lhBigMiddle->addLayout( lvFormatSel ); // Insert Scrolled List for formats - QLabel *l1 = new QLabel( page ); + TQLabel *l1 = new TQLabel( page ); Q_CHECK_PTR(l1); l1->setText( i18n( "Available image formats:" )); - lb_format = new QListBox( page, "ListBoxFormats" ); + lb_format = new TQListBox( page, "ListBoxFormats" ); Q_CHECK_PTR(lb_format); #ifdef USE_KIMAGEIO - QStringList fo = KImageIO::types(); + TQStringList fo = KImageIO::types(); #else - QStringList fo = QImage::outputFormatList(); + TQStringList fo = TQImage::outputFormatList(); #endif kdDebug(28000) << "#### have " << fo.count() << " image types" << endl; lb_format->insertStringList( fo ); - connect( lb_format, SIGNAL( highlighted(const QString&)), - SLOT( showHelp(const QString&))); + connect( lb_format, TQT_SIGNAL( highlighted(const TQString&)), + TQT_SLOT( showHelp(const TQString&))); // Insert label for helptext - l_help = new QLabel( page ); + l_help = new TQLabel( page ); Q_CHECK_PTR(l_help); - l_help->setFrameStyle( QFrame::Panel|QFrame::Sunken ); + l_help->setFrameStyle( TQFrame::Panel|TQFrame::Sunken ); l_help->setText( i18n("-No format selected-" )); l_help->setAlignment( AlignVCenter | AlignHCenter ); l_help->setMinimumWidth(230); // Insert Selbox for subformat - l2 = new QLabel( page ); + l2 = new TQLabel( page ); Q_CHECK_PTR(l2); l2->setText( i18n( "Select the image sub-format" )); - cb_subf = new QComboBox( page, "ComboSubFormat" ); + cb_subf = new TQComboBox( page, "ComboSubFormat" ); Q_CHECK_PTR( cb_subf ); // Checkbox to store setting - cbDontAsk = new QCheckBox(i18n("Don't ask again for the save format if it is defined."), + cbDontAsk = new TQCheckBox(i18n("Don't ask again for the save format if it is defined."), page ); Q_CHECK_PTR( cbDontAsk ); - QFrame *hl = new QFrame(page); + TQFrame *hl = new TQFrame(page); Q_CHECK_PTR( hl ); - hl->setFrameStyle( QFrame::HLine|QFrame::Sunken ); + hl->setFrameStyle( TQFrame::HLine|TQFrame::Sunken ); // bigdad->addWidget( l_caption, 1 ); lvFormatSel->addWidget( l1, 1 ); @@ -150,9 +150,9 @@ FormatDialog::FormatDialog( QWidget *parent, const QString&, const char *name ) } -void FormatDialog::showHelp( const QString& item ) +void FormatDialog::showHelp( const TQString& item ) { - QString helptxt = format_help[ item ]; + TQString helptxt = format_help[ item ]; if( !helptxt.isEmpty() ) { // Set the hint @@ -165,7 +165,7 @@ void FormatDialog::showHelp( const QString& item ) } } -void FormatDialog::check_subformat( const QString & format ) +void FormatDialog::check_subformat( const TQString & format ) { // not yet implemented kdDebug(28000) << "This is format in check_subformat: " << format << endl; @@ -174,9 +174,9 @@ void FormatDialog::check_subformat( const QString & format ) l2->setEnabled( false ); } -void FormatDialog::setSelectedFormat( QString fo ) +void FormatDialog::setSelectedFormat( TQString fo ) { - QListBoxItem *item = lb_format->findItem( fo ); + TQListBoxItem *item = lb_format->findItem( fo ); if( item ) { @@ -186,20 +186,20 @@ void FormatDialog::setSelectedFormat( QString fo ) } -QString FormatDialog::getFormat( ) const +TQString FormatDialog::getFormat( ) const { int item = lb_format->currentItem(); if( item > -1 ) { - const QString f = lb_format->text( item ); + const TQString f = lb_format->text( item ); return( f ); } return( "BMP" ); } -QCString FormatDialog::getSubFormat( ) const +TQCString FormatDialog::getSubFormat( ) const { // Not yet... return( "" ); @@ -208,18 +208,18 @@ QCString FormatDialog::getSubFormat( ) const #include "formathelp.h" void FormatDialog::buildHelp( void ) { - format_help.insert( QString::fromLatin1("BMP"), HELP_BMP ); - format_help.insert( QString::fromLatin1("PNM"), HELP_PNM ); - format_help.insert( QString::fromLatin1("JPEG"), HELP_JPG ); - format_help.insert( QString::fromLatin1("JPG"), HELP_JPG ); - format_help.insert( QString::fromLatin1("EPS"), HELP_EPS ); + format_help.insert( TQString::fromLatin1("BMP"), HELP_BMP ); + format_help.insert( TQString::fromLatin1("PNM"), HELP_PNM ); + format_help.insert( TQString::fromLatin1("JPEG"), HELP_JPG ); + format_help.insert( TQString::fromLatin1("JPG"), HELP_JPG ); + format_help.insert( TQString::fromLatin1("EPS"), HELP_EPS ); } /* ********************************************************************** */ -ImgSaver::ImgSaver( QWidget *parent, const KURL dir_name ) - : QObject( parent ) +ImgSaver::ImgSaver( TQWidget *parent, const KURL dir_name ) + : TQObject( parent ) { if( dir_name.isEmpty() || dir_name.protocol() != "file" ) @@ -250,8 +250,8 @@ ImgSaver::ImgSaver( QWidget *parent, const KURL dir_name ) } -ImgSaver::ImgSaver( QWidget *parent ) - :QObject( parent ) +ImgSaver::ImgSaver( TQWidget *parent ) + :TQObject( parent ) { directory = Previewer::galleryRoot(); createDir( directory ); @@ -265,14 +265,14 @@ ImgSaver::ImgSaver( QWidget *parent ) /* Needs a full qualified directory name */ -void ImgSaver::createDir( const QString& dir ) +void ImgSaver::createDir( const TQString& dir ) { KURL url( dir ); if( ! KIO::NetAccess::exists(url, false, 0) ) { kdDebug(28000) << "Wrn: Directory <" << dir << "> does not exist -> try to create !" << endl; - // if( mkdir( QFile::encodeName( dir ), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH ) != 0 ) + // if( mkdir( TQFile::encodeName( dir ), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH ) != 0 ) if( KIO::mkdir( KURL(dir))) { KMessageBox::sorry(0, i18n("The folder\n%1\n does not exist and could not be created;\n" @@ -292,7 +292,7 @@ void ImgSaver::createDir( const QString& dir ) * This function asks the user for a filename or creates * one by itself, depending on the settings **/ -ImgSaveStat ImgSaver::saveImage( QImage *image ) +ImgSaveStat ImgSaver::saveImage( TQImage *image ) { ImgSaveStat stat; picType imgType; @@ -322,8 +322,8 @@ ImgSaveStat ImgSaver::saveImage( QImage *image ) } - QString format = findFormat( imgType ); - QString subformat = findSubFormat( format ); + TQString format = findFormat( imgType ); + TQString subformat = findSubFormat( format ); // Call save-Function with this params if( format.isEmpty() ) @@ -333,7 +333,7 @@ ImgSaveStat ImgSaver::saveImage( QImage *image ) } kdDebug(28000) << "saveImage: Directory is " << directory << endl; - QString filename = createFilename( format ); + TQString filename = createFilename( format ); KConfig *konf = KGlobal::config (); konf->setGroup( OP_FILE_GROUP ); @@ -341,7 +341,7 @@ ImgSaveStat ImgSaver::saveImage( QImage *image ) if( konf->readBoolEntry( OP_ASK_FILENAME, false ) ) { bool ok; - QString text = KInputDialog::getText( i18n( "Filename" ), i18n("Enter filename:"), + TQString text = KInputDialog::getText( i18n( "Filename" ), i18n("Enter filename:"), filename, &ok ); if(ok) @@ -350,7 +350,7 @@ ImgSaveStat ImgSaver::saveImage( QImage *image ) } } - QString fi = directory + "/" + filename; + TQString fi = directory + "/" + filename; if( extension(fi).isEmpty() ) { @@ -374,17 +374,17 @@ ImgSaveStat ImgSaver::saveImage( QImage *image ) * This is done by numbering all existing files and adding * one **/ -QString ImgSaver::createFilename( QString format ) +TQString ImgSaver::createFilename( TQString format ) { if( format.isNull() || format.isEmpty() ) return( 0 ); - QString s = "kscan_*." + format.lower(); - QDir files( directory, s ); + TQString s = "kscan_*." + format.lower(); + TQDir files( directory, s ); long c = 1; - QString num; + TQString num; num.setNum(c); - QString fname = "kscan_" + num.rightJustify(4, '0') + "." + format.lower(); + TQString fname = "kscan_" + num.rightJustify(4, '0') + "." + format.lower(); while( files.exists( fname ) ) { num.setNum(++c); @@ -397,9 +397,9 @@ QString ImgSaver::createFilename( QString format ) /** * This function gets a filename from the parent. The filename must not be relative. **/ -ImgSaveStat ImgSaver::saveImage( QImage *image, const KURL& filename, const QString& imgFormat ) +ImgSaveStat ImgSaver::saveImage( TQImage *image, const KURL& filename, const TQString& imgFormat ) { - QString format = imgFormat; + TQString format = imgFormat; /* Check if the filename is local */ if( !filename.isLocalFile()) @@ -408,7 +408,7 @@ ImgSaveStat ImgSaver::saveImage( QImage *image, const KURL& filename, const QStr return( ISS_ERR_PROTOCOL ); } - QString localFilename; + TQString localFilename; localFilename = filename.directory( false, true) + filename.fileName(); kdDebug(28000) << "saveImage: Saving "<< localFilename << " in format " << format << endl; @@ -422,9 +422,9 @@ ImgSaveStat ImgSaver::saveImage( QImage *image, const KURL& filename, const QStr /* * findFormat does all the stuff with the dialog. */ -QString ImgSaver::findFormat( picType type ) +TQString ImgSaver::findFormat( picType type ) { - QString format; + TQString format; KConfig *konf = KGlobal::config (); konf->setGroup( OP_FILE_GROUP ); @@ -478,9 +478,9 @@ QString ImgSaver::findFormat( picType type ) } -QString ImgSaver::picTypeAsString( picType type ) const +TQString ImgSaver::picTypeAsString( picType type ) const { - QString res; + TQString res; switch( type ) { @@ -504,7 +504,7 @@ QString ImgSaver::picTypeAsString( picType type ) const } -QString ImgSaver::startFormatDialog( picType type) +TQString ImgSaver::startFormatDialog( picType type) { FormatDialog fd( 0, picTypeAsString( type ), "FormatDialog" ); @@ -512,11 +512,11 @@ QString ImgSaver::startFormatDialog( picType type) // set default values if( type != PT_PREVIEW ) { - QString defFormat = getFormatForType( type ); + TQString defFormat = getFormatForType( type ); fd.setSelectedFormat( defFormat ); } - QString format; + TQString format; if( fd.exec() ) { format = fd.getFormat(); @@ -534,7 +534,7 @@ QString ImgSaver::startFormatDialog( picType type) * This method returns true if the image format given in format is remembered * for that image type. */ -bool ImgSaver::isRememberedFormat( picType type, QString format ) const +bool ImgSaver::isRememberedFormat( picType type, TQString format ) const { if( getFormatForType( type ) == format ) { @@ -550,13 +550,13 @@ bool ImgSaver::isRememberedFormat( picType type, QString format ) const -QString ImgSaver::getFormatForType( picType type ) const +TQString ImgSaver::getFormatForType( picType type ) const { KConfig *konf = KGlobal::config (); Q_CHECK_PTR( konf ); konf->setGroup( OP_FILE_GROUP ); - QString f; + TQString f; switch( type ) { @@ -580,7 +580,7 @@ QString ImgSaver::getFormatForType( picType type ) const } -void ImgSaver::storeFormatForType( picType type, QString format, bool ask ) +void ImgSaver::storeFormatForType( picType type, TQString format, bool ask ) { KConfig *konf = KGlobal::config (); Q_CHECK_PTR( konf ); @@ -611,7 +611,7 @@ void ImgSaver::storeFormatForType( picType type, QString format, bool ask ) } -QString ImgSaver::findSubFormat( QString format ) +TQString ImgSaver::findSubFormat( TQString format ) { kdDebug(28000) << "Searching Subformat for " << format << endl; return( subformat ); @@ -622,9 +622,9 @@ QString ImgSaver::findSubFormat( QString format ) private save() does the work to save the image. the filename must be complete and local. **/ -ImgSaveStat ImgSaver::save( QImage *image, const QString &filename, - const QString &format, - const QString &subformat ) +ImgSaveStat ImgSaver::save( TQImage *image, const TQString &filename, + const TQString &format, + const TQString &subformat ) { bool result = false; @@ -638,9 +638,9 @@ ImgSaveStat ImgSaver::save( QImage *image, const QString &filename, if( image ) { // remember the last processed file - only the filename - no path - QFileInfo fi( filename ); - QString dirPath = fi.dirPath(); - QDir dir = QDir( dirPath ); + TQFileInfo fi( filename ); + TQString dirPath = fi.dirPath(); + TQDir dir = TQDir( dirPath ); if( ! dir.exists() ) { @@ -696,16 +696,16 @@ void ImgSaver::readConfig( void ) konf->setGroup( OP_FILE_GROUP ); ask_for_format = konf->readBoolEntry( OP_FILE_ASK_FORMAT, true ); - QDir home = QDir::home(); + TQDir home = TQDir::home(); } -QString ImgSaver::errorString( ImgSaveStat stat ) +TQString ImgSaver::errorString( ImgSaveStat stat ) { - QString re; + TQString re; switch( stat ) { case ISS_OK: re = i18n( " image save OK " ); break; @@ -724,9 +724,9 @@ QString ImgSaver::errorString( ImgSaveStat stat ) } -QString ImgSaver::extension( const KURL& url ) +TQString ImgSaver::extension( const KURL& url ) { - QString extension = url.fileName(); + TQString extension = url.fileName(); int dotPos = extension.findRev( '.' ); if( dotPos > 0 ) @@ -737,24 +737,24 @@ QString ImgSaver::extension( const KURL& url ) else { /* No extension was supplied */ - extension = QString(); + extension = TQString(); } return extension; } -bool ImgSaver::renameImage( const KURL& fromUrl, KURL& toUrl, bool askExt, QWidget *overWidget ) +bool ImgSaver::renameImage( const KURL& fromUrl, KURL& toUrl, bool askExt, TQWidget *overWidget ) { /* Check if the provided filename has a extension */ - QString extTo = extension( toUrl ); - QString extFrom = extension( fromUrl ); + TQString extTo = extension( toUrl ); + TQString extFrom = extension( fromUrl ); KURL targetUrl( toUrl ); if( extTo.isEmpty() && !extFrom.isEmpty() ) { /* Ask if the extension should be added */ int result = KMessageBox::Yes; - QString fName = toUrl.fileName(); + TQString fName = toUrl.fileName(); if( ! fName.endsWith( "." ) ) { fName += "."; @@ -764,7 +764,7 @@ bool ImgSaver::renameImage( const KURL& fromUrl, KURL& toUrl, bool askExt, QWid if( askExt ) { - QString s; + TQString s; s = i18n("The filename you supplied has no file extension.\nShould the correct one be added automatically? "); s += i18n( "That would result in the new filename: %1" ).arg( fName); @@ -809,10 +809,10 @@ bool ImgSaver::renameImage( const KURL& fromUrl, KURL& toUrl, bool askExt, QWid } -QString ImgSaver::tempSaveImage( KookaImage *img, const QString& format, int colors ) +TQString ImgSaver::tempSaveImage( KookaImage *img, const TQString& format, int colors ) { - KTempFile *tmpFile = new KTempFile( QString(), "."+format.lower()); + KTempFile *tmpFile = new KTempFile( TQString(), "."+format.lower()); tmpFile->setAutoDelete( false ); tmpFile->close(); @@ -833,35 +833,35 @@ QString ImgSaver::tempSaveImage( KookaImage *img, const QString& format, int col } } - QString name; + TQString name; if( img ) { name = tmpFile->name(); - if( ! img->save( name, format.latin1() ) ) name = QString(); + if( ! img->save( name, format.latin1() ) ) name = TQString(); } delete tmpFile; return name; } -bool ImgSaver::copyImage( const KURL& fromUrl, const KURL& toUrl, QWidget *overWidget ) +bool ImgSaver::copyImage( const KURL& fromUrl, const KURL& toUrl, TQWidget *overWidget ) { /* Check if the provided filename has a extension */ - QString extTo = extension( toUrl ); - QString extFrom = extension( fromUrl ); + TQString extTo = extension( toUrl ); + TQString extFrom = extension( fromUrl ); KURL targetUrl( toUrl ); if( extTo.isEmpty() && !extFrom.isEmpty()) { /* Ask if the extension should be added */ int result = KMessageBox::Yes; - QString fName = toUrl.fileName(); + TQString fName = toUrl.fileName(); if( ! fName.endsWith( "." )) fName += "."; fName += extFrom; - QString s; + TQString s; s = i18n("The filename you supplied has no file extension.\nShould the correct one be added automatically? "); s += i18n( "That would result in the new filename: %1" ).arg( fName); diff --git a/kooka/img_saver.h b/kooka/img_saver.h index f9a29898..95204ad7 100644 --- a/kooka/img_saver.h +++ b/kooka/img_saver.h @@ -26,19 +26,19 @@ #ifndef __IMG_SAVER_H__ #define __IMG_SAVER_H__ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -102,36 +102,36 @@ class FormatDialog:public KDialogBase { Q_OBJECT public: - FormatDialog( QWidget *parent, const QString&, const char * ); + FormatDialog( TQWidget *parent, const TQString&, const char * ); - QString getFormat( ) const; - QCString getSubFormat( ) const; - QString errorString( ImgSaveStat stat ); + TQString getFormat( ) const; + TQCString getSubFormat( ) const; + TQString errorString( ImgSaveStat stat ); bool askForFormat( ) const { return( ! cbDontAsk->isChecked()); } public slots: - void setSelectedFormat( QString ); + void setSelectedFormat( TQString ); protected slots: - void showHelp( const QString& item ); + void showHelp( const TQString& item ); private: - void check_subformat( const QString & format ); + void check_subformat( const TQString & format ); void buildHelp( void ); void readConfig( void ); - QMap format_help; - QComboBox *cb_subf; - QListBox *lb_format; - QLabel *l_help; + TQMap format_help; + TQComboBox *cb_subf; + TQListBox *lb_format; + TQLabel *l_help; QLabel *l2; - QCheckBox *cbRemember; - QCheckBox *cbDontAsk; + TQCheckBox *cbRemember; + TQCheckBox *cbDontAsk; }; /** @@ -142,7 +142,7 @@ private: * and cares for database entries (later ;) **/ -class ImgSaver:public QObject { +class ImgSaver:public TQObject { Q_OBJECT public: /** @@ -153,56 +153,56 @@ public: * @param dir Name of the save root directory * @param name Name of a subdirectory in the saveroot. **/ - ImgSaver( QWidget *parent, const KURL ); - ImgSaver( QWidget *parent ); + ImgSaver( TQWidget *parent, const KURL ); + ImgSaver( TQWidget *parent ); - QString errorString( ImgSaveStat ); + TQString errorString( ImgSaveStat ); /** * returns the name of the last file that was saved by ImgSaver. */ - QString lastFilename() const { return( last_file ); } + TQString lastFilename() const { return( last_file ); } KURL lastFileUrl() const { return( KURL(last_file )); } /** * returns the image format of the last saved image. */ - QCString lastSaveFormat( void ) const { return( last_format ); } + TQCString lastSaveFormat( void ) const { return( last_format ); } - QString getFormatForType( picType ) const; - void storeFormatForType( picType, QString, bool ); - bool isRememberedFormat( picType type, QString format ) const; + TQString getFormatForType( picType ) const; + void storeFormatForType( picType, TQString, bool ); + bool isRememberedFormat( picType type, TQString format ) const; /* static function that exports a file */ - static bool copyImage( const KURL& fromUrl, const KURL& toUrl, QWidget *overWidget=0 ); - static bool renameImage( const KURL& fromUrl, KURL& toUrl, bool askExt=false, QWidget *overWidget=0 ); - static QString tempSaveImage( KookaImage *img, const QString& format, int colors = -1 ); + static bool copyImage( const KURL& fromUrl, const KURL& toUrl, TQWidget *overWidget=0 ); + static bool renameImage( const KURL& fromUrl, KURL& toUrl, bool askExt=false, TQWidget *overWidget=0 ); + static TQString tempSaveImage( KookaImage *img, const TQString& format, int colors = -1 ); /* static function that returns the extension of an url */ - static QString extension( const KURL& ); + static TQString extension( const KURL& ); public slots: - ImgSaveStat saveImage( QImage *image ); - ImgSaveStat saveImage( QImage *image, const KURL& filename, const QString& imgFormat ); + ImgSaveStat saveImage( TQImage *image ); + ImgSaveStat saveImage( TQImage *image, const KURL& filename, const TQString& imgFormat ); private: - QString picTypeAsString( picType type ) const; - QString findFormat( picType type ); - QString findSubFormat( QString format ); - void createDir( const QString& ); - - ImgSaveStat save( QImage *image, const QString &filename, const QString &format, - const QString &subformat ); - QString createFilename( QString format ); + TQString picTypeAsString( picType type ) const; + TQString findFormat( picType type ); + TQString findSubFormat( TQString format ); + void createDir( const TQString& ); + + ImgSaveStat save( TQImage *image, const TQString &filename, const TQString &format, + const TQString &subformat ); + TQString createFilename( TQString format ); void readConfig( void ); - QString startFormatDialog( picType ); + TQString startFormatDialog( picType ); - // QStrList all_formats; - QString directory; // dir where the image should be saved - QString last_file; - QCString subformat; - QCString last_format; + // TQStrList all_formats; + TQString directory; // dir where the image should be saved + TQString last_file; + TQCString subformat; + TQCString last_format; bool ask_for_format; - // QDict formats; + // TQDict formats; }; #endif diff --git a/kooka/imgnamecombo.cpp b/kooka/imgnamecombo.cpp index 77b59a0d..0e06646b 100644 --- a/kooka/imgnamecombo.cpp +++ b/kooka/imgnamecombo.cpp @@ -25,9 +25,9 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include @@ -38,10 +38,10 @@ #include "imgnamecombo.h" #include "img_saver.h" -ImageNameCombo::ImageNameCombo( QWidget *parent ) +ImageNameCombo::ImageNameCombo( TQWidget *parent ) : KComboBox( parent ) { - setInsertionPolicy( QComboBox::AtTop ); + setInsertionPolicy( TQComboBox::AtTop ); } ImageNameCombo::~ImageNameCombo() @@ -49,12 +49,12 @@ ImageNameCombo::~ImageNameCombo() } -void ImageNameCombo::slotPathRemove( KFileTreeBranch *branch, const QString& relPath ) +void ImageNameCombo::slotPathRemove( KFileTreeBranch *branch, const TQString& relPath ) { - QString path = branch->name() + QString::fromLatin1(" - ") + relPath; + TQString path = branch->name() + TQString::fromLatin1(" - ") + relPath; kdDebug(28000) << "ImageNameCombo: Removing " << path << endl; - QString select = currentText(); + TQString select = currentText(); if( items.contains( path )) { @@ -66,10 +66,10 @@ void ImageNameCombo::slotPathRemove( KFileTreeBranch *branch, const QString& rel rewriteList( branch, select ); } -void ImageNameCombo::rewriteList( KFileTreeBranch *branch, const QString& selText ) +void ImageNameCombo::rewriteList( KFileTreeBranch *branch, const TQString& selText ) { clear(); - for ( QStringList::Iterator it = items.begin(); it != items.end(); ++it ) + for ( TQStringList::Iterator it = items.begin(); it != items.end(); ++it ) { insertItem( branch->pixmap(), *it ); } @@ -78,11 +78,11 @@ void ImageNameCombo::rewriteList( KFileTreeBranch *branch, const QString& selTex setCurrentItem( index ); } -void ImageNameCombo::slotGalleryPathChanged( KFileTreeBranch* branch, const QString& relativPath ) +void ImageNameCombo::slotGalleryPathChanged( KFileTreeBranch* branch, const TQString& relativPath ) { - QString newPath; + TQString newPath; - newPath = branch->name() + QString::fromLatin1(" - ") + relativPath; + newPath = branch->name() + TQString::fromLatin1(" - ") + relativPath; kdDebug( 28000) << "Inserting " << newPath << " to combobox" << endl; diff --git a/kooka/imgnamecombo.h b/kooka/imgnamecombo.h index a577929e..1beb1235 100644 --- a/kooka/imgnamecombo.h +++ b/kooka/imgnamecombo.h @@ -35,23 +35,23 @@ *@author Klaas Freitag */ -class QListViewItem; +class TQListViewItem; class KFileBranch; class ImageNameCombo: public KComboBox { Q_OBJECT public: - ImageNameCombo( QWidget* ); + ImageNameCombo( TQWidget* ); ~ImageNameCombo(); public slots: - void slotGalleryPathChanged( KFileTreeBranch* branch, const QString& relativPath ); - void slotPathRemove( KFileTreeBranch *branch, const QString& relPath ); + void slotGalleryPathChanged( KFileTreeBranch* branch, const TQString& relativPath ); + void slotPathRemove( KFileTreeBranch *branch, const TQString& relPath ); private: - void rewriteList( KFileTreeBranch *, const QString& selText ); - QStringList items; + void rewriteList( KFileTreeBranch *, const TQString& selText ); + TQStringList items; }; #endif diff --git a/kooka/imgprintdialog.cpp b/kooka/imgprintdialog.cpp index f9aa3930..fa7ee620 100644 --- a/kooka/imgprintdialog.cpp +++ b/kooka/imgprintdialog.cpp @@ -29,17 +29,17 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "kookaimage.h" -#include -#include -#include -#include +#include +#include +#include +#include #include #define ID_SCREEN 0 @@ -47,55 +47,55 @@ #define ID_CUSTOM 2 #define ID_FIT_PAGE 3 -ImgPrintDialog::ImgPrintDialog( KookaImage *img, QWidget *parent, const char* name ) +ImgPrintDialog::ImgPrintDialog( KookaImage *img, TQWidget *parent, const char* name ) : KPrintDialogPage( parent, name ), m_image(img), m_ignoreSignal(false) { setTitle(i18n("Image Printing")); - QVBoxLayout *layout = new QVBoxLayout( this ); + TQVBoxLayout *layout = new TQVBoxLayout( this ); // layout->setMargin( KDialog::marginHint() ); // layout->setSpacing( KDialog::spacingHint() ); - m_scaleRadios = new QButtonGroup( 2, Qt::Vertical, i18n("Image Print Size"), this ); + m_scaleRadios = new TQButtonGroup( 2, Qt::Vertical, i18n("Image Print Size"), this ); m_scaleRadios->setRadioButtonExclusive(true); - connect( m_scaleRadios, SIGNAL(clicked(int)), SLOT(slScaleChanged(int))); + connect( m_scaleRadios, TQT_SIGNAL(clicked(int)), TQT_SLOT(slScaleChanged(int))); - m_rbScreen = new QRadioButton( i18n("Scale to same size as on screen"), + m_rbScreen = new TQRadioButton( i18n("Scale to same size as on screen"), m_scaleRadios ); - QToolTip::add( m_rbScreen, i18n("Screen scaling. That prints according to the screen resolution.")); + TQToolTip::add( m_rbScreen, i18n("Screen scaling. That prints according to the screen resolution.")); m_scaleRadios->insert( m_rbScreen, ID_SCREEN ); - m_rbOrigSize = new QRadioButton( i18n("Original size (calculate from scan resolution)"), + m_rbOrigSize = new TQRadioButton( i18n("Original size (calculate from scan resolution)"), m_scaleRadios ); - QToolTip::add( m_rbOrigSize, + TQToolTip::add( m_rbOrigSize, i18n("Calculates the print size from the scan resolution. Enter the scan resolution in the dialog field below." )); m_scaleRadios->insert( m_rbOrigSize, ID_ORIG ); - m_rbScale = new QRadioButton( i18n("Scale image to custom dimension"), m_scaleRadios ); - QToolTip::add( m_rbScale, + m_rbScale = new TQRadioButton( i18n("Scale image to custom dimension"), m_scaleRadios ); + TQToolTip::add( m_rbScale, i18n("Set the print size yourself in the dialog below. The image is centered on the paper.")); m_scaleRadios->insert( m_rbScale, ID_CUSTOM ); - m_rbFitPage = new QRadioButton( i18n("Scale image to fit to page"), m_scaleRadios ); - QToolTip::add( m_rbFitPage, i18n("Printout uses maximum space on the selected pager. Aspect ratio is maintained.")); + m_rbFitPage = new TQRadioButton( i18n("Scale image to fit to page"), m_scaleRadios ); + TQToolTip::add( m_rbFitPage, i18n("Printout uses maximum space on the selected pager. Aspect ratio is maintained.")); m_scaleRadios->insert( m_rbFitPage, ID_FIT_PAGE ); layout->addWidget( m_scaleRadios ); - QHBoxLayout *hbox = new QHBoxLayout( this ); + TQHBoxLayout *hbox = new TQHBoxLayout( this ); layout->addLayout( hbox ); /** Box for Image Resolutions **/ - QVGroupBox *group1 = new QVGroupBox( i18n("Resolutions"), this ); + TQVGroupBox *group1 = new TQVGroupBox( i18n("Resolutions"), this ); hbox->addWidget( group1 ); /* Postscript generation resolution */ - m_psDraft = new QCheckBox( i18n("Generate low resolution PostScript (fast draft print)"), + m_psDraft = new TQCheckBox( i18n("Generate low resolution PostScript (fast draft print)"), group1, "cbPostScriptRes" ); m_psDraft->setChecked( false ); @@ -107,27 +107,27 @@ ImgPrintDialog::ImgPrintDialog( KookaImage *img, QWidget *parent, const char* na m_dpi->setSuffix( i18n(" dpi")); /* Label for displaying the screen Resolution */ - m_screenRes = new QLabel( group1 ); + m_screenRes = new TQLabel( group1 ); /** Box for Image Print Size **/ - QVGroupBox *group = new QVGroupBox( i18n("Image Print Size"), this ); + TQVGroupBox *group = new TQVGroupBox( i18n("Image Print Size"), this ); hbox->addWidget( group ); m_sizeW = new KIntNumInput( group ); m_sizeW->setLabel( i18n("Image width:"), AlignVCenter ); m_sizeW->setSuffix( i18n(" mm")); - connect( m_sizeW, SIGNAL(valueChanged(int)), SLOT(slCustomWidthChanged(int))); + connect( m_sizeW, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slCustomWidthChanged(int))); m_sizeH = new KIntNumInput( m_sizeW, AlignVCenter, group ); m_sizeH->setLabel( i18n("Image height:"), AlignVCenter); m_sizeH->setSuffix( i18n(" mm")); - connect( m_sizeH, SIGNAL(valueChanged(int)), SLOT(slCustomHeightChanged(int))); + connect( m_sizeH, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slCustomHeightChanged(int))); - m_ratio = new QCheckBox( i18n("Maintain aspect ratio"), group, "cbAspectRatio" ); + m_ratio = new TQCheckBox( i18n("Maintain aspect ratio"), group, "cbAspectRatio" ); m_ratio->setChecked(true); - QWidget *spaceEater = new QWidget( this ); - spaceEater->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored )); + TQWidget *spaceEater = new TQWidget( this ); + spaceEater->setSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored )); layout->addWidget( spaceEater ); /* Set start values */ @@ -143,10 +143,10 @@ void ImgPrintDialog::setImage( KookaImage *img ) } -void ImgPrintDialog::setOptions(const QMap& opts) +void ImgPrintDialog::setOptions(const TQMap& opts) { // m_autofit->setChecked(opts["app-img-autofit"] == "1"); - QString scale = opts[OPT_SCALING]; + TQString scale = opts[OPT_SCALING]; kdDebug(28000) << "In setOption" << endl; @@ -178,12 +178,12 @@ void ImgPrintDialog::setOptions(const QMap& opts) } -void ImgPrintDialog::getOptions(QMap& opts, bool ) +void ImgPrintDialog::getOptions(TQMap& opts, bool ) { // TODO: Check for meaning of include_def ! // kdDebug(28000) << "In getOption with include_def: " << include_def << endl; - QString scale = "screen"; + TQString scale = "screen"; if( m_rbOrigSize->isChecked() ) scale = "scan"; else if( m_rbScale->isChecked() ) @@ -193,19 +193,19 @@ void ImgPrintDialog::getOptions(QMap& opts, bool ) opts[OPT_SCALING] = scale; - opts[OPT_SCAN_RES] = QString::number( m_dpi->value() ); - opts[OPT_WIDTH] = QString::number( m_sizeW->value() ); - opts[OPT_HEIGHT] = QString::number( m_sizeH->value() ); - opts[OPT_PSGEN_DRAFT] = QString::number( m_psDraft->isChecked() ); - opts[OPT_RATIO] = QString::number( m_ratio->isChecked() ); + opts[OPT_SCAN_RES] = TQString::number( m_dpi->value() ); + opts[OPT_WIDTH] = TQString::number( m_sizeW->value() ); + opts[OPT_HEIGHT] = TQString::number( m_sizeH->value() ); + opts[OPT_PSGEN_DRAFT] = TQString::number( m_psDraft->isChecked() ); + opts[OPT_RATIO] = TQString::number( m_ratio->isChecked() ); { - QPaintDeviceMetrics metric( this ); - opts[OPT_SCREEN_RES] = QString::number( metric.logicalDpiX()); + TQPaintDeviceMetrics metric( this ); + opts[OPT_SCREEN_RES] = TQString::number( metric.logicalDpiX()); } } -bool ImgPrintDialog::isValid(QString& msg) +bool ImgPrintDialog::isValid(TQString& msg) { /* check if scan reso is higher than 0 in case its needed */ int id = m_scaleRadios->id( m_scaleRadios->selected()); diff --git a/kooka/imgprintdialog.h b/kooka/imgprintdialog.h index 845cc038..f710820e 100644 --- a/kooka/imgprintdialog.h +++ b/kooka/imgprintdialog.h @@ -27,8 +27,8 @@ #ifndef __IMGPRINTDIALOG_H__ #define __IMGPRINTDIALOG_H__ -#include -#include +#include +#include #include #include "kookaimage.h" @@ -41,24 +41,24 @@ #define OPT_PSGEN_DRAFT "kde-kooka-psdraft" #define OPT_RATIO "kde-kooka-ratio" #define OPT_FITPAGE "kde-kooka-fitpage" -class QWidget; -class QString; -class QLabel; +class TQWidget; +class TQString; +class TQLabel; class KIntNumInput; class KookaImage; -class QVButtonGroup; -class QRadioButton; -class QCheckBox; +class TQVButtonGroup; +class TQRadioButton; +class TQCheckBox; class ImgPrintDialog: public KPrintDialogPage { Q_OBJECT public: - ImgPrintDialog( KookaImage *img, QWidget *parent=0L, const char* name=0L ); + ImgPrintDialog( KookaImage *img, TQWidget *parent=0L, const char* name=0L ); - void setOptions(const QMap& opts); - void getOptions(QMap& opts, bool include_def = false); - bool isValid(QString& msg); + void setOptions(const TQMap& opts); + void getOptions(TQMap& opts, bool include_def = false); + bool isValid(TQString& msg); void setImage( KookaImage *img ); @@ -68,21 +68,21 @@ protected slots: void slCustomHeightChanged(int); private: - QButtonGroup *m_scaleRadios; - QRadioButton *m_rbOrigSize; - QRadioButton *m_rbScale; - QRadioButton *m_rbScreen; - QRadioButton *m_rbFitPage; + TQButtonGroup *m_scaleRadios; + TQRadioButton *m_rbOrigSize; + TQRadioButton *m_rbScale; + TQRadioButton *m_rbScreen; + TQRadioButton *m_rbFitPage; KIntNumInput *m_sizeW; KIntNumInput *m_sizeH; KIntNumInput *m_dpi; - QCheckBox *m_psDraft; - QCheckBox *m_ratio; + TQCheckBox *m_psDraft; + TQCheckBox *m_ratio; KookaImage *m_image; - QLabel *m_screenRes; + TQLabel *m_screenRes; bool m_ignoreSignal; }; diff --git a/kooka/kadmosocr.cpp b/kooka/kadmosocr.cpp index 72f9324b..d0d41e13 100644 --- a/kooka/kadmosocr.cpp +++ b/kooka/kadmosocr.cpp @@ -32,11 +32,11 @@ /* Kadmos CPP object oriented interface */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -54,11 +54,11 @@ using namespace Kadmos; /* -------------------- CRep -------------------- */ CRep::CRep() - :QObject() + :TQObject() { memset(&m_RepData, 0, sizeof(m_RepData)); m_Error = RE_SUCCESS; - m_undetectChar = QChar('_'); + m_undetectChar = TQChar('_'); } CRep::~CRep() @@ -161,8 +161,8 @@ ocrWordList CRep::getLineWords( int line ) do { - QString resultWord; - QRect boundingRect; + TQString resultWord; + TQRect boundingRect; int newNextKnode = nextBestWord( line, nextKnode, resultWord, boundingRect ); boundingRect.moveBy( repRes->left, repRes->top ); @@ -179,7 +179,7 @@ ocrWordList CRep::getLineWords( int line ) // Alternativen: - // partStrings( line, nextKnode, QString()); // fills m_parts - list with alternative words + // partStrings( line, nextKnode, TQString()); // fills m_parts - list with alternative words // nextKnode = newNextKnode; // kdDebug(28000) << "NextKnodeWord: " << resultWord << endl; } @@ -192,7 +192,7 @@ ocrWordList CRep::getLineWords( int line ) /* This fills theWord with the next best word and returns the * next knode or 0 if there is no next node */ -int CRep::nextBestWord( int line, int knode, QString& theWord, QRect& brect ) +int CRep::nextBestWord( int line, int knode, TQString& theWord, TQRect& brect ) { Kadmos::RelGraph *relg = getGraphKnode( line, knode ); @@ -207,7 +207,7 @@ int CRep::nextBestWord( int line, int knode, QString& theWord, QRect& brect ) // kdDebug(28000) << "Leading Blanks: " << relg->leading_blanks << // " und Knode " << knode << endl; char c = relr->rec_char[0][0]; - QChar newChar = c; + TQChar newChar = c; if( c == 0 ) { kdDebug(28000) << "Undetected char found !" << endl; @@ -227,7 +227,7 @@ int CRep::nextBestWord( int line, int knode, QString& theWord, QRect& brect ) /* save the bounding rect */ // kdDebug(28000) << "LEFT: " << relr->left << " TOP: " << relr->top << endl; - QRect r( relr->left, relr->top, relr->width, relr->height ); + TQRect r( relr->left, relr->top, relr->width, relr->height ); if( brect.isNull() ) { @@ -258,13 +258,13 @@ int CRep::nextBestWord( int line, int knode, QString& theWord, QRect& brect ) -void CRep::partStrings( int line, int graphKnode, QString soFar ) +void CRep::partStrings( int line, int graphKnode, TQString soFar ) { /* The following knodes after a word break */ Kadmos::RelGraph *relg = getGraphKnode( line, graphKnode ); // kdDebug(28000) << "GraphKnode is " << graphKnode << endl; - QString theWord=""; + TQString theWord=""; for( int resNo=0; resNo < SEG_ALT; resNo++ ) { // kdDebug(28000) << "Alternative " << resNo << " is " << relg->result_number[resNo] << endl; @@ -275,7 +275,7 @@ void CRep::partStrings( int line, int graphKnode, QString soFar ) } Kadmos::RelResult *relr = getRelResult( line, relg, resNo ); - theWord = QChar(relr->rec_char[0][0]); + theWord = TQChar(relr->rec_char[0][0]); if ( !soFar.isEmpty() && relg->leading_blanks ) { @@ -288,7 +288,7 @@ void CRep::partStrings( int line, int graphKnode, QString soFar ) } else { - /* make a QString from this single char and append it. */ + /* make a TQString from this single char and append it. */ soFar += theWord; } @@ -311,19 +311,19 @@ void CRep::partStrings( int line, int graphKnode, QString soFar ) -void CRep::drawCharBox( QPixmap *pix, const QRect& r ) +void CRep::drawCharBox( TQPixmap *pix, const TQRect& r ) { - drawBox( pix, r, QColor( Qt::red )); + drawBox( pix, r, TQColor( Qt::red )); } -void CRep::drawLineBox( QPixmap* pix, const QRect& r ) +void CRep::drawLineBox( TQPixmap* pix, const TQRect& r ) { - drawBox( pix, r, QColor( Qt::blue )); + drawBox( pix, r, TQColor( Qt::blue )); } -void CRep::drawBox( QPixmap* pix, const QRect& r, const QColor& color ) +void CRep::drawBox( TQPixmap* pix, const TQRect& r, const TQColor& color ) { - QPainter p; + TQPainter p; p.begin(pix); p.setPen( color ); @@ -332,7 +332,7 @@ void CRep::drawBox( QPixmap* pix, const QRect& r, const QColor& color ) -KADMOS_ERROR CRep::SetImage( const QString file ) +KADMOS_ERROR CRep::SetImage( const TQString file ) { ReImageHandle image_handle; image_handle = re_readimage(file.latin1(), &m_RepData.image); @@ -345,7 +345,7 @@ KADMOS_ERROR CRep::SetImage( const QString file ) } -KADMOS_ERROR CRep::SetImage(QImage *Image) +KADMOS_ERROR CRep::SetImage(TQImage *Image) { // memcpy(&m_RepData.image, Image.bits(), Image.numBytes()); if( !Image ) return RE_PARAMETERERROR; @@ -411,12 +411,12 @@ void CRep::CheckError() } } -/* returns a QString containing the string describing the kadmos error */ -QString CRep::getErrorText() const +/* returns a TQString containing the string describing the kadmos error */ +TQString CRep::getErrorText() const { re_ErrorText Err; re_GetErrorText(&Err); - return QString::fromLocal8Bit( Err.text ); + return TQString::fromLocal8Bit( Err.text ); } bool CRep::kadmosError() diff --git a/kooka/kadmosocr.h b/kooka/kadmosocr.h index 12056209..cc4d225f 100644 --- a/kooka/kadmosocr.h +++ b/kooka/kadmosocr.h @@ -31,18 +31,18 @@ #ifndef __KADMOS_OCR_ #define __KADMOS_OCR_ -#include -#include +#include +#include #include "config.h" #ifdef HAVE_KADMOS /* class declarations */ -class QImage; -class QPixmap; -class QColor; -class QStringList; -class QRect; +class TQImage; +class TQPixmap; +class TQColor; +class TQStringList; +class TQRect; class ocrWord; @@ -53,7 +53,7 @@ namespace Kadmos { /* include files */ #include "kadmos.h" -#include +#include /* ---------------------------------------- REP ---------------------------------------- */ //! Maximum number of lines in a paragraph @@ -91,8 +91,8 @@ namespace Kadmos { /** @param Image is an image object */ - KADMOS_ERROR SetImage(QImage* Image); - KADMOS_ERROR SetImage( const QString ); + KADMOS_ERROR SetImage(TQImage* Image); + KADMOS_ERROR SetImage( const TQString ); int GetMaxLine(); ocrWordList getLineWords( int line ); @@ -100,7 +100,7 @@ namespace Kadmos { const char* RepTextLine(int Line, unsigned char RejectLevel=128, int RejectChar='~', long Format=TEXT_FORMAT_ANSI); - void analyseLine(int, QPixmap* ); + void analyseLine(int, TQPixmap* ); /** Enable/disable noise reduction @param TRUE(enable)/FALSE(disable) noise reduction */ @@ -112,28 +112,28 @@ namespace Kadmos { void SetScaling(bool bScaling); /* draw graphic visualiser into the pixmap pointed to */ - virtual void drawLineBox( QPixmap*, const QRect& ); - virtual void drawCharBox( QPixmap*, const QRect& ); - virtual void drawBox( QPixmap*, const QRect&, const QColor& ); + virtual void drawLineBox( TQPixmap*, const TQRect& ); + virtual void drawCharBox( TQPixmap*, const TQRect& ); + virtual void drawBox( TQPixmap*, const TQRect&, const TQColor& ); - int nextBestWord( int line, int knode, QString& theWord, QRect& brect ); + int nextBestWord( int line, int knode, TQString& theWord, TQRect& brect ); - /* Error text in QString */ - QString getErrorText() const; + /* Error text in TQString */ + TQString getErrorText() const; bool kadmosError(); private: - void partStrings( int line, int graphKnode, QString soFar ); + void partStrings( int line, int graphKnode, TQString soFar ); void CheckError(); RepData m_RepData; KADMOS_ERROR m_Error; char m_Line[2*CHAR_MAX_LEN]; int m_currLine; - QStringList m_parts; - QString m_theWord; + TQStringList m_parts; + TQString m_theWord; int m_recurse; - QChar m_undetectChar; + TQChar m_undetectChar; }; } /* End of Kadmos namespace */ diff --git a/kooka/kocrbase.cpp b/kooka/kocrbase.cpp index 889739e7..3ede6ef0 100644 --- a/kooka/kocrbase.cpp +++ b/kooka/kocrbase.cpp @@ -24,10 +24,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -40,8 +40,8 @@ #include #include #include -#include -#include +#include +#include #include "resource.h" #include "kocrbase.h" @@ -52,14 +52,14 @@ #include #include #include -#include -#include -#include -#include -#include -#include - -KOCRBase::KOCRBase( QWidget *parent, KSpellConfig *spellConfig, +#include +#include +#include +#include +#include +#include + +KOCRBase::KOCRBase( TQWidget *parent, KSpellConfig *spellConfig, KDialogBase::DialogType face ) :KDialogBase( face, i18n("Optical Character Recognition"), User2|Close|User1, User1, parent,0, false, true, @@ -86,9 +86,9 @@ KOCRBase::KOCRBase( QWidget *parent, KSpellConfig *spellConfig, m_userWantsSpellCheck = konf->readBoolEntry(CFG_WANT_KSPELL, true); /* Connect signals which disable the fields and store the configuration */ - connect( this, SIGNAL( user1Clicked()), this, SLOT( writeConfig())); - connect( this, SIGNAL( user1Clicked()), this, SLOT( startOCR() )); - connect( this, SIGNAL( user2Clicked()), this, SLOT( stopOCR() )); + connect( this, TQT_SIGNAL( user1Clicked()), this, TQT_SLOT( writeConfig())); + connect( this, TQT_SIGNAL( user1Clicked()), this, TQT_SLOT( startOCR() )); + connect( this, TQT_SIGNAL( user2Clicked()), this, TQT_SLOT( stopOCR() )); m_previewSize.setWidth(200); m_previewSize.setHeight(300); @@ -98,11 +98,11 @@ KOCRBase::KOCRBase( QWidget *parent, KSpellConfig *spellConfig, } -KAnimWidget* KOCRBase::getAnimation(QWidget *parent) +KAnimWidget* KOCRBase::getAnimation(TQWidget *parent) { if( ! m_animation ) { - m_animation = new KAnimWidget( QString("kde"), 48, parent, "ANIMATION" ); + m_animation = new KAnimWidget( TQString("kde"), 48, parent, "ANIMATION" ); } return( m_animation ); } @@ -119,24 +119,24 @@ EngineError KOCRBase::setupGui() void KOCRBase::imgIntro() { m_imgPage = addVBoxPage( i18n("Image") ); - (void) new QLabel( i18n("Image Information"), m_imgPage ); + (void) new TQLabel( i18n("Image Information"), m_imgPage ); // Caption - Label and image - m_imgHBox = new QHBox( m_imgPage ); + m_imgHBox = new TQHBox( m_imgPage ); m_imgHBox->setSpacing( KDialog::spacingHint()); - m_previewPix = new QLabel( m_imgHBox ); - m_previewPix->setPixmap(QPixmap()); + m_previewPix = new TQLabel( m_imgHBox ); + m_previewPix->setPixmap(TQPixmap()); m_previewPix->setFixedSize(m_previewSize); m_previewPix->setAlignment( Qt::AlignCenter ); - m_previewPix->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + m_previewPix->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); // m_previewPix->resize(m_previewSize); /* See introduceImage where the meta box is filled with data from the * incoming widget. */ - m_metaBox = new QVBox( m_imgHBox ); + m_metaBox = new TQVBox( m_imgHBox ); } /* @@ -148,22 +148,22 @@ void KOCRBase::ocrIntro( ) // Caption - Label and image /* labelstring */ - (void) new QLabel( i18n("Starting Optical Character Recognition with %1

"). + (void) new TQLabel( i18n("Starting Optical Character Recognition with %1

"). arg( ocrEngineName() ), m_ocrPage ); // Find the kadmos logo and display if available KStandardDirs stdDir; - QString logo = stdDir.findResource( "data", "kooka/pics/" + ocrEngineLogo() ); + TQString logo = stdDir.findResource( "data", "kooka/pics/" + ocrEngineLogo() ); kdDebug(28000)<< "Reading logo " << logo << endl; - QPixmap pix; - QWidget *pa = m_ocrPage; + TQPixmap pix; + TQWidget *pa = m_ocrPage; if( pix.load( logo )) { - QHBox *hb_cap = new QHBox( m_ocrPage ); + TQHBox *hb_cap = new TQHBox( m_ocrPage ); hb_cap->setSpacing( KDialog::spacingHint()); - QLabel *imgLab = new QLabel( hb_cap ); + TQLabel *imgLab = new TQLabel( hb_cap ); imgLab->setAlignment( Qt::AlignHCenter | Qt::AlignTop ); imgLab->setPixmap( pix ); pa = hb_cap; @@ -178,26 +178,26 @@ void KOCRBase::spellCheckIntro() m_spellchkPage = addVBoxPage( i18n("Spell-checking") ); /* Want the spell checking at all? Checkbox here */ - QGroupBox *gb1 = new QGroupBox( 1, Qt::Horizontal, i18n("OCR Post Processing"), m_spellchkPage ); - m_cbWantCheck = new QCheckBox( i18n("Enable spell-checking for validation of the OCR result"), + TQGroupBox *gb1 = new TQGroupBox( 1, Qt::Horizontal, i18n("OCR Post Processing"), m_spellchkPage ); + m_cbWantCheck = new TQCheckBox( i18n("Enable spell-checking for validation of the OCR result"), gb1 ); /* Spellcheck options */ - m_gbSpellOpts = new QGroupBox( 1, Qt::Horizontal, i18n("Spell-Check Options"), + m_gbSpellOpts = new TQGroupBox( 1, Qt::Horizontal, i18n("Spell-Check Options"), m_spellchkPage ); KSpellConfig *sCfg = new KSpellConfig( m_gbSpellOpts, "SPELLCHK", m_spellConfig, false ); /* A space eater */ - QWidget *spaceEater = new QWidget(m_spellchkPage); - spaceEater->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored )); + TQWidget *spaceEater = new TQWidget(m_spellchkPage); + spaceEater->setSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored )); /* connect toggle button */ - connect( m_cbWantCheck, SIGNAL(toggled(bool)), this, SLOT(slWantSpellcheck(bool))); + connect( m_cbWantCheck, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slWantSpellcheck(bool))); m_cbWantCheck->setChecked( m_userWantsSpellCheck ); m_gbSpellOpts->setEnabled( m_userWantsSpellCheck ); m_spellConfig = sCfg; - connect( sCfg, SIGNAL(configChanged()), - this, SLOT(slSpellConfigChanged())); + connect( sCfg, TQT_SIGNAL(configChanged()), + this, TQT_SLOT(slSpellConfigChanged())); } void KOCRBase::slSpellConfigChanged() @@ -228,12 +228,12 @@ void KOCRBase::introduceImage( KookaImage* img) { if( ! (img && img->isFileBound()) ) return; KFileMetaInfo info = img->fileMetaInfo(); - QStringList groups; + TQStringList groups; if ( info.isValid() ) groups = info.preferredGroups(); delete m_metaBox; - m_metaBox = new QVBox( m_imgHBox ); + m_metaBox = new TQVBox( m_imgHBox ); /* Start to create a preview job for the thumb */ KURL::List li(img->url()); @@ -242,50 +242,50 @@ void KOCRBase::introduceImage( KookaImage* img) if( m_job ) { - connect( m_job, SIGNAL( result( KIO::Job * )), - this, SLOT( slPreviewResult( KIO::Job * ))); - connect( m_job, SIGNAL( gotPreview( const KFileItem*, const QPixmap& )), - SLOT( slGotPreview( const KFileItem*, const QPixmap& ) )); + connect( m_job, TQT_SIGNAL( result( KIO::Job * )), + this, TQT_SLOT( slPreviewResult( KIO::Job * ))); + connect( m_job, TQT_SIGNAL( gotPreview( const KFileItem*, const TQPixmap& )), + TQT_SLOT( slGotPreview( const KFileItem*, const TQPixmap& ) )); /* KIO::Jo result is called in any way: Success, Failed, Error, * thus connecting the failed is not really necessary. */ } - for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) + for ( TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { - QString theGroup(*it); + TQString theGroup(*it); kdDebug(29000) << "handling the group " << theGroup << endl; - QStringList keys = info.group(theGroup).supportedKeys(); + TQStringList keys = info.group(theGroup).supportedKeys(); if( keys.count() > 0 ) { // info.groupInfo( theGroup )->translatedName() // FIXME: howto get the translated group name? - QLabel *lGroup = new QLabel( theGroup, m_metaBox ); - lGroup->setBackgroundColor( QColor(gray)); + TQLabel *lGroup = new TQLabel( theGroup, m_metaBox ); + lGroup->setBackgroundColor( TQColor(gray)); lGroup->setMargin( KDialog::spacingHint()); - QGrid *nGrid = new QGrid( 2, m_metaBox ); + TQGrid *nGrid = new TQGrid( 2, m_metaBox ); nGrid->setSpacing( KDialog::spacingHint()); - for ( QStringList::Iterator keyIt = keys.begin(); keyIt != keys.end(); ++keyIt ) + for ( TQStringList::Iterator keyIt = keys.begin(); keyIt != keys.end(); ++keyIt ) { KFileMetaInfoItem item = info.item(*keyIt); - QString itKey = item.translatedKey(); + TQString itKey = item.translatedKey(); if( itKey.isEmpty() ) itKey = item.key(); if( ! itKey.isEmpty() ) { - (void) new QLabel( item.translatedKey() + ": ", nGrid ); - (void) new QLabel( item.string(), nGrid ); + (void) new TQLabel( item.translatedKey() + ": ", nGrid ); + (void) new TQLabel( item.string(), nGrid ); kdDebug(29000) << "hasKey " << *keyIt << endl; } } } } - QWidget *spaceEater = new QWidget( m_metaBox ); - spaceEater->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored )); + TQWidget *spaceEater = new TQWidget( m_metaBox ); + spaceEater->setSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored )); m_metaBox->show(); } @@ -299,7 +299,7 @@ void KOCRBase::slPreviewResult(KIO::Job *job ) } } -void KOCRBase::slGotPreview( const KFileItem*, const QPixmap& newPix ) +void KOCRBase::slGotPreview( const KFileItem*, const TQPixmap& newPix ) { kdDebug(28000) << "Got the preview" << endl; m_previewPix->setPixmap(newPix); diff --git a/kooka/kocrbase.h b/kooka/kocrbase.h index 05987b1d..a2a04342 100644 --- a/kooka/kocrbase.h +++ b/kooka/kocrbase.h @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -43,19 +43,19 @@ class KookaImage; -class QHBox; -class QVBox; -class QLabel; -class QSize; +class TQHBox; +class TQVBox; +class TQLabel; +class TQSize; class KSpellConfig; -class QCheckBox; -class QGroupBox; +class TQCheckBox; +class TQGroupBox; class KOCRBase: public KDialogBase { Q_OBJECT public: - KOCRBase( QWidget *, KSpellConfig *spellConfig, + KOCRBase( TQWidget *, KSpellConfig *spellConfig, KDialogBase::DialogType face = KDialogBase::Plain ); ~KOCRBase(); @@ -64,21 +64,21 @@ public: /** * @return the name of the ocr engine */ - virtual QString ocrEngineName() const { return QString(); } + virtual TQString ocrEngineName() const { return TQString(); } /** * @return the filename (without path) of the logo of the ocr engine. * the logo needs to be installed in $KDEDIR/share/apps/kooka/pics */ - virtual QString ocrEngineLogo() const { return QString(); } + virtual TQString ocrEngineLogo() const { return TQString(); } /** * @return a description string of the ocr engine */ - virtual QString ocrEngineDesc() const { return QString(); } + virtual TQString ocrEngineDesc() const { return TQString(); } - QVBox* ocrPage() const { return m_ocrPage; } - QVBox* imagePage() const { return m_imgPage; } + TQVBox* ocrPage() const { return m_ocrPage; } + TQVBox* imagePage() const { return m_imgPage; } KSpellConfig* spellConfig() const { return m_spellConfig; } @@ -123,7 +123,7 @@ protected: protected slots: - virtual KAnimWidget* getAnimation(QWidget*); + virtual KAnimWidget* getAnimation(TQWidget*); virtual void writeConfig(); virtual void slSpellConfigChanged(); @@ -134,25 +134,25 @@ protected slots: private slots: virtual void slPreviewResult( KIO::Job* ); - virtual void slGotPreview( const KFileItem*, const QPixmap& ); + virtual void slGotPreview( const KFileItem*, const TQPixmap& ); private: KAnimWidget *m_animation; - QVBox *m_ocrPage; - QVBox *m_imgPage; - QVBox *m_spellchkPage; - QVBox *m_metaBox; - QHBox *m_imgHBox; - QLabel *m_previewPix; + TQVBox *m_ocrPage; + TQVBox *m_imgPage; + TQVBox *m_spellchkPage; + TQVBox *m_metaBox; + TQHBox *m_imgHBox; + TQLabel *m_previewPix; KookaImage *m_currImg; KSpellConfig *m_spellConfig; bool m_wantSpellCfg; /* show the spellcheck options? */ bool m_userWantsSpellCheck; /* user has enabled/disabled spellcheck */ - QSize m_previewSize; + TQSize m_previewSize; - QCheckBox *m_cbWantCheck; - QGroupBox *m_gbSpellOpts; + TQCheckBox *m_cbWantCheck; + TQGroupBox *m_gbSpellOpts; }; #endif diff --git a/kooka/kocrgocr.cpp b/kooka/kocrgocr.cpp index cfc4c92c..aa6eb333 100644 --- a/kooka/kocrgocr.cpp +++ b/kooka/kocrgocr.cpp @@ -26,10 +26,10 @@ /* $Id$ */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -47,8 +47,8 @@ #include #include "kookaimage.h" #include "kookapref.h" -#include -#include +#include +#include /* defines for konfig-reading */ @@ -58,25 +58,25 @@ -KGOCRDialog::KGOCRDialog( QWidget *parent, KSpellConfig *spellConfig ) +KGOCRDialog::KGOCRDialog( TQWidget *parent, KSpellConfig *spellConfig ) :KOCRBase( parent, spellConfig, KDialogBase::Tabbed ), - m_ocrCmd( QString()) + m_ocrCmd( TQString()) { kdDebug(28000) << "Starting KOCR-Start-Dialog!" << endl; // Layout-Boxes } -QString KGOCRDialog::ocrEngineLogo() const +TQString KGOCRDialog::ocrEngineLogo() const { return "gocr.png"; } -QString KGOCRDialog::ocrEngineName() const +TQString KGOCRDialog::ocrEngineName() const { return i18n("GOCR" ); } -QString KGOCRDialog::ocrEngineDesc() const +TQString KGOCRDialog::ocrEngineDesc() const { return i18n("GOCR is an Open Source project " "for optical character recognition.

" @@ -90,7 +90,7 @@ EngineError KGOCRDialog::setupGui() { KOCRBase::setupGui(); - QVBox *page = ocrPage(); + TQVBox *page = ocrPage(); Q_CHECK_PTR( page ); KConfig *conf = KGlobal::config (); @@ -100,7 +100,7 @@ EngineError KGOCRDialog::setupGui() // (void) new KSeparator( KSeparator::HLine, page); // Entry-Field. - QString res = conf->readPathEntry( CFG_GOCR_BINARY, "notFound" ); + TQString res = conf->readPathEntry( CFG_GOCR_BINARY, "notFound" ); if( res == "notFound" ) { res = KookaPreferences::tryFindGocr(); @@ -118,12 +118,12 @@ EngineError KGOCRDialog::setupGui() else m_ocrCmd = res; - (void) new QLabel( i18n("Using GOCR binary: ") + res, page ); + (void) new TQLabel( i18n("Using GOCR binary: ") + res, page ); (void) new KSeparator( KSeparator::HLine, page); - QHBox *hb = new QHBox(page); + TQHBox *hb = new TQHBox(page); hb->setSpacing( KDialog::spacingHint()); - QVBox *innerBox = new QVBox( hb ); + TQVBox *innerBox = new TQVBox( hb ); innerBox->setSpacing( KDialog::spacingHint()); /* This is for a 'work-in-progress'-Animation */ getAnimation(hb); @@ -132,19 +132,19 @@ EngineError KGOCRDialog::setupGui() sliderGrayLevel = new KScanSlider( innerBox , i18n("&Gray level"), 0, 254, true, 160 ); int numdefault = conf->readNumEntry( CFG_GOCR_GRAYLEVEL, 160 ); sliderGrayLevel->slSetSlider( numdefault ); - QToolTip::add( sliderGrayLevel, + TQToolTip::add( sliderGrayLevel, i18n( "The numeric value gray pixels are \nconsidered to be black.\n\nDefault is 160")); sliderDustSize = new KScanSlider( innerBox, i18n("&Dust size" ), 0, 60, true, 10 ); numdefault = conf->readNumEntry( CFG_GOCR_DUSTSIZE, 10 ); sliderDustSize->slSetSlider( numdefault ); - QToolTip::add( sliderDustSize, + TQToolTip::add( sliderDustSize, i18n( "Clusters smaller than this value\nwill be considered to be dust and \nremoved from the image.\n\nDefault is 10")); sliderSpace = new KScanSlider( innerBox, i18n( "&Space width" ), 0, 60, true, 0 ); numdefault = conf->readNumEntry( CFG_GOCR_SPACEWIDTH, 0 ); sliderSpace->slSetSlider( numdefault ); - QToolTip::add( sliderSpace, i18n("Spacing between characters.\n\nDefault is 0 what means autodetection")); + TQToolTip::add( sliderSpace, i18n("Spacing between characters.\n\nDefault is 0 what means autodetection")); return ENG_OK; } @@ -182,7 +182,7 @@ void KGOCRDialog::writeConfig( void ) KConfig *conf = KGlobal::config (); conf->setGroup( CFG_GROUP_OCR_DIA ); - conf->writeEntry( CFG_GOCR_BINARY, QString(getOCRCmd())); + conf->writeEntry( CFG_GOCR_BINARY, TQString(getOCRCmd())); conf->writeEntry( CFG_GOCR_GRAYLEVEL, getGraylevel()); conf->writeEntry( CFG_GOCR_DUSTSIZE, getDustsize()); conf->writeEntry( CFG_GOCR_SPACEWIDTH, getSpaceWidth()); diff --git a/kooka/kocrgocr.h b/kooka/kocrgocr.h index 619cfedd..f17cdd0a 100644 --- a/kooka/kocrgocr.h +++ b/kooka/kocrgocr.h @@ -29,8 +29,8 @@ #define KOCRGOCR_H #include -#include -#include +#include +#include #include #include @@ -46,10 +46,10 @@ class KGOCRDialog: public KOCRBase { Q_OBJECT public: - KGOCRDialog( QWidget*, KSpellConfig* ); + KGOCRDialog( TQWidget*, KSpellConfig* ); ~KGOCRDialog(); - QString getOCRCmd( void ) const + TQString getOCRCmd( void ) const { return m_ocrCmd;} int getGraylevel( void ) const @@ -61,9 +61,9 @@ public: EngineError setupGui(); - QString ocrEngineName() const; - QString ocrEngineDesc() const; - QString ocrEngineLogo() const; + TQString ocrEngineName() const; + TQString ocrEngineDesc() const; + TQString ocrEngineLogo() const; public slots: void enableFields(bool); @@ -80,7 +80,7 @@ private: KScanSlider *sliderDustSize; KScanSlider *sliderSpace; - QString m_ocrCmd; + TQString m_ocrCmd; }; #endif diff --git a/kooka/kocrkadmos.cpp b/kooka/kocrkadmos.cpp index b4d58244..6ac6fb12 100644 --- a/kooka/kocrkadmos.cpp +++ b/kooka/kocrkadmos.cpp @@ -24,16 +24,16 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -50,9 +50,9 @@ #include "kocrkadmos.moc" #include -#include +#include #include -#include +#include /* defines for konfig-reading */ @@ -64,7 +64,7 @@ #define CNTRY_CZ i18n( "Czech Republic, Slovakia") #define CNTRY_GB i18n( "Great Britain, USA" ) -KadmosDialog::KadmosDialog( QWidget *parent, KSpellConfig *spellConfig ) +KadmosDialog::KadmosDialog( TQWidget *parent, KSpellConfig *spellConfig ) :KOCRBase( parent, spellConfig, KDialogBase::Tabbed ), m_cbNoise(0), m_cbAutoscale(0), @@ -75,17 +75,17 @@ KadmosDialog::KadmosDialog( QWidget *parent, KSpellConfig *spellConfig ) findClassifiers(); } -QString KadmosDialog::ocrEngineLogo() const +TQString KadmosDialog::ocrEngineLogo() const { return "kadmoslogo.png"; } -QString KadmosDialog::ocrEngineName() const +TQString KadmosDialog::ocrEngineName() const { return i18n("KADMOS OCR/ICR"); } -QString KadmosDialog::ocrEngineDesc() const +TQString KadmosDialog::ocrEngineDesc() const { return i18n("This version of Kooka was linked with the KADMOS OCR/ICR engine, a " "commercial engine for optical character recognition.

" @@ -101,8 +101,8 @@ EngineError KadmosDialog::findClassifiers() findClassifierPath(); KLocale *locale = KGlobal::locale(); - QStringList allCountries = locale->allLanguagesTwoAlpha (); - for ( QStringList::Iterator it = allCountries.begin(); + TQStringList allCountries = locale->allLanguagesTwoAlpha (); + for ( TQStringList::Iterator it = allCountries.begin(); it != allCountries.end(); ++it ) { m_longCountry2short[locale->twoAlphaToCountryName(*it)] = *it; @@ -111,30 +111,30 @@ EngineError KadmosDialog::findClassifiers() m_longCountry2short[ CNTRY_CZ ] = "cz"; m_longCountry2short[ CNTRY_GB ] = "us"; - QStringList lst; + TQStringList lst; /* custom Path */ if( ! m_customClassifierPath.isEmpty() ) { - QDir dir( m_customClassifierPath ); + TQDir dir( m_customClassifierPath ); - QStringList lst1 = dir.entryList( "ttf*.rec" ); + TQStringList lst1 = dir.entryList( "ttf*.rec" ); - for ( QStringList::Iterator it = lst1.begin(); it != lst1.end(); ++it ) + for ( TQStringList::Iterator it = lst1.begin(); it != lst1.end(); ++it ) { lst << m_customClassifierPath + *it; } lst1 = dir.entryList( "hand*.rec" ); - for ( QStringList::Iterator it = lst1.begin(); it != lst1.end(); ++it ) + for ( TQStringList::Iterator it = lst1.begin(); it != lst1.end(); ++it ) { lst << m_customClassifierPath + *it; } lst1 = dir.entryList( "norm*.rec" ); - for ( QStringList::Iterator it = lst1.begin(); it != lst1.end(); ++it ) + for ( TQStringList::Iterator it = lst1.begin(); it != lst1.end(); ++it ) { lst << m_customClassifierPath + *it; } @@ -153,19 +153,19 @@ EngineError KadmosDialog::findClassifiers() /* no go through lst and sort out hand-, ttf- and norm classifier */ - for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { - QFileInfo fi( *it); - QString name = fi.fileName().lower(); + TQFileInfo fi( *it); + TQString name = fi.fileName().lower(); kdDebug(28000) << "Checking file " << *it << endl; if( name.startsWith( "ttf" ) ) { - QString lang = name.mid(3,2); + TQString lang = name.mid(3,2); if( allCountries.contains(lang) ) { - QString lngCountry = locale->twoAlphaToCountryName(lang); + TQString lngCountry = locale->twoAlphaToCountryName(lang); if( lngCountry.isEmpty() ) lngCountry = name; m_ttfClassifier << lngCountry; @@ -187,10 +187,10 @@ EngineError KadmosDialog::findClassifiers() } else if( name.startsWith( "hand" ) ) { - QString lang = name.mid(4,2); + TQString lang = name.mid(4,2); if( allCountries.contains(lang) ) { - QString lngCountry = locale->twoAlphaToCountryName(lang); + TQString lngCountry = locale->twoAlphaToCountryName(lang); if( lngCountry.isEmpty() ) lngCountry = name; m_handClassifier << lngCountry; @@ -269,43 +269,43 @@ EngineError KadmosDialog::setupGui() // setupClassification( addVBoxPage( i18n("Classification"))); /* continue page setup on the first page */ - QVBox *page = ocrPage(); + TQVBox *page = ocrPage(); // Horizontal line (void) new KSeparator( KSeparator::HLine, page); // FIXME: dynamic classifier reading. - (void) new QLabel( i18n("Please classify the font type and language of the text on the image:"), + (void) new TQLabel( i18n("Please classify the font type and language of the text on the image:"), page ); - QHBox *locBox = new QHBox( page ); - m_bbFont = new QButtonGroup(1, Qt::Horizontal, i18n("Font Type Selection"), locBox); + TQHBox *locBox = new TQHBox( page ); + m_bbFont = new TQButtonGroup(1, Qt::Horizontal, i18n("Font Type Selection"), locBox); - m_rbMachine = new QRadioButton( i18n("Machine print"), m_bbFont ); - m_rbHand = new QRadioButton( i18n("Hand writing"), m_bbFont ); - m_rbNorm = new QRadioButton( i18n("Norm font"), m_bbFont ); + m_rbMachine = new TQRadioButton( i18n("Machine print"), m_bbFont ); + m_rbHand = new TQRadioButton( i18n("Hand writing"), m_bbFont ); + m_rbNorm = new TQRadioButton( i18n("Norm font"), m_bbFont ); - m_gbLang = new QGroupBox(1, Qt::Horizontal, i18n("Country"), locBox); + m_gbLang = new TQGroupBox(1, Qt::Horizontal, i18n("Country"), locBox); - m_cbLang = new QComboBox( m_gbLang ); + m_cbLang = new TQComboBox( m_gbLang ); m_cbLang->setCurrentText( KLocale::defaultCountry() ); - connect( m_bbFont, SIGNAL(clicked(int)), this, SLOT(slFontChanged(int) )); + connect( m_bbFont, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(slFontChanged(int) )); m_rbMachine->setChecked(true); /* --- */ - QHBox *innerBox = new QHBox( page ); + TQHBox *innerBox = new TQHBox( page ); innerBox->setSpacing( KDialog::spacingHint()); - QButtonGroup *cbGroup = new QButtonGroup( 1, Qt::Horizontal, i18n("OCR Modifier"), innerBox ); + TQButtonGroup *cbGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n("OCR Modifier"), innerBox ); Q_CHECK_PTR(cbGroup); - m_cbNoise = new QCheckBox( i18n( "Enable automatic noise reduction" ), cbGroup ); - m_cbAutoscale = new QCheckBox( i18n( "Enable automatic scaling"), cbGroup ); + m_cbNoise = new TQCheckBox( i18n( "Enable automatic noise reduction" ), cbGroup ); + m_cbAutoscale = new TQCheckBox( i18n( "Enable automatic scaling"), cbGroup ); getAnimation(innerBox); - // (void) new QWidget ( page ); + // (void) new TQWidget ( page ); if( err != ENG_OK ) { @@ -366,17 +366,17 @@ void KadmosDialog::slFontChanged( int id ) } -void KadmosDialog::setupPreprocessing( QVBox* ) +void KadmosDialog::setupPreprocessing( TQVBox* ) { } -void KadmosDialog::setupSegmentation( QVBox* ) +void KadmosDialog::setupSegmentation( TQVBox* ) { } -void KadmosDialog::setupClassification( QVBox* ) +void KadmosDialog::setupClassification( TQVBox* ) { } @@ -386,19 +386,19 @@ void KadmosDialog::setupClassification( QVBox* ) * was one found. */ -bool KadmosDialog::getSelClassifier( QString& path ) const +bool KadmosDialog::getSelClassifier( TQString& path ) const { - QString classifier = getSelClassifierName(); + TQString classifier = getSelClassifierName(); - QString cmplPath; + TQString cmplPath; /* * Search the complete path for the classifier file name * returned from the getSelClassifierName method */ - for ( QStringList::ConstIterator it = m_classifierPath.begin(); + for ( TQStringList::ConstIterator it = m_classifierPath.begin(); it != m_classifierPath.end(); ++it ) { - QFileInfo fi( *it ); + TQFileInfo fi( *it ); if( fi.fileName() == classifier ) { cmplPath = *it; @@ -417,7 +417,7 @@ bool KadmosDialog::getSelClassifier( QString& path ) const else { /* Check if the classifier exists on the HD. If not, return an empty string */ - QFileInfo fi(cmplPath); + TQFileInfo fi(cmplPath); if( res && ! fi.exists() ) { @@ -439,11 +439,11 @@ bool KadmosDialog::getSelClassifier( QString& path ) const return res; } -QString KadmosDialog::getSelClassifierName() const +TQString KadmosDialog::getSelClassifierName() const { - QButton *butt = m_bbFont->selected(); + TQButton *butt = m_bbFont->selected(); - QString fType, rType; + TQString fType, rType; if( butt ) { @@ -459,11 +459,11 @@ QString KadmosDialog::getSelClassifierName() const } /* Get the long text from the combo box */ - QString selLang = m_cbLang->currentText(); - QString trans; + TQString selLang = m_cbLang->currentText(); + TQString trans; if( fType != "norm" && m_longCountry2short.contains( selLang )) { - QString langType = m_longCountry2short[selLang]; + TQString langType = m_longCountry2short[selLang]; trans = fType+langType+".rec"; } else diff --git a/kooka/kocrkadmos.h b/kooka/kocrkadmos.h index 38247cc9..567af55b 100644 --- a/kooka/kocrkadmos.h +++ b/kooka/kocrkadmos.h @@ -29,7 +29,7 @@ #define KOCRKADMOS_H #include -#include +#include #include "kocrbase.h" /** @@ -39,27 +39,27 @@ class KScanCombo; -class QWidget; -class QButtonGroup; +class TQWidget; +class TQButtonGroup; class KConfig; -class QCheckBox; +class TQCheckBox; class KSpellConfig; -class QRadioButton; +class TQRadioButton; class KadmosClassifier /* Not yet used FIXME */ { public: - KadmosClassifier( QString lang, QString filename ); - QString getCmplFilename() const { return path+filename; } - QString getFilename() const { return filename; } - QString language() const { return languagesName; } + KadmosClassifier( TQString lang, TQString filename ); + TQString getCmplFilename() const { return path+filename; } + TQString getFilename() const { return filename; } + TQString language() const { return languagesName; } - void setPath( const QString& p ) { path=p; } + void setPath( const TQString& p ) { path=p; } private: - QString filename; - QString path; - QString languagesName; + TQString filename; + TQString path; + TQString languagesName; }; @@ -67,20 +67,20 @@ class KadmosDialog: public KOCRBase { Q_OBJECT public: - KadmosDialog( QWidget *, KSpellConfig *spellConfig ); + KadmosDialog( TQWidget *, KSpellConfig *spellConfig ); ~KadmosDialog(); - typedef QMap StrMap; + typedef TQMap StrMap; EngineError setupGui(); bool getAutoScale(); bool getNoiseReduction(); - bool getSelClassifier(QString&) const; - QString getSelClassifierName() const; + bool getSelClassifier(TQString&) const; + TQString getSelClassifierName() const; - QString ocrEngineName() const; - QString ocrEngineDesc() const; - QString ocrEngineLogo() const; + TQString ocrEngineName() const; + TQString ocrEngineDesc() const; + TQString ocrEngineLogo() const; public slots: void enableFields(bool); @@ -88,9 +88,9 @@ public slots: protected: void writeConfig(); - void setupPreprocessing( QVBox *box ); - void setupSegmentation( QVBox *box ); - void setupClassification( QVBox *box ); + void setupPreprocessing( TQVBox *box ); + void setupSegmentation( TQVBox *box ); + void setupClassification( TQVBox *box ); EngineError findClassifiers(); EngineError findClassifierPath(); @@ -101,27 +101,27 @@ private slots: private: StrMap m_classifierTranslate; - QCheckBox *m_cbNoise; - QCheckBox *m_cbAutoscale; - QString m_customClassifierPath; + TQCheckBox *m_cbNoise; + TQCheckBox *m_cbAutoscale; + TQString m_customClassifierPath; QButtonGroup *m_bbFont; - QRadioButton *m_rbMachine; - QRadioButton *m_rbHand; - QRadioButton *m_rbNorm; + TQRadioButton *m_rbMachine; + TQRadioButton *m_rbHand; + TQRadioButton *m_rbNorm; - QGroupBox *m_gbLang; + TQGroupBox *m_gbLang; - QComboBox *m_cbLang; + TQComboBox *m_cbLang; - QStringList m_ttfClassifier; - QStringList m_handClassifier; - QStringList m_classifierPath; + TQStringList m_ttfClassifier; + TQStringList m_handClassifier; + TQStringList m_classifierPath; bool m_haveNorm; - typedef QMap StringMap; + typedef TQMap StringMap; StringMap m_longCountry2short; }; diff --git a/kooka/kocrocrad.cpp b/kooka/kocrocrad.cpp index 1ce94f65..aab63405 100644 --- a/kooka/kocrocrad.cpp +++ b/kooka/kocrocrad.cpp @@ -26,11 +26,11 @@ /* $Id$ */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -48,15 +48,15 @@ #include #include "kookaimage.h" #include "kookapref.h" -#include -#include -#include +#include +#include +#include -ocradDialog::ocradDialog( QWidget *parent, KSpellConfig *spellConfig ) +ocradDialog::ocradDialog( TQWidget *parent, KSpellConfig *spellConfig ) :KOCRBase( parent, spellConfig, KDialogBase::Tabbed ), - m_ocrCmd( QString()), + m_ocrCmd( TQString()), m_orfUrlRequester(0L), m_layoutMode(0), m_binaryLabel(0), @@ -67,17 +67,17 @@ ocradDialog::ocradDialog( QWidget *parent, KSpellConfig *spellConfig ) // Layout-Boxes } -QString ocradDialog::ocrEngineLogo() const +TQString ocradDialog::ocrEngineLogo() const { return "ocrad.png"; } -QString ocradDialog::ocrEngineName() const +TQString ocradDialog::ocrEngineName() const { return i18n("ocrad" ); } -QString ocradDialog::ocrEngineDesc() const +TQString ocradDialog::ocrEngineDesc() const { return i18n("ocrad is a Free Software project " "for optical character recognition.

" @@ -101,7 +101,7 @@ EngineError ocradDialog::setupGui() { KOCRBase::setupGui(); - QVBox *page = ocrPage(); + TQVBox *page = ocrPage(); Q_CHECK_PTR( page ); KConfig *conf = KGlobal::config (); @@ -111,7 +111,7 @@ EngineError ocradDialog::setupGui() // (void) new KSeparator( KSeparator::HLine, page); // Entry-Field. - QString res = conf->readPathEntry( CFG_OCRAD_BINARY, "notFound" ); + TQString res = conf->readPathEntry( CFG_OCRAD_BINARY, "notFound" ); if( res == "notFound" ) { res = KookaPreferences::tryFindBinary("ocrad", CFG_OCRAD_BINARY); @@ -135,10 +135,10 @@ EngineError ocradDialog::setupGui() kdDebug(28000) << "Layout detection from config: " << layoutDetect << endl; (void) new KSeparator( KSeparator::HLine, page); - QHBox *hb1 = new QHBox(page); + TQHBox *hb1 = new TQHBox(page); hb1->setSpacing( KDialog::spacingHint() ); - (void) new QLabel( i18n("OCRAD layout analysis mode: "), hb1); - m_layoutMode = new QComboBox(hb1); + (void) new TQLabel( i18n("OCRAD layout analysis mode: "), hb1); + m_layoutMode = new TQComboBox(hb1); m_layoutMode->insertItem(i18n("No Layout Detection"), 0 ); m_layoutMode->insertItem(i18n("Column Detection"), 1 ); m_layoutMode->insertItem(i18n("Full Layout Detection"), 2); @@ -146,10 +146,10 @@ EngineError ocradDialog::setupGui() /** stating the ocrad binary **/ (void) new KSeparator( KSeparator::HLine, page); - QHBox *hb = new QHBox(page); + TQHBox *hb = new TQHBox(page); hb->setSpacing( KDialog::spacingHint()); - m_binaryLabel = new QLabel( i18n("Using ocrad binary: ") + res, hb ); + m_binaryLabel = new TQLabel( i18n("Using ocrad binary: ") + res, hb ); // retrieve Program version and display version(res); @@ -180,7 +180,7 @@ void ocradDialog::writeConfig( void ) KConfig *conf = KGlobal::config (); conf->setGroup( CFG_GROUP_OCR_DIA ); - conf->writeEntry( CFG_OCRAD_BINARY, QString(getOCRCmd())); + conf->writeEntry( CFG_OCRAD_BINARY, TQString(getOCRCmd())); conf->setGroup( CFG_GROUP_OCRAD ); conf->writeEntry( CFG_OCRAD_LAYOUT_DETECTION, m_layoutMode->currentItem()); @@ -195,15 +195,15 @@ void ocradDialog::enableFields(bool ) /* Later: Allow interactive loading of orf files * for now, return emty string */ -QString ocradDialog::orfUrl() const +TQString ocradDialog::orfUrl() const { if( m_orfUrlRequester ) return m_orfUrlRequester->url(); else - return QString(); + return TQString(); } -void ocradDialog::version( const QString& exe ) +void ocradDialog::version( const TQString& exe ) { if( m_proc ) delete m_proc; @@ -211,10 +211,10 @@ void ocradDialog::version( const QString& exe ) kdDebug(28000) << "Using " << exe << " as command" << endl; *m_proc << exe; - *m_proc << QString("-V"); + *m_proc << TQString("-V"); - connect( m_proc, SIGNAL(receivedStdout(KProcess *, char *, int )), - this, SLOT(slReceiveStdIn(KProcess *, char *, int ))); + connect( m_proc, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )), + this, TQT_SLOT(slReceiveStdIn(KProcess *, char *, int ))); if( ! m_proc->start( KProcess::NotifyOnExit, KProcess::Stdout ) ) { @@ -224,19 +224,19 @@ void ocradDialog::version( const QString& exe ) void ocradDialog::slReceiveStdIn( KProcess*, char *buffer, int buflen) { - QString vstr = QString::fromUtf8(buffer, buflen); + TQString vstr = TQString::fromUtf8(buffer, buflen); kdDebug(28000) << "Got input: "<< buffer << endl; - QRegExp rx; + TQRegExp rx; rx.setPattern("GNU Ocrad version ([\\d\\.]+)"); if( rx.search( vstr ) > -1 ) { - QString vStr = rx.cap(1); + TQString vStr = rx.cap(1); vStr.remove(0,2); m_version = vStr.toInt(); - QString v = i18n("Version: ") + rx.cap(1); + TQString v = i18n("Version: ") + rx.cap(1); if( m_binaryLabel ) { diff --git a/kooka/kocrocrad.h b/kooka/kocrocrad.h index d268f403..828aceed 100644 --- a/kooka/kocrocrad.h +++ b/kooka/kocrocrad.h @@ -29,8 +29,8 @@ #define KOCROCRAD_H #include -#include -#include +#include +#include #include #include @@ -49,26 +49,26 @@ class KSpellConfig; class KURLRequester; class KProcess; -class QLabel; -class QComboBox; +class TQLabel; +class TQComboBox; class ocradDialog: public KOCRBase { Q_OBJECT public: - ocradDialog( QWidget*, KSpellConfig* ); + ocradDialog( TQWidget*, KSpellConfig* ); ~ocradDialog(); - QString getOCRCmd( void ) const + TQString getOCRCmd( void ) const { return m_ocrCmd;} EngineError setupGui(); - QString ocrEngineName() const; - QString ocrEngineDesc() const; - QString ocrEngineLogo() const; + TQString ocrEngineName() const; + TQString ocrEngineDesc() const; + TQString ocrEngineLogo() const; - QString orfUrl() const; + TQString orfUrl() const; int layoutDetectionMode() const; @@ -88,17 +88,17 @@ protected: private: - void version( const QString& exe ); + void version( const TQString& exe ); private slots: void slReceiveStdIn( KProcess *proc, char *buffer, int buflen); private: - QString m_ocrCmd; + TQString m_ocrCmd; KURLRequester *m_orfUrlRequester; - QComboBox *m_layoutMode; - QLabel *m_binaryLabel; + TQComboBox *m_layoutMode; + TQLabel *m_binaryLabel; KProcess *m_proc; int m_version; }; diff --git a/kooka/kooka.cpp b/kooka/kooka.cpp index 3e3d660d..aea6c2d8 100644 --- a/kooka/kooka.cpp +++ b/kooka/kooka.cpp @@ -30,11 +30,11 @@ #include "kookapref.h" #include "imgprintdialog.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include @@ -57,13 +57,13 @@ #include #include #include -#include +#include #include #define DOCK_SIZES "DockSizes" -Kooka::Kooka( const QCString& deviceToUse) +Kooka::Kooka( const TQCString& deviceToUse) : KParts::DockMainWindow( 0, "Kooka" ), m_printer(0), m_prefDialogIndex(0) @@ -83,20 +83,20 @@ Kooka::Kooka( const QCString& deviceToUse) createGUI(0L); // m_view->ocrResultPart()); // and a status bar - statusBar()->insertItem( QString(), KookaView::StatusTemp ); + statusBar()->insertItem( TQString(), KookaView::StatusTemp ); statusBar()->show(); // allow the view to change the statusbar and caption - connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), - this, SLOT(changeStatusbar(const QString&))); - connect(m_view, SIGNAL(signalCleanStatusbar(void)), - this, SLOT(cleanStatusbar())); - connect(m_view, SIGNAL(signalChangeCaption(const QString&)), - this, SLOT(changeCaption(const QString&))); + connect(m_view, TQT_SIGNAL(signalChangeStatusbar(const TQString&)), + this, TQT_SLOT(changeStatusbar(const TQString&))); + connect(m_view, TQT_SIGNAL(signalCleanStatusbar(void)), + this, TQT_SLOT(cleanStatusbar())); + connect(m_view, TQT_SIGNAL(signalChangeCaption(const TQString&)), + this, TQT_SLOT(changeCaption(const TQString&))); changeCaption( i18n( "KDE Scanning" )); - setAutoSaveSettings( QString::fromLatin1("General Options"), + setAutoSaveSettings( TQString::fromLatin1("General Options"), true ); } @@ -125,47 +125,47 @@ void Kooka::startup( void ) void Kooka::setupActions() { - KStdAction::print(this, SLOT(filePrint()), actionCollection()); - KStdAction::quit(this , SLOT(close()), actionCollection()); + KStdAction::print(this, TQT_SLOT(filePrint()), actionCollection()); + KStdAction::quit(this , TQT_SLOT(close()), actionCollection()); - KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), + KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection()); - KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), + KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()), actionCollection()); - KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(optionsPreferences()), actionCollection()); m_view->createDockMenu(actionCollection(), this, "settings_show_docks" ); /* Image Viewer action Toolbar - OCR, Scaling etc. */ (void) new KAction(i18n("&OCR Image..."), "ocr", CTRL+Key_O, - m_view, SLOT(doOCR()), + m_view, TQT_SLOT(doOCR()), actionCollection(), "ocrImage" ); (void) new KAction(i18n("O&CR on Selection..."), "ocr-select", CTRL+Key_C, - m_view, SLOT(doOCRonSelection()), + m_view, TQT_SLOT(doOCRonSelection()), actionCollection(), "ocrImageSelect" ); KAction *act; act = new KAction(i18n("Scale to W&idth"), "scaletowidth", CTRL+Key_I, - m_view, SLOT( slIVScaleToWidth()), + m_view, TQT_SLOT( slIVScaleToWidth()), actionCollection(), "scaleToWidth" ); m_view->connectViewerAction( act ); act = new KAction(i18n("Scale to &Height"), "scaletoheight", CTRL+Key_H, - m_view, SLOT( slIVScaleToHeight()), + m_view, TQT_SLOT( slIVScaleToHeight()), actionCollection(), "scaleToHeight" ); m_view->connectViewerAction( act ); act = new KAction(i18n("Original &Size"), "scaleorig", CTRL+Key_S, - m_view, SLOT( slIVScaleOriginal()), + m_view, TQT_SLOT( slIVScaleOriginal()), actionCollection(), "scaleOriginal" ); m_view->connectViewerAction( act ); #ifdef QICONSET_HONOUR_ON_OFF - /* The Toggleaction does not seem to handle the on/off icon from QIconSet */ - QIconSet lockSet; - lockSet.setPixmap(BarIcon("lock") , QIconSet::Automatic, QIconSet::Normal, QIconSet::On ); - lockSet.setPixmap(BarIcon("unlock"), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off); + /* The Toggleaction does not seem to handle the on/off icon from TQIconSet */ + TQIconSet lockSet; + lockSet.setPixmap(BarIcon("lock") , TQIconSet::Automatic, TQIconSet::Normal, TQIconSet::On ); + lockSet.setPixmap(BarIcon("unlock"), TQIconSet::Automatic, TQIconSet::Normal, TQIconSet::Off); act = new KToggleAction ( i18n("Keep &Zoom Setting"), lockSet, CTRL+Key_Z, actionCollection(), "keepZoom" ); #else @@ -173,100 +173,100 @@ actionCollection()); actionCollection(), "keepZoom" ); #endif - connect( act, SIGNAL( toggled( bool ) ), m_view->getImageViewer(), - SLOT(setKeepZoom(bool))); + connect( act, TQT_SIGNAL( toggled( bool ) ), m_view->getImageViewer(), + TQT_SLOT(setKeepZoom(bool))); m_view->connectViewerAction( act ); /* thumbview and gallery actions */ act = new KAction(i18n("Set Zoom..."), "viewmag", 0, - m_view, SLOT( slIVShowZoomDialog()), + m_view, TQT_SLOT( slIVShowZoomDialog()), actionCollection(), "showZoomDialog" ); m_view->connectViewerAction( act ); (void) new KAction(i18n("Create From Selectio&n"), "crop", CTRL+Key_N, - m_view, SLOT( slCreateNewImgFromSelection() ), + m_view, TQT_SLOT( slCreateNewImgFromSelection() ), actionCollection(), "createFromSelection" ); (void) new KAction(i18n("Mirror Image &Vertically"), "mirror-vert", CTRL+Key_V, - this, SLOT( slMirrorVertical() ), + this, TQT_SLOT( slMirrorVertical() ), actionCollection(), "mirrorVertical" ); (void) new KAction(i18n("&Mirror Image Horizontally"), "mirror-horiz", CTRL+Key_M, - this, SLOT( slMirrorHorizontal() ), + this, TQT_SLOT( slMirrorHorizontal() ), actionCollection(), "mirrorHorizontal" ); (void) new KAction(i18n("Mirror Image &Both Directions"), "mirror-both", CTRL+Key_B, - this, SLOT( slMirrorBoth() ), + this, TQT_SLOT( slMirrorBoth() ), actionCollection(), "mirrorBoth" ); (void) new KAction(i18n("Open Image in &Graphic Application..."), "fileopen", CTRL+Key_G, - m_view, SLOT( slOpenCurrInGraphApp() ), + m_view, TQT_SLOT( slOpenCurrInGraphApp() ), actionCollection(), "openInGraphApp" ); act = new KAction(i18n("&Rotate Image Clockwise"), "rotate_cw", CTRL+Key_R, - this, SLOT( slRotateClockWise() ), + this, TQT_SLOT( slRotateClockWise() ), actionCollection(), "rotateClockwise" ); m_view->connectViewerAction( act ); act = new KAction(i18n("Rotate Image Counter-Clock&wise"), "rotate_ccw", CTRL+Key_W, - this, SLOT( slRotateCounterClockWise() ), + this, TQT_SLOT( slRotateCounterClockWise() ), actionCollection(), "rotateCounterClockwise" ); m_view->connectViewerAction( act ); act = new KAction(i18n("Rotate Image 180 &Degrees"), "rotate", CTRL+Key_D, - this, SLOT( slRotate180() ), + this, TQT_SLOT( slRotate180() ), actionCollection(), "upsitedown" ); m_view->connectViewerAction( act ); /* Gallery actions */ act = new KAction(i18n("&Create Folder..."), "folder_new", 0, - m_view->gallery(), SLOT( slotCreateFolder() ), + m_view->gallery(), TQT_SLOT( slotCreateFolder() ), actionCollection(), "foldernew" ); m_view->connectGalleryAction( act ); act = new KAction(i18n("&Save Image..."), "filesave", 0, - m_view->gallery(), SLOT( slotExportFile() ), + m_view->gallery(), TQT_SLOT( slotExportFile() ), actionCollection(), "saveImage" ); m_view->connectGalleryAction( act ); act = new KAction(i18n("&Import Image..."), "inline_image", 0, - m_view->gallery(), SLOT( slotImportFile() ), + m_view->gallery(), TQT_SLOT( slotImportFile() ), actionCollection(), "importImage" ); m_view->connectGalleryAction( act ); act = new KAction(i18n("&Delete Image"), "edittrash", 0, - m_view->gallery(), SLOT( slotDeleteItems() ), + m_view->gallery(), TQT_SLOT( slotDeleteItems() ), actionCollection(), "deleteImage" ); m_view->connectGalleryAction( act ); act = new KAction(i18n("&Unload Image"), "fileclose", 0, - m_view->gallery(), SLOT( slotUnloadItems() ), + m_view->gallery(), TQT_SLOT( slotUnloadItems() ), actionCollection(), "unloadImage" ); m_view->connectGalleryAction( act ); #if 0 /* not yet supported actions - coming post 3.1 */ (void) new KAction(i18n("&Load Scan Parameters"), "bookmark_add", CTRL+Key_L, - m_view, SLOT(slLoadScanParams()), + m_view, TQT_SLOT(slLoadScanParams()), actionCollection(), "loadscanparam" ); (void) new KAction(i18n("Save &Scan Parameters"), "bookmark_add", CTRL+Key_S, - m_view, SLOT(slSaveScanParams()), + m_view, TQT_SLOT(slSaveScanParams()), actionCollection(), "savescanparam" ); #endif (void) new KAction(i18n("Select Scan Device"), "scanner", 0, - m_view, SLOT( slSelectDevice()), + m_view, TQT_SLOT( slSelectDevice()), actionCollection(), "selectsource" ); (void) new KAction( i18n("Enable All Warnings && Messages"), 0, - this, SLOT(slEnableWarnings()), + this, TQT_SLOT(slEnableWarnings()), actionCollection(), "enable_msgs"); m_saveOCRTextAction = new KAction( i18n("Save OCR Res&ult Text"), "filesaveas", CTRL+Key_U, - m_view, SLOT(slSaveOCRResult()), + m_view, TQT_SLOT(slSaveOCRResult()), actionCollection(), "saveOCRResult"); } @@ -294,18 +294,18 @@ void Kooka::readProperties(KConfig *config) // in 'saveProperties' config->setGroup( KOOKA_STATE_GROUP ); m_prefDialogIndex = config->readNumEntry( PREFERENCE_DIA_TAB, 0 ); - // QString url = config->readPathEntry("lastURL"); + // TQString url = config->readPathEntry("lastURL"); } -void Kooka::dragEnterEvent(QDragEnterEvent *event) +void Kooka::dragEnterEvent(TQDragEnterEvent *event) { // accept uri drops only event->accept(KURLDrag::canDecode(event)); } #if 0 -void Kooka::dropEvent(QDropEvent *event) +void Kooka::dropEvent(TQDropEvent *event) { // this is a very simplistic implementation of a drop event. we // will only accept a dropped URL. the Qt dnd code can do *much* @@ -354,7 +354,7 @@ void Kooka::fileSave() void Kooka::fileSaveAs() { // this slot is called whenever the File->Save As menu is selected, - QStrList strlist; + TQStrList strlist; strlist.append( "BMP" ); strlist.append( "JPEG" ); FormatDialog fd( 0, "FormatDialog", &strlist ); @@ -387,7 +387,7 @@ void Kooka::optionsConfigureToolbars() // use the standard toolbar editor saveMainWindowSettings(KGlobal::config(), autoSaveGroup()); KEditToolbar dlg(factory()); - connect(&dlg, SIGNAL(newToolbarConfig()), SLOT(newToolbarConfig())); + connect(&dlg, TQT_SIGNAL(newToolbarConfig()), TQT_SLOT(newToolbarConfig())); dlg.exec(); } @@ -402,7 +402,7 @@ void Kooka::optionsPreferences() // popup some sort of preference dialog, here KookaPreferences dlg; dlg.showPage( m_prefDialogIndex ); - connect( &dlg, SIGNAL( dataSaved() ), m_view, SLOT(slFreshUpThumbView())); + connect( &dlg, TQT_SIGNAL( dataSaved() ), m_view, TQT_SLOT(slFreshUpThumbView())); if (dlg.exec()) { @@ -412,13 +412,13 @@ void Kooka::optionsPreferences() } } -void Kooka::changeStatusbar(const QString& text) +void Kooka::changeStatusbar(const TQString& text) { // display the text on the statusbar statusBar()->changeItem( text, KookaView::StatusTemp ); } -void Kooka::changeCaption(const QString& text) +void Kooka::changeCaption(const TQString& text) { // display the text on the caption setCaption(text); diff --git a/kooka/kooka.h b/kooka/kooka.h index 66f59e0c..91a98fea 100644 --- a/kooka/kooka.h +++ b/kooka/kooka.h @@ -59,7 +59,7 @@ public: /** * Default Constructor */ - Kooka(const QCString& deviceToUse); + Kooka(const TQCString& deviceToUse); /** * Default Destructor @@ -76,8 +76,8 @@ protected: /** * Overridden virtuals for Qt drag 'n drop (XDND) */ - virtual void dragEnterEvent(QDragEnterEvent *event); - // virtual void dropEvent(QDropEvent *event); + virtual void dragEnterEvent(TQDragEnterEvent *event); + // virtual void dropEvent(TQDropEvent *event); /** * This function is called when it is time for the app to save its @@ -105,9 +105,9 @@ private slots: void optionsConfigureToolbars(); void optionsPreferences(); - void changeStatusbar(const QString& text); + void changeStatusbar(const TQString& text); void cleanStatusbar(void) { changeStatusbar(""); } - void changeCaption(const QString& text); + void changeCaption(const TQString& text); void newToolbarConfig(); // void fileSaveAs(); diff --git a/kooka/kookaimage.cpp b/kooka/kookaimage.cpp index 4db87728..5857440a 100644 --- a/kooka/kookaimage.cpp +++ b/kooka/kookaimage.cpp @@ -40,7 +40,7 @@ KookaImage::KookaImage( ) - : QImage(), + : TQImage(), m_subImages(-1), m_subNo(0), m_parent(0), @@ -52,7 +52,7 @@ KookaImage::KookaImage( ) /* constructor for subimages */ KookaImage::KookaImage( int subNo, KookaImage *p ) - : QImage(), + : TQImage(), m_subImages(-1), m_subNo(subNo), m_parent( p ), @@ -65,7 +65,7 @@ KookaImage::KookaImage( int subNo, KookaImage *p ) KookaImage& KookaImage::operator=(const KookaImage& img) { - QImage::operator=(img); + TQImage::operator=(img); m_subImages = img.subImagesCount(); m_subNo = img.m_subNo; @@ -76,9 +76,9 @@ KookaImage& KookaImage::operator=(const KookaImage& img) return *this; } -KookaImage& KookaImage::operator=(const QImage& img) +KookaImage& KookaImage::operator=(const TQImage& img) { - QImage::operator=(img); + TQImage::operator=(img); return *this; } @@ -94,7 +94,7 @@ void KookaImage::setFileItem( KFileItem* it ) const KFileMetaInfo KookaImage::fileMetaInfo( ) { - QString filename = localFileName( ); + TQString filename = localFileName( ); if( ! filename.isEmpty() ) { kdDebug(28000) << "Fetching metainfo for " << filename << endl; @@ -105,21 +105,21 @@ const KFileMetaInfo KookaImage::fileMetaInfo( ) return KFileMetaInfo(); } -QString KookaImage::localFileName( ) const +TQString KookaImage::localFileName( ) const { if( ! m_url.isEmpty() ) return( m_url.directory() + "/" + m_url.fileName()); else - return QString(); + return TQString(); } bool KookaImage::loadFromUrl( const KURL& url ) { bool ret = true; m_url = url; - QString filename = localFileName( ); - QString format ( imageFormat( filename )); + TQString filename = localFileName( ); + TQString format ( imageFormat( filename )); /* if the format was not recogniseable, check the extension, if it is tif, try to read it by * tifflib */ @@ -189,13 +189,13 @@ bool KookaImage::loadFromUrl( const KURL& url ) } -KookaImage::KookaImage( const QImage& img ) - : QImage( img ) +KookaImage::KookaImage( const TQImage& img ) + : TQImage( img ) /* m_subImages( 1 ) */ { m_subImages = 0; - /* Load one QImage, can not be Tiff yet. */ + /* Load one TQImage, can not be Tiff yet. */ kdDebug(28000) << "constructor from other image here " << endl; } @@ -222,7 +222,7 @@ KURL KookaImage::url() const return m_url; } -bool KookaImage::loadTiffDir( const QString& filename, int no ) +bool KookaImage::loadTiffDir( const TQString& filename, int no ) { #ifdef HAVE_LIBTIFF int imgWidth, imgHeight; @@ -300,7 +300,7 @@ bool KookaImage::loadTiffDir( const QString& filename, int no ) float yScalefactor = xReso / yReso; kdDebug(28000) << "Different resolution x/y, rescaling with factor " << yScalefactor << endl; /* rescale the image */ - *this = smoothScale( imgWidth, int(imgHeight*yScalefactor), QImage::ScaleFree ); + *this = smoothScale( imgWidth, int(imgHeight*yScalefactor), TQImage::ScaleFree ); } else { @@ -308,7 +308,7 @@ bool KookaImage::loadTiffDir( const QString& filename, int no ) float scalefactor = yReso / xReso; kdDebug(28000) << "Different resolution x/y, rescaling x with factor " << scalefactor << endl; /* rescale the image */ - *this = smoothScale( int(imgWidth*scalefactor), imgHeight, QImage::ScaleFree ); + *this = smoothScale( int(imgWidth*scalefactor), imgHeight, TQImage::ScaleFree ); } } @@ -341,9 +341,9 @@ bool KookaImage::isSubImage() const /* * tiling */ -int KookaImage::cutToTiles( const QSize maxSize, int& rows, int& cols, TileMode ) +int KookaImage::cutToTiles( const TQSize maxSize, int& rows, int& cols, TileMode ) { - QSize imgSize = size(); + TQSize imgSize = size(); int w = imgSize.width(); if( w > maxSize.width() ) @@ -369,7 +369,7 @@ int KookaImage::cutToTiles( const QSize maxSize, int& rows, int& cols, TileMode while( w ) // Loop over width, cut in horizontal direction { cols++; - m_tileVector.append( QRect( absX, absY, w, h )); + m_tileVector.append( TQRect( absX, absY, w, h )); absX += w+1; w = imgSize.width() - absX; @@ -403,11 +403,11 @@ int KookaImage::cutToTiles( const QSize maxSize, int& rows, int& cols, TileMode -QRect KookaImage::getTileRect( int rowPos, int colPos ) const +TQRect KookaImage::getTileRect( int rowPos, int colPos ) const { int indx = rowPos*m_tileCols+colPos; kdDebug(28000) << "Tile Index: " << indx << endl; - const QRect r = m_tileVector[(rowPos)*m_tileCols + colPos]; + const TQRect r = m_tileVector[(rowPos)*m_tileCols + colPos]; return r; } diff --git a/kooka/kookaimage.h b/kooka/kookaimage.h index 84018d4d..c75c2dae 100644 --- a/kooka/kookaimage.h +++ b/kooka/kookaimage.h @@ -29,10 +29,10 @@ #ifndef KOOKAIMAGE_H #define KOOKAIMAGE_H #include -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -41,7 +41,7 @@ class KFileItem; /** * @author Klaas Freitag * - * class that represents an image, very much as QImage. But this one can contain + * class that represents an image, very much as TQImage. But this one can contain * multiple pages. */ @@ -58,10 +58,10 @@ public: * @param p is the parent image. */ KookaImage( int subNo, KookaImage *p ); - KookaImage( const QImage& img ); + KookaImage( const TQImage& img ); KookaImage& operator=(const KookaImage& ); - KookaImage& operator=(const QImage& ); + KookaImage& operator=(const TQImage& ); /** * load an image from a KURL. This method reads the entire file and sets * the values for subimage count. @@ -91,7 +91,7 @@ public: void extractNow(); KURL url() const; - QString localFileName( ) const; + TQString localFileName( ) const; /** * Set and get the KFileItem of the image. Note that the KFileItem pointer returned @@ -124,15 +124,15 @@ public: * The parameters rows and cols contain the number of rows and cols after * tiling. If both are one, the image is smaller than maxSize, thus the * left-top tile is index 1,1. - * Use getTile() to read the QRect list. + * Use getTile() to read the TQRect list. */ - int cutToTiles( const QSize maxSize, int& rows, int& cols, TileMode mode = MaxCut ); + int cutToTiles( const TQSize maxSize, int& rows, int& cols, TileMode mode = MaxCut ); /** * read tiles from the tile list. The image needs to be tiled by method * cutToTiles before. */ - QRect getTileRect( int rowPos, int colPos ) const; + TQRect getTileRect( int rowPos, int colPos ) const; /** * retrieve the sub number of this image. @@ -141,7 +141,7 @@ public: private: int m_subImages; - bool loadTiffDir( const QString&, int ); + bool loadTiffDir( const TQString&, int ); /* if subNo is 0, the image is the one and only. If it is larger than 0, the * parent contains the filename */ @@ -154,12 +154,12 @@ private: KFileItem *m_fileItem; bool m_fileBound; - QValueVector m_tileVector; + TQValueVector m_tileVector; int m_tileCols; /* number of tile columns */ }; -class KookaImageList: public QPtrList +class KookaImageList: public TQPtrList { public: KookaImageList() {} diff --git a/kooka/kookapref.cpp b/kooka/kookapref.cpp index c5996275..06274670 100644 --- a/kooka/kookapref.cpp +++ b/kooka/kookapref.cpp @@ -36,12 +36,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "config.h" @@ -51,8 +51,8 @@ #include "ksaneocr.h" #include -#include -#include +#include +#include #include KookaPreferences::KookaPreferences() @@ -74,10 +74,10 @@ void KookaPreferences::setupOCRPage() { konf->setGroup( CFG_GROUP_OCR_DIA ); - QFrame *page = addPage( i18n("OCR"), i18n("Optical Character Recognition" ), + TQFrame *page = addPage( i18n("OCR"), i18n("Optical Character Recognition" ), BarIcon("ocrImage", KIcon::SizeMedium ) ); - QVBoxLayout *top = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *top = new TQVBoxLayout( page, 0, spacingHint() ); bool haveGocr = false; bool haveOcrad = false; @@ -86,10 +86,10 @@ void KookaPreferences::setupOCRPage() /* * Switch ocr engines */ - QButtonGroup *engGroup = new QButtonGroup( 1, Qt::Horizontal, i18n("OCR Engine to Use"), page ); - m_gocrBut = new QRadioButton( i18n("GOCR engine") , engGroup ); - m_kadmosBut = new QRadioButton( i18n("KADMOS engine"), engGroup ); - m_ocradBut = new QRadioButton( i18n("OCRAD engine"), engGroup ); + TQButtonGroup *engGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n("OCR Engine to Use"), page ); + m_gocrBut = new TQRadioButton( i18n("GOCR engine") , engGroup ); + m_kadmosBut = new TQRadioButton( i18n("KADMOS engine"), engGroup ); + m_ocradBut = new TQRadioButton( i18n("OCRAD engine"), engGroup ); m_kadmosBut->setChecked(false); m_gocrBut->setChecked(false); m_ocradBut->setChecked(false); @@ -98,11 +98,11 @@ void KookaPreferences::setupOCRPage() /* * GOCR Option Box */ - QVGroupBox *gp = new QVGroupBox( i18n("GOCR OCR"), page ); + TQVGroupBox *gp = new TQVGroupBox( i18n("GOCR OCR"), page ); m_urlReqGocr = binaryCheckBox( gp, "gocr" ); - connect( m_urlReqGocr, SIGNAL( textChanged( const QString& )), - this, SLOT( slCheckOnGOCR( const QString& ))); - QString cmdGocr = tryFindBinary( "gocr", CFG_GOCR_BINARY ); + connect( m_urlReqGocr, TQT_SIGNAL( textChanged( const TQString& )), + this, TQT_SLOT( slCheckOnGOCR( const TQString& ))); + TQString cmdGocr = tryFindBinary( "gocr", CFG_GOCR_BINARY ); kdDebug(28000) << "Found gocr command: " << cmdGocr << endl; m_gocrBut->setEnabled(false); if( !cmdGocr.isEmpty() ) @@ -117,11 +117,11 @@ void KookaPreferences::setupOCRPage() /* * OCRAD Option Box */ - gp = new QVGroupBox( i18n("OCRAD OCR"), page ); + gp = new TQVGroupBox( i18n("OCRAD OCR"), page ); m_urlReqOcrad = binaryCheckBox( gp, "ocrad" ); - connect( m_urlReqOcrad, SIGNAL( textChanged( const QString& )), - this, SLOT( slCheckOnOCRAD( const QString& ))); - QString cmdOcrad = tryFindBinary( "ocrad", CFG_OCRAD_BINARY ); + connect( m_urlReqOcrad, TQT_SIGNAL( textChanged( const TQString& )), + this, TQT_SLOT( slCheckOnOCRAD( const TQString& ))); + TQString cmdOcrad = tryFindBinary( "ocrad", CFG_OCRAD_BINARY ); kdDebug(28000) << "Found ocrad command: " << cmdOcrad << endl; m_ocradBut->setEnabled(false); if( !cmdOcrad.isEmpty() ) @@ -136,26 +136,26 @@ void KookaPreferences::setupOCRPage() /* * Global Kadmos Options */ - QVGroupBox *kgp = new QVGroupBox( i18n("KADMOS OCR"), page ); + TQVGroupBox *kgp = new TQVGroupBox( i18n("KADMOS OCR"), page ); #ifdef HAVE_KADMOS - (void) new QLabel( i18n("The KADMOS OCR engine is available"), kgp); + (void) new TQLabel( i18n("The KADMOS OCR engine is available"), kgp); m_kadmosBut->setChecked(true); m_kadmosBut->setEnabled(true); haveKadmos = true; #else - (void) new QLabel( i18n("The KADMOS OCR engine is not available in this version of Kooka"), kgp ); + (void) new TQLabel( i18n("The KADMOS OCR engine is not available in this version of Kooka"), kgp ); m_kadmosBut->setEnabled(false); #endif top->addWidget( kgp ); - QWidget *spaceEater = new QWidget( page ); - spaceEater->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored )); + TQWidget *spaceEater = new TQWidget( page ); + spaceEater->setSizePolicy( TQSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Ignored )); top->addWidget( spaceEater ); /* * Now read the config value CFG_OCR_ENGINE and set the radios to the value if available */ - QString useEngine = konf->readEntry( CFG_OCR_ENGINE, "ocrad" ); + TQString useEngine = konf->readEntry( CFG_OCR_ENGINE, "ocrad" ); if( useEngine != "notFound" ) { if( useEngine == "gocr" && haveGocr ) @@ -176,56 +176,56 @@ void KookaPreferences::setupOCRPage() } } -KURLRequester* KookaPreferences::binaryCheckBox( QWidget *parent, const QString& program ) +KURLRequester* KookaPreferences::binaryCheckBox( TQWidget *parent, const TQString& program ) { - QHBox *hbox = new QHBox( parent ); + TQHBox *hbox = new TQHBox( parent ); - (void) new QLabel( i18n("Select the %1 binary to use:").arg( program ), hbox ); + (void) new TQLabel( i18n("Select the %1 binary to use:").arg( program ), hbox ); KURLRequester* urlRequester = new KURLRequester( parent ); urlRequester->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly ); - QToolTip::add( urlRequester, + TQToolTip::add( urlRequester, i18n( "Enter the path to %1, the optical-character-recognition " "command line tool.").arg(program)); return urlRequester; } -QString KookaPreferences::tryFindGocr( void ) +TQString KookaPreferences::tryFindGocr( void ) { return( tryFindBinary( "gocr", CFG_GOCR_BINARY ) ); } -QString KookaPreferences::tryFindBinary( const QString& bin, const QString& configKey ) +TQString KookaPreferences::tryFindBinary( const TQString& bin, const TQString& configKey ) { /* First check the config files for an entry */ KConfig *cfg = KGlobal::config(); cfg->setGroup(CFG_GROUP_OCR_DIA); - QString res = cfg->readPathEntry( configKey /* CFG_GOCR_BINARY */, "notFound" ); + TQString res = cfg->readPathEntry( configKey /* CFG_GOCR_BINARY */, "notFound" ); if( res != "notFound" ) { - QFileInfo fi( res ); + TQFileInfo fi( res ); if( fi.exists() && fi.isExecutable() && !fi.isDir() && res.contains(bin) ) { return res; } } - res = QString(); + res = TQString(); - QStringList locations; + TQStringList locations; locations.append( "/usr/bin/" + bin ); locations.append( "/bin/" + bin ); locations.append( "/usr/X11R6/bin/"+bin ); locations.append( "/usr/local/bin/"+bin ); - for ( QStringList::Iterator it = locations.begin(); it != locations.end(); ++it ) + for ( TQStringList::Iterator it = locations.begin(); it != locations.end(); ++it ) { - QString cmd = *it; + TQString cmd = *it; kdDebug(28000) << "checking command " << cmd << endl; - QFileInfo fi( cmd ); + TQFileInfo fi( cmd ); if( fi.exists() && fi.isExecutable() && !fi.isDir()) { res = cmd; @@ -238,7 +238,7 @@ QString KookaPreferences::tryFindBinary( const QString& bin, const QString& conf } -void KookaPreferences::slCheckOnGOCR( const QString& cmd ) +void KookaPreferences::slCheckOnGOCR( const TQString& cmd ) { if( checkOCRBinIntern( cmd, "gocr", false )) { @@ -251,7 +251,7 @@ void KookaPreferences::slCheckOnGOCR( const QString& cmd ) } } -void KookaPreferences::slCheckOnOCRAD( const QString& cmd ) +void KookaPreferences::slCheckOnOCRAD( const TQString& cmd ) { if( checkOCRBinIntern( cmd, "ocrad", false )) { @@ -265,17 +265,17 @@ void KookaPreferences::slCheckOnOCRAD( const QString& cmd ) } #if 0 -void KookaPreferences::checkOCRBinarySilent( const QString& cmd ) +void KookaPreferences::checkOCRBinarySilent( const TQString& cmd ) { // checkOCRBinIntern( cmd, this->sender(), false); } #endif -bool KookaPreferences::checkOCRBinIntern( const QString& cmd, const QString& tool, bool show_msg ) +bool KookaPreferences::checkOCRBinIntern( const TQString& cmd, const TQString& tool, bool show_msg ) { if( ! cmd.contains( tool )) return false; bool ret = true; - QFileInfo fi( cmd ); + TQFileInfo fi( cmd ); if( ! fi.exists() ) { if( show_msg ) @@ -308,32 +308,32 @@ void KookaPreferences::setupStartupPage() /* startup options */ konf->setGroup( GROUP_STARTUP ); - QFrame *page = addPage( i18n("Startup"), i18n("Kooka Startup Preferences" ), + TQFrame *page = addPage( i18n("Startup"), i18n("Kooka Startup Preferences" ), BarIcon("gear", KIcon::SizeMedium ) ); - QVBoxLayout *top = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *top = new TQVBoxLayout( page, 0, spacingHint() ); /* Description-Label */ - top->addWidget( new QLabel( i18n("Note that changing these options will affect Kooka's next start!"), page )); + top->addWidget( new TQLabel( i18n("Note that changing these options will affect Kooka's next start!"), page )); /* Query for network scanner (Checkbox) */ - cbNetQuery = new QCheckBox( i18n("Query network for available scanners"), + cbNetQuery = new TQCheckBox( i18n("Query network for available scanners"), page, "CB_NET_QUERY" ); - QToolTip::add( cbNetQuery, + TQToolTip::add( cbNetQuery, i18n( "Check this if you want a network query for available scanners.\nNote that this does not mean a query over the entire network but only the stations configured for SANE!" )); cbNetQuery->setChecked( ! (konf->readBoolEntry( STARTUP_ONLY_LOCAL, false )) ); /* Show scanner selection box on startup (Checkbox) */ - cbShowScannerSelection = new QCheckBox( i18n("Show the scanner selection box on next startup"), + cbShowScannerSelection = new TQCheckBox( i18n("Show the scanner selection box on next startup"), page, "CB_SHOW_SELECTION" ); - QToolTip::add( cbShowScannerSelection, + TQToolTip::add( cbShowScannerSelection, i18n( "Check this if you once checked 'do not show the scanner selection on startup',\nbut you want to see it again." )); cbShowScannerSelection->setChecked( !konf->readBoolEntry( STARTUP_SKIP_ASK, false )); /* Read startup image on startup (Checkbox) */ - cbReadStartupImage = new QCheckBox( i18n("Load the last image into the viewer on startup"), + cbReadStartupImage = new TQCheckBox( i18n("Load the last image into the viewer on startup"), page, "CB_LOAD_ON_START" ); - QToolTip::add( cbReadStartupImage, + TQToolTip::add( cbReadStartupImage, i18n( "Check this if you want Kooka to load the last selected image into the viewer on startup.\nIf your images are large, that might slow down Kooka's start." )); cbReadStartupImage->setChecked( konf->readBoolEntry( STARTUP_READ_IMAGE, true)); @@ -350,21 +350,21 @@ void KookaPreferences::setupStartupPage() void KookaPreferences::setupSaveFormatPage( ) { konf->setGroup( OP_FILE_GROUP ); - QFrame *page = addPage( i18n("Image Saving"), i18n("Configure Image Save Assistant" ), + TQFrame *page = addPage( i18n("Image Saving"), i18n("Configure Image Save Assistant" ), BarIcon("filesave", KIcon::SizeMedium ) ); - QVBoxLayout *top = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *top = new TQVBoxLayout( page, 0, spacingHint() ); /* Skip the format asking if a format entry exists */ - cbSkipFormatAsk = new QCheckBox( i18n("Always display image save assistant"), + cbSkipFormatAsk = new TQCheckBox( i18n("Always display image save assistant"), page, "CB_IMGASSIST_QUERY" ); cbSkipFormatAsk->setChecked( konf->readBoolEntry( OP_FILE_ASK_FORMAT, true )); - QToolTip::add( cbSkipFormatAsk, i18n("Check this if you want to see the image save assistant even if there is a default format for the image type." )); + TQToolTip::add( cbSkipFormatAsk, i18n("Check this if you want to see the image save assistant even if there is a default format for the image type." )); top->addWidget( cbSkipFormatAsk ); - cbFilenameAsk = new QCheckBox( i18n("Ask for filename when saving file"), + cbFilenameAsk = new TQCheckBox( i18n("Ask for filename when saving file"), page, "CB_ASK_FILENAME" ); cbFilenameAsk->setChecked( konf->readBoolEntry( OP_ASK_FILENAME, false)); - QToolTip::add( cbFilenameAsk, i18n("Check this if you want to enter a filename when an image has been scanned." )); + TQToolTip::add( cbFilenameAsk, i18n("Check this if you want to enter a filename when an image has been scanned." )); top->addWidget( cbFilenameAsk ); @@ -376,20 +376,20 @@ void KookaPreferences::setupThumbnailPage() { konf->setGroup( THUMB_GROUP ); - QFrame *page = addPage( i18n("Thumbnail View"), i18n("Thumbnail Gallery View" ), + TQFrame *page = addPage( i18n("Thumbnail View"), i18n("Thumbnail Gallery View" ), BarIcon("thumbnail", KIcon::SizeMedium ) ); - QVBoxLayout *top = new QVBoxLayout( page, 0, spacingHint() ); + TQVBoxLayout *top = new TQVBoxLayout( page, 0, spacingHint() ); - top->addWidget( new QLabel( i18n("Here you can configure the appearance of the thumbnail view of your scan picture gallery."),page )); + top->addWidget( new TQLabel( i18n("Here you can configure the appearance of the thumbnail view of your scan picture gallery."),page )); /* Backgroundimage */ KStandardDirs stdDir; - QString bgImg = konf->readPathEntry( BG_WALLPAPER ); + TQString bgImg = konf->readPathEntry( BG_WALLPAPER ); if( bgImg.isEmpty() ) bgImg = stdDir.findResource( "data", STD_TILE_IMG ); /* image file selector */ - QVGroupBox *hgb1 = new QVGroupBox( i18n("Thumbview Background" ), page ); + TQVGroupBox *hgb1 = new TQVGroupBox( i18n("Thumbview Background" ), page ); m_tileSelector = new ImageSelectLine( hgb1, i18n("Select background image:")); kdDebug(28000) << "Setting tile url " << bgImg << endl; m_tileSelector->setURL( KURL(bgImg) ); @@ -397,42 +397,42 @@ void KookaPreferences::setupThumbnailPage() top->addWidget( hgb1 ); /* Add the Boxes to configure size, framestyle and background */ - QVGroupBox *hgb2 = new QVGroupBox( i18n("Thumbnail Size" ), page ); - QVGroupBox *hgb3 = new QVGroupBox( i18n("Thumbnail Frame" ), page ); + TQVGroupBox *hgb2 = new TQVGroupBox( i18n("Thumbnail Size" ), page ); + TQVGroupBox *hgb3 = new TQVGroupBox( i18n("Thumbnail Frame" ), page ); /* Thumbnail size */ int w = konf->readNumEntry( PIXMAP_WIDTH, 100); int h = konf->readNumEntry( PIXMAP_HEIGHT, 120 ); - QGrid *lGrid = new QGrid( 2, hgb2 ); + TQGrid *lGrid = new TQGrid( 2, hgb2 ); lGrid->setSpacing( 2 ); - QLabel *l1 = new QLabel( i18n("Thumbnail maximum &width:"), lGrid ); + TQLabel *l1 = new TQLabel( i18n("Thumbnail maximum &width:"), lGrid ); m_thumbWidth = new KIntNumInput( w, lGrid ); m_thumbWidth->setMinValue(1); l1->setBuddy( m_thumbWidth ); lGrid->setSpacing( 4 ); - l1 = new QLabel( i18n("Thumbnail maximum &height:"), lGrid ); + l1 = new TQLabel( i18n("Thumbnail maximum &height:"), lGrid ); m_thumbHeight = new KIntNumInput( m_thumbWidth, h, lGrid ); m_thumbHeight->setMinValue(1); l1->setBuddy( m_thumbHeight ); /* Frame Stuff */ int frameWidth = konf->readNumEntry( THUMB_MARGIN, 3 ); - QColor col1 = konf->readColorEntry( MARGIN_COLOR1, &(colorGroup().base())); - QColor col2 = konf->readColorEntry( MARGIN_COLOR2, &(colorGroup().foreground())); + TQColor col1 = konf->readColorEntry( MARGIN_COLOR1, &(colorGroup().base())); + TQColor col2 = konf->readColorEntry( MARGIN_COLOR2, &(colorGroup().foreground())); - QGrid *fGrid = new QGrid( 2, hgb3 ); + TQGrid *fGrid = new TQGrid( 2, hgb3 ); fGrid->setSpacing( 2 ); - l1 = new QLabel(i18n("Thumbnail &frame width:"), fGrid ); + l1 = new TQLabel(i18n("Thumbnail &frame width:"), fGrid ); m_frameWidth = new KIntNumInput( frameWidth, fGrid ); m_frameWidth->setMinValue(0); l1->setBuddy( m_frameWidth ); - l1 = new QLabel(i18n("Frame color &1: "), fGrid ); + l1 = new TQLabel(i18n("Frame color &1: "), fGrid ); m_colButt1 = new KColorButton( col1, fGrid ); l1->setBuddy( m_colButt1 ); - l1 = new QLabel(i18n("Frame color &2: "), fGrid ); + l1 = new TQLabel(i18n("Frame color &2: "), fGrid ); m_colButt2 = new KColorButton( col2, fGrid ); l1->setBuddy( m_colButt2 ); /* TODO: Gradient type */ @@ -457,7 +457,7 @@ void KookaPreferences::slotApply( void ) /* ** startup options ** */ /** write the global one, to read from libkscan also */ - konf->setGroup(QString::fromLatin1(GROUP_STARTUP)); + konf->setGroup(TQString::fromLatin1(GROUP_STARTUP)); bool cbVal = !(cbShowScannerSelection->isChecked()); kdDebug(28000) << "Writing for " << STARTUP_SKIP_ASK << ": " << cbVal << endl; konf->writeEntry( STARTUP_SKIP_ASK, cbVal, true, true ); /* global flag goes to kdeglobals */ @@ -490,7 +490,7 @@ void KookaPreferences::slotApply( void ) /* ** OCR Options ** */ konf->setGroup( CFG_GROUP_OCR_DIA ); - QString eng( "gocr" ); + TQString eng( "gocr" ); if( m_ocradBut->isChecked() ) eng = "ocrad"; @@ -508,7 +508,7 @@ void KookaPreferences::slotApply( void ) konf->writeEntry(CFG_OCR_ENGINE, eng ); - QString path = m_urlReqGocr->url(); + TQString path = m_urlReqGocr->url(); if( ! path.isEmpty() ) konf->writePathEntry( CFG_GOCR_BINARY, path ); @@ -528,12 +528,12 @@ void KookaPreferences::slotDefault( void ) cbReadStartupImage->setChecked( true); cbSkipFormatAsk->setChecked( true ); KStandardDirs stdDir; - QString bgImg = stdDir.findResource( "data", STD_TILE_IMG ); + TQString bgImg = stdDir.findResource( "data", STD_TILE_IMG ); m_tileSelector->setURL( KURL(bgImg) ); m_thumbWidth->setValue( 100 ); m_thumbHeight->setValue( 120 ); - QColor col1 = QColor( colorGroup().base()); - QColor col2 = QColor( colorGroup().foreground()); + TQColor col1 = TQColor( colorGroup().base()); + TQColor col2 = TQColor( colorGroup().foreground()); m_frameWidth->setValue( 3 ); m_colButt1->setColor( col1 ); diff --git a/kooka/kookapref.h b/kooka/kookapref.h index c5ab34c0..46f27bb4 100644 --- a/kooka/kookapref.h +++ b/kooka/kookapref.h @@ -27,17 +27,17 @@ #define KOOKAPREF_H #include -#include +#include class KConfig; -class QLabel; +class TQLabel; class KIntNumInput; class KColorButton; class ImageSelectLine; class KScanEntry; -class QRadioButton; +class TQRadioButton; class KURLRequester; -class QCheckBox; +class TQCheckBox; #define STARTUP_READ_IMAGE "ReadImageOnStart" #define CFG_GROUP_OCR_DIA "ocrDialog" @@ -49,8 +49,8 @@ class KookaPreferences : public KDialogBase Q_OBJECT public: KookaPreferences(); - static QString tryFindGocr( void ); - static QString tryFindBinary( const QString&, const QString& ); + static TQString tryFindGocr( void ); + static TQString tryFindBinary( const TQString&, const TQString& ); public slots: void slotOk( void ); @@ -58,10 +58,10 @@ public slots: void slotDefault( void ); private slots: - bool checkOCRBinIntern( const QString&, const QString&, bool ); + bool checkOCRBinIntern( const TQString&, const TQString&, bool ); - void slCheckOnGOCR( const QString& ); - void slCheckOnOCRAD( const QString& ); + void slCheckOnGOCR( const TQString& ); + void slCheckOnOCRAD( const TQString& ); signals: void dataSaved(); @@ -71,14 +71,14 @@ private: void setupSaveFormatPage(); void setupThumbnailPage(); void setupOCRPage(); - KURLRequester* binaryCheckBox( QWidget *, const QString& ); + KURLRequester* binaryCheckBox( TQWidget *, const TQString& ); - QCheckBox *cbNetQuery; - QCheckBox *cbSkipFormatAsk; - QCheckBox *cbFilenameAsk; - QCheckBox *cbShowScannerSelection; + TQCheckBox *cbNetQuery; + TQCheckBox *cbSkipFormatAsk; + TQCheckBox *cbFilenameAsk; + TQCheckBox *cbShowScannerSelection; KConfig *konf; - QCheckBox *cbReadStartupImage; + TQCheckBox *cbReadStartupImage; KIntNumInput *m_thumbWidth; KIntNumInput *m_thumbHeight; @@ -90,10 +90,10 @@ private: KURLRequester *m_urlReqGocr; KURLRequester *m_urlReqOcrad; - QRadioButton *m_gocrBut; - QRadioButton *m_kadmosBut; - QRadioButton *m_ocradBut; - QString m_prevOCREngine; + TQRadioButton *m_gocrBut; + TQRadioButton *m_kadmosBut; + TQRadioButton *m_ocradBut; + TQString m_prevOCREngine; }; diff --git a/kooka/kookaprint.cpp b/kooka/kookaprint.cpp index 6e0554e9..5dad1f33 100644 --- a/kooka/kookaprint.cpp +++ b/kooka/kookaprint.cpp @@ -27,15 +27,15 @@ #include "kookaprint.h" #include "kookaimage.h" #include -#include -#include -#include +#include +#include +#include #include "imgprintdialog.h" #include #include KookaPrint::KookaPrint( KPrinter *printer ) - :QObject(), + :TQObject(), m_printer(printer), m_extraMarginPercent(10) { @@ -47,7 +47,7 @@ bool KookaPrint::printImage( KookaImage *img ) bool result = true; if( ! m_printer || !img) return false; - QString psMode = m_printer->option( OPT_PSGEN_DRAFT ); + TQString psMode = m_printer->option( OPT_PSGEN_DRAFT ); kdDebug(28000) << "User setting for quality: " << psMode << endl; #if 0 @@ -58,20 +58,20 @@ bool KookaPrint::printImage( KookaImage *img ) #endif /* Create painter _after_ setting Resolution */ - QPainter painter(m_printer); + TQPainter painter(m_printer); m_painter = &painter; KookaImage tmpImg; - QPoint pt(0, 0); // the top-left corner (image will be centered) + TQPoint pt(0, 0); // the top-left corner (image will be centered) - // We use a QPaintDeviceMetrics to know the actual page size in pixel, + // We use a TQPaintDeviceMetrics to know the actual page size in pixel, // this gives the real painting area - QPaintDeviceMetrics printermetrics( m_painter->device() ); + TQPaintDeviceMetrics printermetrics( m_painter->device() ); int screenRes = m_printer->option( OPT_SCREEN_RES ).toInt(); // int printerRes = printermetrics.logicalDpiX(); int printerRes = m_printer->resolution(); - QString scale = m_printer->option( OPT_SCALING ); + TQString scale = m_printer->option( OPT_SCALING ); int reso = screenRes; @@ -98,7 +98,7 @@ bool KookaPrint::printImage( KookaImage *img ) /* Scale the image for printing */ kdDebug(28000) << "Printer-Resolution: " << printerRes << " and scale-Reso: " << reso << endl; - QSize margins = m_printer->margins(); + TQSize margins = m_printer->margins(); kdDebug(28000) << "Printer-Margins left: " << margins.width() << " and top " << margins.height() << endl; if( reso > 0) @@ -112,10 +112,10 @@ bool KookaPrint::printImage( KookaImage *img ) kdDebug(28000) << "Scaling to printer size " << newWidth << " x " << newHeight << endl; - tmpImg = img->smoothScale(newWidth, newHeight, QImage::ScaleFree); + tmpImg = img->smoothScale(newWidth, newHeight, TQImage::ScaleFree); - QSize sz = tmpImg.size(); // the current image size - QSize maxOnPage = maxPageSize(); // the maximum space on one side + TQSize sz = tmpImg.size(); // the current image size + TQSize maxOnPage = maxPageSize(); // the maximum space on one side int maxRows, maxCols; int subpagesCnt = tmpImg.cutToTiles( maxOnPage, maxRows, maxCols ); @@ -129,12 +129,12 @@ bool KookaPrint::printImage( KookaImage *img ) { for( int col = 0; col < maxCols; col++ ) { - const QRect part = tmpImg.getTileRect( row, col ); - const QSize imgSize = part.size(); + const TQRect part = tmpImg.getTileRect( row, col ); + const TQSize imgSize = part.size(); kdDebug(28000) << "Printing part from " << part.x() << "/" << part.y() << " width:"<< part.width() << " and height " << part.height() << endl; - QImage tileImg = tmpImg.copy( part ); + TQImage tileImg = tmpImg.copy( part ); m_painter->drawImage( printPosTopLeft(imgSize), tileImg ); drawCornerMarker( imgSize, row, col, maxRows, maxCols ); @@ -155,10 +155,10 @@ void KookaPrint::printFittingToPage(KookaImage *img) KookaImage tmpImg; - QString psMode = m_printer->option( OPT_RATIO ); + TQString psMode = m_printer->option( OPT_RATIO ); bool maintainAspect = (psMode == "1"); - QSize s = maxPageSize(); + TQSize s = maxPageSize(); double wAspect = double(s.width()) / double(img->width()); double hAspect = double(s.height()) / double(img->height()); @@ -177,36 +177,36 @@ void KookaPrint::printFittingToPage(KookaImage *img) newHeight = int( double( img->height() ) * hAspect ); } - tmpImg = img->smoothScale(newWidth, newHeight, QImage::ScaleFree); + tmpImg = img->smoothScale(newWidth, newHeight, TQImage::ScaleFree); m_painter->drawImage( 0,0, tmpImg ); } -void KookaPrint::drawMarkerAroundPoint( const QPoint& p ) +void KookaPrint::drawMarkerAroundPoint( const TQPoint& p ) { if( ! m_painter ) return; const int len = 10; - m_painter->drawLine( p-QPoint(len,0), p+QPoint(len,0)); - m_painter->drawLine( p-QPoint(0,len), p+QPoint(0,len)); + m_painter->drawLine( p-TQPoint(len,0), p+TQPoint(len,0)); + m_painter->drawLine( p-TQPoint(0,len), p+TQPoint(0,len)); } -void KookaPrint::drawCutSign( const QPoint& p, int num, MarkerDirection dir ) +void KookaPrint::drawCutSign( const TQPoint& p, int num, MarkerDirection dir ) { - QBrush saveB = m_painter->brush(); + TQBrush saveB = m_painter->brush(); int start = 0; const int radius=20; - QColor brushColor( Qt::red ); + TQColor brushColor( Qt::red ); int toffX=0; int toffY=0; - QString numStr = QString::number(num); + TQString numStr = TQString::number(num); - QFontMetrics fm = m_painter->fontMetrics(); + TQFontMetrics fm = m_painter->fontMetrics(); int textWidth = fm.width( numStr )/2; int textHeight = fm.width( numStr )/2; int textYOff = 0; @@ -257,7 +257,7 @@ void KookaPrint::drawCutSign( const QPoint& p, int num, MarkerDirection dir ) // m_painter->drawRect( x, y, radius, radius ); /* debug !!! */ const int tAway = radius*3/4; - QRect bRect = fm.boundingRect( QString::number(num)); + TQRect bRect = fm.boundingRect( TQString::number(num)); int textX = p.x()+ tAway * toffX + textXOff; int textY = p.y()+ tAway * toffY + textYOff; @@ -265,8 +265,8 @@ void KookaPrint::drawCutSign( const QPoint& p, int num, MarkerDirection dir ) kdDebug(28000) << "Drawing to position " << textX << "/" << textY << endl; m_painter->drawText( textX, textY, - QString::number(num)); - QBrush b( brushColor, NoBrush /* remove this to get debug color*/ ); + TQString::number(num)); + TQBrush b( brushColor, NoBrush /* remove this to get debug color*/ ); m_painter->setBrush( b ); @@ -279,9 +279,9 @@ void KookaPrint::drawCutSign( const QPoint& p, int num, MarkerDirection dir ) /* * draws the circle and the numbers that indicate the pages to glue to the side */ -void KookaPrint::drawCornerMarker( const QSize& imgSize, int row, int col, int maxRows, int maxCols ) +void KookaPrint::drawCornerMarker( const TQSize& imgSize, int row, int col, int maxRows, int maxCols ) { - QPoint p; + TQPoint p; kdDebug(28000) << "Marker: Row: " << row << " and col " << col <<" from max " << maxRows << "x" << maxCols << endl; @@ -326,12 +326,12 @@ void KookaPrint::drawCornerMarker( const QSize& imgSize, int row, int col, int m drawCutSign( p, indx+maxCols, SO ); } - // p += QPoint( 1, 1 ); + // p += TQPoint( 1, 1 ); drawMarkerAroundPoint( p ); /* at bottom right */ /* Bottom left */ p = printPosBottomLeft( imgSize ); - // p += QPoint( -1, 1 ); + // p += TQPoint( -1, 1 ); if( maxRows > 1 || maxCols > 1 ) { if( col > 0 ) @@ -344,64 +344,64 @@ void KookaPrint::drawCornerMarker( const QSize& imgSize, int row, int col, int m drawMarkerAroundPoint( p ); /* at bottom left */ } -QSize KookaPrint::maxPageSize( int extraShrinkPercent ) const +TQSize KookaPrint::maxPageSize( int extraShrinkPercent ) const { - if( ! m_painter ) return QSize(); - QPaintDeviceMetrics printermetrics( m_painter->device() ); + if( ! m_painter ) return TQSize(); + TQPaintDeviceMetrics printermetrics( m_painter->device() ); double extraShrink = double(100-extraShrinkPercent)/100.0; - QSize retSize( printermetrics.width(), printermetrics.height() ); + TQSize retSize( printermetrics.width(), printermetrics.height() ); if( extraShrinkPercent > 0 ) - retSize = QSize( int(double(printermetrics.width())* extraShrink) , + retSize = TQSize( int(double(printermetrics.width())* extraShrink) , int(double(printermetrics.height())* extraShrink )); return retSize; } int KookaPrint::extraMarginPix() const { - QSize max = maxPageSize(); + TQSize max = maxPageSize(); /* take the half extra margin */ return int(double(max.width())*double(m_extraMarginPercent) / 100.0 / 2.0); } -QPoint KookaPrint::printPosTopLeft( const QSize& imgSize ) const +TQPoint KookaPrint::printPosTopLeft( const TQSize& imgSize ) const { - QSize max = maxPageSize(); + TQSize max = maxPageSize(); /* take the half extra margin */ int eMargin = extraMarginPix(); - return QPoint( eMargin + (max.width() - imgSize.width())/2, + return TQPoint( eMargin + (max.width() - imgSize.width())/2, eMargin + (max.height() - imgSize.height())/2 ); } -QPoint KookaPrint::printPosTopRight(const QSize& imgSize) const +TQPoint KookaPrint::printPosTopRight(const TQSize& imgSize) const { - QSize max = maxPageSize(); + TQSize max = maxPageSize(); /* take the half extra margin */ int eMargin = extraMarginPix(); - return QPoint( eMargin + (max.width() - imgSize.width())/2+imgSize.width(), + return TQPoint( eMargin + (max.width() - imgSize.width())/2+imgSize.width(), eMargin + (max.height() - imgSize.height())/2 ); } -QPoint KookaPrint::printPosBottomLeft(const QSize& imgSize) const +TQPoint KookaPrint::printPosBottomLeft(const TQSize& imgSize) const { - QSize max = maxPageSize(); + TQSize max = maxPageSize(); int eMargin = extraMarginPix(); /* take the half extra margin */ - return QPoint( eMargin+(max.width() - imgSize.width())/2, + return TQPoint( eMargin+(max.width() - imgSize.width())/2, eMargin+(max.height() - imgSize.height())/2 + imgSize.height() ); } -QPoint KookaPrint::printPosBottomRight(const QSize& imgSize) const +TQPoint KookaPrint::printPosBottomRight(const TQSize& imgSize) const { - QSize max = maxPageSize(); + TQSize max = maxPageSize(); /* take the half extra margin */ int eMargin = extraMarginPix(); - return QPoint( eMargin+(max.width() - imgSize.width())/2 + imgSize.width(), + return TQPoint( eMargin+(max.width() - imgSize.width())/2 + imgSize.width(), eMargin+(max.height() - imgSize.height())/2 + imgSize.height() ); } diff --git a/kooka/kookaprint.h b/kooka/kookaprint.h index 5f87d973..0373b642 100644 --- a/kooka/kookaprint.h +++ b/kooka/kookaprint.h @@ -27,24 +27,24 @@ #ifndef __KOOKA_PRINT_H__ #define __KOOKA_PRINT_H__ -#include -#include -#include +#include +#include +#include #include #include class KookaImage; class KPrinter; -class QPainter; +class TQPainter; class KLineEdit; class ImageSettings : public KPrintDialogPage { public: - void setOptions( const QMap& opts ); - void getOptions( QMap& opts, bool include_def = false ); - bool isValid( QString& msg ); + void setOptions( const TQMap& opts ); + void getOptions( TQMap& opts, bool include_def = false ); + bool isValid( TQString& msg ); private: KLineEdit *m_width, *m_height; @@ -61,10 +61,10 @@ public: /** * The top left edge of the required print position */ - virtual QPoint printPosTopLeft(const QSize&) const; - virtual QPoint printPosTopRight(const QSize&) const; - virtual QPoint printPosBottomLeft(const QSize&) const; - virtual QPoint printPosBottomRight(const QSize&) const; + virtual TQPoint printPosTopLeft(const TQSize&) const; + virtual TQPoint printPosTopRight(const TQSize&) const; + virtual TQPoint printPosBottomLeft(const TQSize&) const; + virtual TQPoint printPosBottomRight(const TQSize&) const; virtual int extraMarginPix() const; @@ -72,7 +72,7 @@ public: * The maximum pixel size of the image (or imagepart) on * the current page */ - virtual QSize maxPageSize( int extraShrinkPercent = 0 ) const; + virtual TQSize maxPageSize( int extraShrinkPercent = 0 ) const; public slots: @@ -81,14 +81,14 @@ public slots: protected: typedef enum { SW, NW, NO, SO } MarkerDirection; - virtual void drawMarkerAroundPoint( const QPoint& ); - virtual void drawCutSign( const QPoint&, int, MarkerDirection ); - virtual void drawCornerMarker( const QSize&, int, int, int, int ); + virtual void drawMarkerAroundPoint( const TQPoint& ); + virtual void drawCutSign( const TQPoint&, int, MarkerDirection ); + virtual void drawCornerMarker( const TQSize&, int, int, int, int ); private: KPrinter *m_printer; - QPainter *m_painter; + TQPainter *m_painter; int m_extraMarginPercent; }; diff --git a/kooka/kookaview.cpp b/kooka/kookaview.cpp index f1c1d8d0..2843535f 100644 --- a/kooka/kookaview.cpp +++ b/kooka/kookaview.cpp @@ -45,15 +45,15 @@ #if 0 #include "paramsetdialogs.h" #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -72,18 +72,18 @@ #include #include #include -#include +#include #include -#include +#include #include #define STARTUP_IMG_SELECTION "SelectedImageOnStartup" -KookaView::KookaView( KParts::DockMainWindow *parent, const QCString& deviceToUse) - : QObject(), +KookaView::KookaView( KParts::DockMainWindow *parent, const TQCString& deviceToUse) + : TQObject(), m_ocrResultImg(0), ocrFabric(0), m_mainDock(0), @@ -112,8 +112,8 @@ KookaView::KookaView( KParts::DockMainWindow *parent, const QCString& deviceToUs img_canvas = new ImageCanvas( m_mainDock ); img_canvas->setMinimumSize(100,200); img_canvas->enableContextMenu(true); - connect( img_canvas, SIGNAL( imageReadOnly(bool)), - this, SLOT(slViewerReadOnly(bool))); + connect( img_canvas, TQT_SIGNAL( imageReadOnly(bool)), + this, TQT_SLOT(slViewerReadOnly(bool))); KPopupMenu *ctxtmenu = static_cast(img_canvas->contextMenu()); if( ctxtmenu ) @@ -147,10 +147,10 @@ KookaView::KookaView( KParts::DockMainWindow *parent, const QCString& deviceToUs 30 ); // relation target/this (in percent) - connect( packager, SIGNAL(showThumbnails( KFileTreeViewItem* )), - this, SLOT( slShowThumbnails( KFileTreeViewItem* ))); - connect( m_thumbview, SIGNAL( selectFromThumbnail( const KURL& )), - packager, SLOT( slSelectImage(const KURL&))); + connect( packager, TQT_SIGNAL(showThumbnails( KFileTreeViewItem* )), + this, TQT_SLOT( slShowThumbnails( KFileTreeViewItem* ))); + connect( m_thumbview, TQT_SIGNAL( selectFromThumbnail( const KURL& )), + packager, TQT_SLOT( slSelectImage(const KURL&))); /* * Create a Kombobox that holds the last folders visible even on the preview page @@ -161,10 +161,10 @@ KookaView::KookaView( KParts::DockMainWindow *parent, const QCString& deviceToUs m_dockRecent->setDockSite(KDockWidget::DockFullSite); - QHBox *recentBox = new QHBox( m_dockRecent ); + TQHBox *recentBox = new TQHBox( m_dockRecent ); recentBox->setMargin(KDialog::marginHint()); - QLabel *lab = new QLabel( i18n("Gallery:"), recentBox ); - lab->setSizePolicy( QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed) ); + TQLabel *lab = new TQLabel( i18n("Gallery:"), recentBox ); + lab->setSizePolicy( TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed) ); recentFolder = new ImageNameCombo( recentBox ); m_dockRecent->setWidget( recentBox ); @@ -174,14 +174,14 @@ KookaView::KookaView( KParts::DockMainWindow *parent, const QCString& deviceToUs - connect( packager, SIGNAL( galleryPathSelected( KFileTreeBranch*, const QString&)), - recentFolder, SLOT( slotGalleryPathChanged( KFileTreeBranch*, const QString& ))); + connect( packager, TQT_SIGNAL( galleryPathSelected( KFileTreeBranch*, const TQString&)), + recentFolder, TQT_SLOT( slotGalleryPathChanged( KFileTreeBranch*, const TQString& ))); - connect( packager, SIGNAL( directoryToRemove( KFileTreeBranch*, const QString&)), - recentFolder, SLOT( slotPathRemove( KFileTreeBranch*, const QString& ))); + connect( packager, TQT_SIGNAL( directoryToRemove( KFileTreeBranch*, const TQString&)), + recentFolder, TQT_SLOT( slotPathRemove( KFileTreeBranch*, const TQString& ))); - connect( recentFolder, SIGNAL(activated( const QString& )), - packager, SLOT(slotSelectDirectory( const QString& ))); + connect( recentFolder, TQT_SIGNAL(activated( const TQString& )), + packager, TQT_SLOT(slotSelectDirectory( const TQString& ))); /* the object from the kscan lib to handle low level scanning */ m_dockScanParam = parent->createDockWidget( "Scan Parameter", @@ -236,7 +236,7 @@ KookaView::KookaView( KParts::DockMainWindow *parent, const QCString& deviceToUs 100 ); // relation target/this (in percent) m_ocrResEdit->setTextFormat( Qt::PlainText ); - m_ocrResEdit->setWordWrap( QTextEdit::NoWrap ); + m_ocrResEdit->setWordWrap( TQTextEdit::NoWrap ); // m_dockOCRText->hide(); } @@ -246,33 +246,33 @@ KookaView::KookaView( KParts::DockMainWindow *parent, const QCString& deviceToUs } /* New image created after scanning */ - connect(sane, SIGNAL(sigNewImage(QImage*,ImgScanInfo*)), this, SLOT(slNewImageScanned(QImage*,ImgScanInfo*))); + connect(sane, TQT_SIGNAL(sigNewImage(TQImage*,ImgScanInfo*)), this, TQT_SLOT(slNewImageScanned(TQImage*,ImgScanInfo*))); /* New preview image */ - connect(sane, SIGNAL(sigNewPreview(QImage*,ImgScanInfo *)), this, SLOT( slNewPreview(QImage*,ImgScanInfo *))); + connect(sane, TQT_SIGNAL(sigNewPreview(TQImage*,ImgScanInfo *)), this, TQT_SLOT( slNewPreview(TQImage*,ImgScanInfo *))); - connect( sane, SIGNAL( sigScanStart() ), this, SLOT( slScanStart())); - connect( sane, SIGNAL( sigScanFinished(KScanStat)), this, SLOT(slScanFinished(KScanStat))); - connect( sane, SIGNAL( sigAcquireStart()), this, SLOT( slAcquireStart())); + connect( sane, TQT_SIGNAL( sigScanStart() ), this, TQT_SLOT( slScanStart())); + connect( sane, TQT_SIGNAL( sigScanFinished(KScanStat)), this, TQT_SLOT(slScanFinished(KScanStat))); + connect( sane, TQT_SIGNAL( sigAcquireStart()), this, TQT_SLOT( slAcquireStart())); /* Image canvas should show a new document */ - connect( packager, SIGNAL( showImage( KookaImage* )), - this, SLOT( slShowAImage( KookaImage*))); + connect( packager, TQT_SIGNAL( showImage( KookaImage* )), + this, TQT_SLOT( slShowAImage( KookaImage*))); - connect( packager, SIGNAL( aboutToShowImage(const KURL&)), - this, SLOT( slStartLoading( const KURL& ))); + connect( packager, TQT_SIGNAL( aboutToShowImage(const KURL&)), + this, TQT_SLOT( slStartLoading( const KURL& ))); /* Packager unloads the image */ - connect( packager, SIGNAL( unloadImage( KookaImage* )), - this, SLOT( slUnloadAImage( KookaImage*))); + connect( packager, TQT_SIGNAL( unloadImage( KookaImage* )), + this, TQT_SLOT( slUnloadAImage( KookaImage*))); /* a image changed mostly through a image manipulation method like rotate */ - connect( packager, SIGNAL( fileChanged( KFileItem* )), - m_thumbview, SLOT( slImageChanged( KFileItem* ))); + connect( packager, TQT_SIGNAL( fileChanged( KFileItem* )), + m_thumbview, TQT_SLOT( slImageChanged( KFileItem* ))); - connect( packager, SIGNAL( fileRenamed( KFileItem*, const KURL& )), - m_thumbview, SLOT( slImageRenamed( KFileItem*, const KURL& ))); + connect( packager, TQT_SIGNAL( fileRenamed( KFileItem*, const KURL& )), + m_thumbview, TQT_SLOT( slImageRenamed( KFileItem*, const KURL& ))); - connect( packager, SIGNAL( fileDeleted( KFileItem* )), - m_thumbview, SLOT( slImageDeleted( KFileItem* ))); + connect( packager, TQT_SIGNAL( fileDeleted( KFileItem* )), + m_thumbview, TQT_SLOT( slImageDeleted( KFileItem* ))); packager->openRoots(); @@ -280,8 +280,8 @@ KookaView::KookaView( KParts::DockMainWindow *parent, const QCString& deviceToUs /* Status Bar */ KStatusBar *statBar = m_mainWindow->statusBar(); - // statBar->insertItem(QString("1"), SBAR_ZOOM, 0, true ); - statBar->insertItem( QString("-"), StatusImage, 0, true ); + // statBar->insertItem(TQString("1"), SBAR_ZOOM, 0, true ); + statBar->insertItem( TQString("-"), StatusImage, 0, true ); /* Set a large enough size */ int w = statBar->fontMetrics(). @@ -306,13 +306,13 @@ void KookaView::slViewerReadOnly( bool ) } -bool KookaView::slSelectDevice( const QCString& useDevice ) +bool KookaView::slSelectDevice( const TQCString& useDevice ) { kdDebug(28000) << "Kookaview: select a device!" << endl; bool haveConnection = false; - QCString selDevice; + TQCString selDevice; /* in case useDevice is the term 'gallery', the user does not want to * connect to a scanner, but only work in gallery mode. Otherwise, try * to read the device to use from config or from a user dialog */ @@ -346,8 +346,8 @@ bool KookaView::slSelectDevice( const QCString& useDevice ) if( sane->openDevice( selDevice ) == KSCAN_OK ) { - connect( scan_params, SIGNAL( scanResolutionChanged( int, int )), - preview_canvas, SLOT( slNewScanResolutions( int, int ))); + connect( scan_params, TQT_SIGNAL( scanResolutionChanged( int, int )), + preview_canvas, TQT_SLOT( slNewScanResolutions( int, int ))); if( ! scan_params->connectDevice( sane ) ) { @@ -360,12 +360,12 @@ bool KookaView::slSelectDevice( const QCString& useDevice ) /* New Rectangle selection in the preview, now scanimge exists */ ImageCanvas *previewCanvas = preview_canvas->getImageCanvas(); - connect( previewCanvas , SIGNAL( newRect(QRect)), - scan_params, SLOT(slCustomScanSize(QRect))); - connect( previewCanvas, SIGNAL( noRect()), - scan_params, SLOT(slMaximalScanSize())); - // connect( scan_params, SIGNAL( scanResolutionChanged( int, int )), - // preview_canvas, SLOT( slNewScanResolutions( int, int ))); + connect( previewCanvas , TQT_SIGNAL( newRect(TQRect)), + scan_params, TQT_SLOT(slCustomScanSize(TQRect))); + connect( previewCanvas, TQT_SIGNAL( noRect()), + scan_params, TQT_SLOT(slMaximalScanSize())); + // connect( scan_params, TQT_SIGNAL( scanResolutionChanged( int, int )), + // preview_canvas, TQT_SLOT( slNewScanResolutions( int, int ))); /* load the preview image */ if( preview_canvas ) { @@ -397,16 +397,16 @@ bool KookaView::slSelectDevice( const QCString& useDevice ) return( haveConnection ); } -QCString KookaView::userDeviceSelection( ) const +TQCString KookaView::userDeviceSelection( ) const { /* Human readable scanner descriptions */ - QStringList hrbackends; + TQStringList hrbackends; /* a list of backends the scan backend knows */ - QStrList backends = sane->getDevices(); - QStrListIterator it( backends ); + TQStrList backends = sane->getDevices(); + TQStrListIterator it( backends ); - QCString selDevice; + TQCString selDevice; if( backends.count() > 0 ) { while( it ) @@ -423,7 +423,7 @@ QCString KookaView::userDeviceSelection( ) const if( selDevice.isEmpty() || selDevice.isNull() ) { kdDebug(29000) << "selDevice not found - starting selector!" << selDevice << endl; - if ( ds.exec() == QDialog::Accepted ) + if ( ds.exec() == TQDialog::Accepted ) { selDevice = ds.getSelectedDevice(); } @@ -446,7 +446,7 @@ void KookaView::loadStartupImage( void ) if( wantReadOnStart ) { - QString startup = konf->readPathEntry( STARTUP_IMG_SELECTION ); + TQString startup = konf->readPathEntry( STARTUP_IMG_SELECTION ); if( !startup.isEmpty() ) { @@ -479,7 +479,7 @@ void KookaView::print() } } -void KookaView::slNewPreview( QImage *new_img, ImgScanInfo * ) +void KookaView::slNewPreview( TQImage *new_img, ImgScanInfo * ) { if( new_img ) { @@ -495,7 +495,7 @@ void KookaView::slNewPreview( QImage *new_img, ImgScanInfo * ) bool KookaView::ToggleVisibility( int item ) { - QWidget *w = 0; + TQWidget *w = 0; bool ret = false; switch( item ) @@ -558,32 +558,32 @@ void KookaView::startOCR( KookaImage *img ) ocrFabric = new KSANEOCR( m_mainDock, KGlobal::config() ); ocrFabric->setImageCanvas( img_canvas ); - connect( ocrFabric, SIGNAL( newOCRResultText( const QString& )), - m_ocrResEdit, SLOT(setText( const QString& ))); + connect( ocrFabric, TQT_SIGNAL( newOCRResultText( const TQString& )), + m_ocrResEdit, TQT_SLOT(setText( const TQString& ))); - connect( ocrFabric, SIGNAL( newOCRResultText( const QString& )), - m_dockOCRText, SLOT( show() )); + connect( ocrFabric, TQT_SIGNAL( newOCRResultText( const TQString& )), + m_dockOCRText, TQT_SLOT( show() )); - connect( ocrFabric, SIGNAL( repaintOCRResImage( )), - img_canvas, SLOT(repaint())); + connect( ocrFabric, TQT_SIGNAL( repaintOCRResImage( )), + img_canvas, TQT_SLOT(repaint())); - connect( ocrFabric, SIGNAL( clearOCRResultText()), - m_ocrResEdit, SLOT(clear())); + connect( ocrFabric, TQT_SIGNAL( clearOCRResultText()), + m_ocrResEdit, TQT_SLOT(clear())); - connect( ocrFabric, SIGNAL( updateWord(int, const QString&, const QString& )), - m_ocrResEdit, SLOT( slUpdateOCRResult( int, const QString&, const QString& ))); + connect( ocrFabric, TQT_SIGNAL( updateWord(int, const TQString&, const TQString& )), + m_ocrResEdit, TQT_SLOT( slUpdateOCRResult( int, const TQString&, const TQString& ))); - connect( ocrFabric, SIGNAL( ignoreWord(int, const ocrWord&)), - m_ocrResEdit, SLOT( slIgnoreWrongWord( int, const ocrWord& ))); + connect( ocrFabric, TQT_SIGNAL( ignoreWord(int, const ocrWord&)), + m_ocrResEdit, TQT_SLOT( slIgnoreWrongWord( int, const ocrWord& ))); - connect( ocrFabric, SIGNAL( markWordWrong(int, const ocrWord& )), - m_ocrResEdit, SLOT( slMarkWordWrong( int, const ocrWord& ))); + connect( ocrFabric, TQT_SIGNAL( markWordWrong(int, const ocrWord& )), + m_ocrResEdit, TQT_SLOT( slMarkWordWrong( int, const ocrWord& ))); - connect( ocrFabric, SIGNAL( readOnlyEditor( bool )), - m_ocrResEdit, SLOT( setReadOnly( bool ))); + connect( ocrFabric, TQT_SIGNAL( readOnlyEditor( bool )), + m_ocrResEdit, TQT_SLOT( setReadOnly( bool ))); - connect( ocrFabric, SIGNAL( selectWord( int, const ocrWord& )), - m_ocrResEdit, SLOT( slSelectWord( int, const ocrWord& ))); + connect( ocrFabric, TQT_SIGNAL( selectWord( int, const ocrWord& )), + m_ocrResEdit, TQT_SLOT( slSelectWord( int, const ocrWord& ))); } @@ -600,7 +600,7 @@ void KookaView::startOCR( KookaImage *img ) } -void KookaView::slOCRResultImage( const QPixmap& pix ) +void KookaView::slOCRResultImage( const TQPixmap& pix ) { kdDebug(28000) << "Showing OCR Result Image" << endl; if( ! img_canvas ) return; @@ -611,7 +611,7 @@ void KookaView::slOCRResultImage( const QPixmap& pix ) delete m_ocrResultImg; } - m_ocrResultImg = new QImage(); + m_ocrResultImg = new TQImage(); *m_ocrResultImg = pix; img_canvas->newImage( m_ocrResultImg ); img_canvas->setReadOnly(true); // ocr result images should be read only. @@ -645,7 +645,7 @@ void KookaView::slAcquireStart( ) } } -void KookaView::slNewImageScanned( QImage* img, ImgScanInfo* si ) +void KookaView::slNewImageScanned( TQImage* img, ImgScanInfo* si ) { KookaImageMeta *meta = new KookaImageMeta; meta->setScanResolution(si->getXResolution(), si->getYResolution()); @@ -688,7 +688,7 @@ void KookaView::slCreateNewImgFromSelection() if( img_canvas->rootImage() ) { emit( signalChangeStatusbar( i18n("Create new image from selection" ))); - QImage img; + TQImage img; if( img_canvas->selectedImage( &img ) ) { packager->slAddImage( &img ); @@ -701,15 +701,15 @@ void KookaView::slCreateNewImgFromSelection() void KookaView::slRotateImage(int angle) { - // QImage *img = (QImage*) img_canvas->rootImage(); + // TQImage *img = (TQImage*) img_canvas->rootImage(); KookaImage *img = packager->getCurrImage(); bool doUpdate = true; if( img ) { - QImage resImg; + TQImage resImg; - QApplication::setOverrideCursor(waitCursor); + TQApplication::setOverrideCursor(waitCursor); switch( angle ) { case 90: @@ -732,7 +732,7 @@ void KookaView::slRotateImage(int angle) break; } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); /* updateCurrImage does the status-bar cleanup */ if( doUpdate ) @@ -747,14 +747,14 @@ void KookaView::slRotateImage(int angle) void KookaView::slMirrorImage( MirrorType m ) { - const QImage *img = img_canvas->rootImage(); + const TQImage *img = img_canvas->rootImage(); bool doUpdate = true; if( img ) { - QImage resImg; + TQImage resImg; - QApplication::setOverrideCursor(waitCursor); + TQApplication::setOverrideCursor(waitCursor); switch( m ) { case MirrorVertical: @@ -773,7 +773,7 @@ void KookaView::slMirrorImage( MirrorType m ) kdDebug(28000) << "Mirroring: no way ;)" << endl; doUpdate = false; } - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); /* updateCurrImage does the status-bar cleanup */ if( doUpdate ) @@ -820,8 +820,8 @@ void KookaView::slSaveScanParams( ) if( dialog.exec()) { kdDebug(28000)<< "Executed successfully" << endl; - QString name = dialog.paramSetName(); - QString desc = dialog.paramSetDescription(); + TQString name = dialog.paramSetName(); + TQString desc = dialog.paramSetDescription(); sane->slSaveScanConfigSet( name, desc ); } #endif @@ -876,10 +876,10 @@ void KookaView::slShowThumbnails(KFileTreeViewItem *dirKfi, bool forceRedraw ) } else { - kftvi = static_cast(static_cast(kftvi)->parent()); + kftvi = static_cast(static_cast(kftvi)->parent()); dirKfi = kftvi; forceRedraw = true; - packager->setSelected( static_cast(dirKfi), true ); + packager->setSelected( static_cast(dirKfi), true ); } } @@ -894,7 +894,7 @@ void KookaView::slShowThumbnails(KFileTreeViewItem *dirKfi, bool forceRedraw ) KFileItemList fileItemsList; - QListViewItem * myChild = dirKfi->firstChild(); + TQListViewItem * myChild = dirKfi->firstChild(); while( myChild ) { fileItemsList.append( static_cast(myChild)->fileItem()); @@ -923,7 +923,7 @@ void KookaView::slStartLoading( const KURL& url ) } -void KookaView::updateCurrImage( QImage& img ) +void KookaView::updateCurrImage( TQImage& img ) { if( ! img_canvas->readOnly() ) { @@ -951,7 +951,7 @@ void KookaView::saveProperties(KConfig *config) void KookaView::slOpenCurrInGraphApp( void ) { - QString file; + TQString file; if( packager ) { @@ -969,13 +969,13 @@ void KookaView::slOpenCurrInGraphApp( void ) } -QImage KookaView::rotateLeft( QImage *m_img ) +TQImage KookaView::rotateLeft( TQImage *m_img ) { - QImage rot; + TQImage rot; if( m_img ) { - QWMatrix m; + TQWMatrix m; m.rotate(-90); rot = m_img->xForm(m); @@ -983,13 +983,13 @@ QImage KookaView::rotateLeft( QImage *m_img ) return( rot ); } -QImage KookaView::rotateRight( QImage *m_img ) +TQImage KookaView::rotateRight( TQImage *m_img ) { - QImage rot; + TQImage rot; if( m_img ) { - QWMatrix m; + TQWMatrix m; m.rotate(+90); rot = m_img->xForm(m); @@ -997,13 +997,13 @@ QImage KookaView::rotateRight( QImage *m_img ) return( rot ); } -QImage KookaView::rotate180( QImage *m_img ) +TQImage KookaView::rotate180( TQImage *m_img ) { - QImage rot; + TQImage rot; if( m_img ) { - QWMatrix m; + TQWMatrix m; m.rotate(+180); rot = m_img->xForm(m); @@ -1015,7 +1015,7 @@ QImage KookaView::rotate180( QImage *m_img ) void KookaView::connectViewerAction( KAction *action ) { - QPopupMenu *popup = img_canvas->contextMenu(); + TQPopupMenu *popup = img_canvas->contextMenu(); kdDebug(29000) << "This is the popup: " << popup << endl; if( popup && action ) { @@ -1025,7 +1025,7 @@ void KookaView::connectViewerAction( KAction *action ) void KookaView::connectGalleryAction( KAction *action ) { - QPopupMenu *popup = packager->contextMenu(); + TQPopupMenu *popup = packager->contextMenu(); if( popup && action ) { diff --git a/kooka/kookaview.h b/kooka/kookaview.h index a1f7898a..10017e88 100644 --- a/kooka/kookaview.h +++ b/kooka/kookaview.h @@ -26,14 +26,14 @@ #ifndef KOOKAVIEW_H #define KOOKAVIEW_H -#include +#include #include #include "kookaiface.h" #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -46,7 +46,7 @@ #include "img_canvas.h" class KDockWidget; -class QPainter; +class TQPainter; class KSANEOCR; class KConfig; class KPrinter; @@ -55,7 +55,7 @@ class KAction; class KActionCollection; class ThumbView; class KookaImage; -class QPixmap; +class TQPixmap; class ocrResEdit; /** * This is the main view class for Kooka. Most of the non-menu, @@ -76,7 +76,7 @@ public: /** * Default constructor */ - KookaView(KParts::DockMainWindow *parent, const QCString& deviceToUse); + KookaView(KParts::DockMainWindow *parent, const TQCString& deviceToUse); /** * Destructor @@ -102,7 +102,7 @@ public: public slots: void slShowPreview() { } void slShowPackager() { } - void slNewPreview( QImage *, ImgScanInfo * ); + void slNewPreview( TQImage *, ImgScanInfo * ); void slSetScanParamsVisible( bool v ) { if( v ) scan_params->show(); else scan_params->hide(); } @@ -137,7 +137,7 @@ public slots: void slLoadScanParams( ); void slSaveScanParams( ); - void slOCRResultImage( const QPixmap& ); + void slOCRResultImage( const TQPixmap& ); void slShowThumbnails( KFileTreeViewItem *dirKfi = 0, bool forceRedraw=false); void slFreshUpThumbView(); @@ -158,7 +158,7 @@ public slots: * slot to select the scanner device. Does all the work with selection * of scanner, disconnection of the old device and connecting the new. */ - bool slSelectDevice(const QCString& useDevice=QCString()); + bool slSelectDevice(const TQCString& useDevice=TQCString()); void connectViewerAction( KAction *action ); void connectGalleryAction( KAction *action ); @@ -175,9 +175,9 @@ protected slots: /** * called from the scandevice if a new Image was successfully scanned. - * Needs to convert the one-page-QImage to a KookaImage + * Needs to convert the one-page-TQImage to a KookaImage */ - void slNewImageScanned(QImage*, ImgScanInfo*); + void slNewImageScanned(TQImage*, ImgScanInfo*); /** * called if an viewer image was set to read only or back to read write state. @@ -187,7 +187,7 @@ signals: /** * Use this signal to change the content of the statusbar */ - void signalChangeStatusbar(const QString& text); + void signalChangeStatusbar(const TQString& text); /** * Use this signal to clean up the statusbar @@ -197,15 +197,15 @@ signals: /** * Use this signal to change the content of the caption */ - void signalChangeCaption(const QString& text); + void signalChangeCaption(const TQString& text); private: - QImage rotateRight( QImage* ); - QImage rotateLeft ( QImage* ); - QImage rotate180 ( QImage* ); - QCString userDeviceSelection( ) const; + TQImage rotateRight( TQImage* ); + TQImage rotateLeft ( TQImage* ); + TQImage rotate180 ( TQImage* ); + TQCString userDeviceSelection( ) const; - void updateCurrImage( QImage& ) ; + void updateCurrImage( TQImage& ) ; ImageCanvas *img_canvas; ThumbView *m_thumbview; @@ -217,9 +217,9 @@ private: KScanDevice *sane; KComboBox *recentFolder; - QCString connectedDevice; + TQCString connectedDevice; - QImage *m_ocrResultImg; + TQImage *m_ocrResultImg; int image_pool_id; int preview_id; diff --git a/kooka/ksaneocr.cpp b/kooka/ksaneocr.cpp index cf10d682..365624c6 100644 --- a/kooka/ksaneocr.cpp +++ b/kooka/ksaneocr.cpp @@ -35,8 +35,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -54,21 +54,21 @@ #include "kookapref.h" #include "ocrword.h" -#include -#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include /* * Thread support is disabled here because the kadmos lib seems not to be * thread save unfortunately. See slotKadmosResult-comments for more information */ -KSANEOCR::KSANEOCR( QWidget*, KConfig *cfg ): +KSANEOCR::KSANEOCR( TQWidget*, KConfig *cfg ): m_ocrProcessDia(0L), daemon(0L), visibleOCRRunning(false), @@ -102,7 +102,7 @@ KSANEOCR::KSANEOCR( QWidget*, KConfig *cfg ): { /* -- ocr dialog information -- */ konf->setGroup( CFG_GROUP_OCR_DIA ); - QString eng = konf->readEntry(CFG_OCR_ENGINE, "ocrad"); + TQString eng = konf->readEntry(CFG_OCR_ENGINE, "ocrad"); if( eng == "ocrad" ) { @@ -113,7 +113,7 @@ KSANEOCR::KSANEOCR( QWidget*, KConfig *cfg ): m_ocrEngine = GOCR; } #ifdef HAVE_KADMOS - else if( eng == QString("kadmos") ) m_ocrEngine = KADMOS; + else if( eng == TQString("kadmos") ) m_ocrEngine = KADMOS; #endif kdDebug(28000) << "OCR engine is " << eng << endl; @@ -173,7 +173,7 @@ void KSANEOCR::slSetImage(KookaImage *img ) /* * Request to visualise a line-box in the source image, KADMOS Engine */ -void KSANEOCR::slLineBox( const QRect& ) +void KSANEOCR::slLineBox( const TQRect& ) { if( ! m_img ) return; } @@ -183,7 +183,7 @@ void KSANEOCR::slLineBox( const QRect& ) * starts visual ocr process. Depending on the ocr engine, this function creates * a new dialog, and shows it. */ -bool KSANEOCR::startOCRVisible( QWidget *parent ) +bool KSANEOCR::startOCRVisible( TQWidget *parent ) { if( visibleOCRRunning ) return( false ); bool res = true; @@ -224,9 +224,9 @@ bool KSANEOCR::startOCRVisible( QWidget *parent ) m_ocrProcessDia->introduceImage( m_img ); visibleOCRRunning = true; - connect( m_ocrProcessDia, SIGNAL( user1Clicked()), this, SLOT( startOCRProcess() )); - connect( m_ocrProcessDia, SIGNAL( closeClicked()), this, SLOT( slotClose() )); - connect( m_ocrProcessDia, SIGNAL( user2Clicked()), this, SLOT( slotStopOCR() )); + connect( m_ocrProcessDia, TQT_SIGNAL( user1Clicked()), this, TQT_SLOT( startOCRProcess() )); + connect( m_ocrProcessDia, TQT_SIGNAL( closeClicked()), this, TQT_SLOT( slotClose() )); + connect( m_ocrProcessDia, TQT_SIGNAL( user2Clicked()), this, TQT_SLOT( slotStopOCR() )); m_ocrProcessDia->show(); } @@ -250,7 +250,7 @@ void KSANEOCR::finishedOCRVisible( bool success ) if( success ) { - QString goof = ocrResultText(); + TQString goof = ocrResultText(); emit newOCRResultText(goof); @@ -258,7 +258,7 @@ void KSANEOCR::finishedOCRVisible( bool success ) { if( m_resultImage != 0 ) delete m_resultImage; kdDebug(28000) << "Result image name: " << m_ocrResultImage << endl; - m_resultImage = new QImage( m_ocrResultImage, "BMP" ); + m_resultImage = new TQImage( m_ocrResultImage, "BMP" ); kdDebug(28000) << "New result image has dimensions: " << m_resultImage->width() << "x" << m_resultImage->height()<< endl; /* The image canvas is non-zero. Set it to our image */ m_imgCanvas->newImageHoldZoom( m_resultImage ); @@ -279,9 +279,9 @@ void KSANEOCR::finishedOCRVisible( bool success ) */ connect( new KSpell( m_parent, i18n("Kooka OCR Dictionary Check"), - this, SLOT( slSpellReady(KSpell*)), + this, TQT_SLOT( slSpellReady(KSpell*)), m_ocrProcessDia->spellConfig() ), - SIGNAL( death()), this, SLOT(slSpellDead())); + TQT_SIGNAL( death()), this, TQT_SLOT(slSpellDead())); } delete m_ocrProcessDia; @@ -369,7 +369,7 @@ void KSANEOCR::startOCRAD( ) ocradDialog *ocrDia = static_cast(m_ocrProcessDia); m_ocrResultImage = ocrDia->orfUrl(); - const QString cmd = ocrDia->getOCRCmd(); + const TQString cmd = ocrDia->getOCRCmd(); // if( m_ocrResultImage.isEmpty() ) { @@ -381,10 +381,10 @@ void KSANEOCR::startOCRAD( ) m_ocrImagePBM = ImgSaver::tempSaveImage( m_img, "PBM", 1 ); /* temporar file for orf result */ - KTempFile *tmpOrf = new KTempFile( QString(), ".orf" ); + KTempFile *tmpOrf = new KTempFile( TQString(), ".orf" ); tmpOrf->setAutoDelete( false ); tmpOrf->close(); - m_tmpOrfName = QFile::encodeName(tmpOrf->name()); + m_tmpOrfName = TQFile::encodeName(tmpOrf->name()); if( daemon ) @@ -397,25 +397,25 @@ void KSANEOCR::startOCRAD( ) Q_CHECK_PTR(daemon); *daemon << cmd; - *daemon << QString("-x"); + *daemon << TQString("-x"); *daemon << m_tmpOrfName; // the orf result file - *daemon << QFile::encodeName( m_ocrImagePBM ); // The name of the image - *daemon << QString("-l"); - *daemon << QString::number( ocrDia->layoutDetectionMode()); + *daemon << TQFile::encodeName( m_ocrImagePBM ); // The name of the image + *daemon << TQString("-l"); + *daemon << TQString::number( ocrDia->layoutDetectionMode()); KConfig *konf = KGlobal::config (); KConfigGroupSaver( konf, CFG_GROUP_OCRAD ); - QString format = konf->readEntry( CFG_OCRAD_FORMAT, "utf8"); - *daemon << QString("-F"); + TQString format = konf->readEntry( CFG_OCRAD_FORMAT, "utf8"); + *daemon << TQString("-F"); *daemon << format; - QString charset = konf->readEntry( CFG_OCRAD_CHARSET, "iso-8859-15"); - *daemon << QString("-c"); + TQString charset = konf->readEntry( CFG_OCRAD_CHARSET, "iso-8859-15"); + *daemon << TQString("-c"); *daemon << charset; - QString addArgs = konf->readEntry( CFG_OCRAD_EXTRA_ARGUMENTS, QString() ); + TQString addArgs = konf->readEntry( CFG_OCRAD_EXTRA_ARGUMENTS, TQString() ); if( !addArgs.isEmpty() ) { @@ -425,12 +425,12 @@ void KSANEOCR::startOCRAD( ) m_ocrResultText = ""; - connect(daemon, SIGNAL(processExited(KProcess *)), - this, SLOT( ocradExited(KProcess*))); - connect(daemon, SIGNAL(receivedStdout(KProcess *, char*, int)), - this, SLOT( ocradStdIn(KProcess*, char*, int))); - connect(daemon, SIGNAL(receivedStderr(KProcess *, char*, int)), - this, SLOT( ocradStdErr(KProcess*, char*, int))); + connect(daemon, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT( ocradExited(KProcess*))); + connect(daemon, TQT_SIGNAL(receivedStdout(KProcess *, char*, int)), + this, TQT_SLOT( ocradStdIn(KProcess*, char*, int))); + connect(daemon, TQT_SIGNAL(receivedStderr(KProcess *, char*, int)), + this, TQT_SLOT( ocradStdErr(KProcess*, char*, int))); if (!daemon->start(KProcess::NotifyOnExit, KProcess::All)) { @@ -448,7 +448,7 @@ void KSANEOCR::startOCRAD( ) void KSANEOCR::ocradExited(KProcess* ) { kdDebug(28000) << "ocrad exit " << endl; - QString err; + TQString err; bool parseRes = true; if( ! readORF(m_tmpOrfName, err) ) @@ -464,14 +464,14 @@ void KSANEOCR::ocradExited(KProcess* ) void KSANEOCR::ocradStdErr(KProcess*, char* buffer, int buflen) { - QString errorBuffer = QString::fromLocal8Bit(buffer, buflen); + TQString errorBuffer = TQString::fromLocal8Bit(buffer, buflen); kdDebug(28000) << "ocrad says on stderr: " << errorBuffer << endl; } void KSANEOCR::ocradStdIn(KProcess*, char* buffer, int buflen) { - QString errorBuffer = QString::fromLocal8Bit(buffer, buflen); + TQString errorBuffer = TQString::fromLocal8Bit(buffer, buflen); kdDebug(28000) << "ocrad says on stdin: " << errorBuffer << endl; } @@ -503,7 +503,7 @@ void KSANEOCR::startOCRProcess( void ) KGOCRDialog *gocrDia = static_cast(m_ocrProcessDia); - const QString cmd = gocrDia->getOCRCmd(); + const TQString cmd = gocrDia->getOCRCmd(); /* Save the image to a temp file */ @@ -513,7 +513,7 @@ void KSANEOCR::startOCRProcess( void ) * Gray: PGM * Bunt: PPM */ - QString format; + TQString format; if( m_img->depth() == 1 ) format = "PBM"; else if( m_img->isGrayscale() ) @@ -521,7 +521,7 @@ void KSANEOCR::startOCRProcess( void ) else format = "PPM"; - QString tmpFile = ImgSaver::tempSaveImage( m_img, format ); // m_tmpFile->name(); + TQString tmpFile = ImgSaver::tempSaveImage( m_img, format ); // m_tmpFile->name(); kdDebug(28000) << "Starting GOCR-Command: " << cmd << " on file " << tmpFile << ", format " << format << endl; @@ -535,15 +535,15 @@ void KSANEOCR::startOCRProcess( void ) Q_CHECK_PTR(daemon); m_ocrResultText = ""; - connect(daemon, SIGNAL(processExited(KProcess *)), - this, SLOT( gocrExited(KProcess*))); - connect(daemon, SIGNAL(receivedStdout(KProcess *, char*, int)), - this, SLOT( gocrStdIn(KProcess*, char*, int))); - connect(daemon, SIGNAL(receivedStderr(KProcess *, char*, int)), - this, SLOT( gocrStdErr(KProcess*, char*, int))); + connect(daemon, TQT_SIGNAL(processExited(KProcess *)), + this, TQT_SLOT( gocrExited(KProcess*))); + connect(daemon, TQT_SIGNAL(receivedStdout(KProcess *, char*, int)), + this, TQT_SLOT( gocrStdIn(KProcess*, char*, int))); + connect(daemon, TQT_SIGNAL(receivedStderr(KProcess *, char*, int)), + this, TQT_SLOT( gocrStdErr(KProcess*, char*, int))); - QString opt; - *daemon << QFile::encodeName(cmd); + TQString opt; + *daemon << TQFile::encodeName(cmd); *daemon << "-x"; *daemon << "-"; if( !( m_img->numColors() > 0 && m_img->numColors() <3 )) /* not a bw-image */ @@ -566,7 +566,7 @@ void KSANEOCR::startOCRProcess( void ) // Unfortunately this is fixed by gocr. m_ocrResultImage = "out30.bmp"; - *daemon << QFile::encodeName(tmpFile); + *daemon << TQFile::encodeName(tmpFile); m_ocrCurrLine = 0; // Important in gocrStdIn to store the results @@ -587,7 +587,7 @@ void KSANEOCR::startOCRProcess( void ) kdDebug(28000) << "Starting Kadmos OCR Engine" << endl; - QString clasPath; /* target where the clasPath is written in */ + TQString clasPath; /* target where the clasPath is written in */ if( ! kadDia->getSelClassifier( clasPath ) ) { KMessageBox::error( m_parent, @@ -597,7 +597,7 @@ void KSANEOCR::startOCRProcess( void ) finishedOCRVisible(false); return; } - QCString c = clasPath.latin1(); + TQCString c = clasPath.latin1(); kdDebug(28000) << "Using classifier " << c << endl; m_rep.Init( c ); @@ -618,10 +618,10 @@ void KSANEOCR::startOCRProcess( void ) kdDebug(28000) << "Image depth " << m_img->depth() << ", colors: " << m_img->numColors() << endl; #define USE_KADMOS_FILEOP /* use a save-file for OCR instead of filling the reImage struct manually */ #ifdef USE_KADMOS_FILEOP - m_tmpFile = new KTempFile( QString(), QString("bmp")); + m_tmpFile = new KTempFile( TQString(), TQString("bmp")); m_tmpFile->setAutoDelete( false ); m_tmpFile->close(); - QString tmpFile = m_tmpFile->name(); + TQString tmpFile = m_tmpFile->name(); kdDebug() << "Saving to file " << tmpFile << endl; m_img->save( tmpFile, "BMP" ); m_rep.SetImage(tmpFile); @@ -649,7 +649,7 @@ void KSANEOCR::startOCRProcess( void ) } #ifdef QT_THREAD_SUPPORT /* start a timer and wait until it fires. */ - QTimer::singleShot( 500, this, SLOT( slotKadmosResult() )); + TQTimer::singleShot( 500, this, TQT_SLOT( slotKadmosResult() )); #else slotKadmosResult(); #endif @@ -703,7 +703,7 @@ void KSANEOCR::slotKadmosResult() else { /* recognition thread is not yet finished. Wait another half a second. */ - QTimer::singleShot( 500, this, SLOT( slotKadmosResult() )); + TQTimer::singleShot( 500, this, TQT_SLOT( slotKadmosResult() )); /* Never comes here if no threads exist on the system */ } #endif /* HAVE_KADMOS */ @@ -724,7 +724,7 @@ void KSANEOCR::gocrExited(KProcess* d) * accordingly and than go through every line and create ocrwords for every * word. */ - QStringList lines = QStringList::split( '\n', m_ocrResultText, true ); + TQStringList lines = TQStringList::split( '\n', m_ocrResultText, true ); m_ocrPage.clear(); m_ocrPage.resize( lines.count() ); @@ -733,13 +733,13 @@ void KSANEOCR::gocrExited(KProcess* d) unsigned int lineCnt = 0; - for ( QStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) + for ( TQStringList::Iterator it = lines.begin(); it != lines.end(); ++it ) { kdDebug(28000) << "Splitting up line " << *it << endl; ocrWordList ocrLine; - QStringList words = QStringList::split( QRegExp( "\\s+" ), *it, false ); - for ( QStringList::Iterator itWord = words.begin(); itWord != words.end(); ++itWord ) + TQStringList words = TQStringList::split( TQRegExp( "\\s+" ), *it, false ); + for ( TQStringList::Iterator itWord = words.begin(); itWord != words.end(); ++itWord ) { kdDebug(28000) << "Appending to results: " << *itWord << endl; ocrLine.append( ocrWord( *itWord )); @@ -784,10 +784,10 @@ void KSANEOCR::gocrExited(KProcess* d) * */ -bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) +bool KSANEOCR::readORF( const TQString& fileName, TQString& errStr ) { - QFile file( fileName ); - QRegExp rx; + TQFile file( fileName ); + TQRegExp rx; bool error = false; /* use a global line number counter here, not the one from the orf. The orf one @@ -811,7 +811,7 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) kdDebug(28000) << "***** starting to analyse orf at " << fileName << " *****" << endl; /* some checks on the orf */ - QFileInfo fi( fileName ); + TQFileInfo fi( fileName ); if( ! fi.exists() ) { error = true; errStr = i18n("The orf %1 does not exist.").arg(fileName); @@ -824,9 +824,9 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) if ( !error && file.open( IO_ReadOnly ) ) { - QTextStream stream( &file ); - QString line; - QString recLine; // recognised line + TQTextStream stream( &file ); + TQString line; + TQString recLine; // recognised line while ( !stream.atEnd() ) { @@ -838,13 +838,13 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) kdDebug(28000) << "# Line check |" << line << "|" << endl; if( line.startsWith( "total blocks " ) ) // total count fo blocks, must be first line { - blockCnt = line.right( len - 13 /* QString("total blocks ").length() */ ).toInt(); + blockCnt = line.right( len - 13 /* TQString("total blocks ").length() */ ).toInt(); kdDebug(28000) << "Amount of blocks: " << blockCnt << endl; m_blocks.resize(blockCnt); } else if( line.startsWith( "total text blocks " )) { - blockCnt = line.right( len - 18 /* QString("total text blocks ").length() */ ).toInt(); + blockCnt = line.right( len - 18 /* TQString("total text blocks ").length() */ ).toInt(); kdDebug(28000) << "Amount of blocks (V. 10): " << blockCnt << endl; m_blocks.resize(blockCnt); } @@ -855,7 +855,7 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) { currBlock = (rx.cap(1).toInt())-1; kdDebug(28000) << "Setting current block " << currBlock << endl; - QRect r( rx.cap(2).toInt(), rx.cap(3).toInt(), rx.cap(4).toInt(), rx.cap(5).toInt()); + TQRect r( rx.cap(2).toInt(), rx.cap(3).toInt(), rx.cap(4).toInt(), rx.cap(5).toInt()); m_blocks[currBlock] = r; } else @@ -866,7 +866,7 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) } else if( line.startsWith( "lines " )) { - int lineCnt = line.right( len - 6 /* QString("lines ").length() */).toInt(); + int lineCnt = line.right( len - 6 /* TQString("lines ").length() */).toInt(); m_ocrPage.resize(m_ocrPage.size()+lineCnt); kdDebug(28000) << "Resized ocrPage to linecount " << lineCnt << endl; } @@ -879,7 +879,7 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) kdDebug(28000) << "RegExp-Result: " << rx.cap(1) << " : " << rx.cap(2) << endl; int charCount = rx.cap(2).toInt(); ocrWord word; - QRect brect; + TQRect brect; ocrWordList ocrLine; ocrLine.setBlock(currBlock); /* Loop over all characters in the line. Every char has it's own line @@ -889,7 +889,7 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) for( int c=0; c < charCount && !stream.atEnd(); c++ ) { /* Read one line per character */ - QString charLine = stream.readLine(); + TQString charLine = stream.readLine(); int semiPos = charLine.find(';'); if( semiPos == -1 ) { @@ -897,8 +897,8 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) } else { - QString rectStr = charLine.left( semiPos ); - QString results = charLine.remove(0, semiPos+1 ); + TQString rectStr = charLine.left( semiPos ); + TQString results = charLine.remove(0, semiPos+1 ); bool lineErr = false; // rectStr contains the rectangle info of for the character @@ -915,14 +915,14 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) lineErr = true; } // kdDebug(28000) << "Results-line after cutting the alter: " << results << endl; - QChar detectedChar = UndetectedChar; + TQChar detectedChar = UndetectedChar; if( !lineErr ) { /* take the first alternative only FIXME */ if( altCount > 0 ) detectedChar = results[1]; // kdDebug(28000) << "Found " << altCount << " alternatives for " - // << QString(detectedChar) << endl; + // << TQString(detectedChar) << endl; } /* Analyse the rectangle */ @@ -933,7 +933,7 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) if( rx.search( rectStr ) != -1 ) { /* unite the rectangles */ - QRect privRect( rx.cap(1).toInt(), rx.cap(2).toInt(), + TQRect privRect( rx.cap(1).toInt(), rx.cap(2).toInt(), rx.cap(3).toInt(), rx.cap(4).toInt() ); word.setRect( word.rect() | privRect ); } @@ -950,10 +950,10 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) if( detectedChar == ' ' ) { /* add the block offset to the rect of the word */ - QRect r = word.rect(); + TQRect r = word.rect(); if( ocradVersion < 10 ) { - QRect blockRect = m_blocks[currBlock]; + TQRect blockRect = m_blocks[currBlock]; r.moveBy( blockRect.x(), blockRect.y()); } @@ -971,10 +971,10 @@ bool KSANEOCR::readORF( const QString& fileName, QString& errStr ) if( !word.isEmpty() ) { /* add the block offset to the rect of the word */ - QRect r = word.rect(); + TQRect r = word.rect(); if( ocradVersion < 10 ) { - QRect blockRect = m_blocks[currBlock]; + TQRect blockRect = m_blocks[currBlock]; r.moveBy( blockRect.x(), blockRect.y()); } word.setRect( r ); @@ -1022,23 +1022,23 @@ void KSANEOCR::cleanUpFiles( void ) if( ! m_ocrResultImage.isEmpty()) { kdDebug(28000) << "Unlinking OCR Result image file!" << endl; - unlink(QFile::encodeName(m_ocrResultImage)); - m_ocrResultImage = QString(); + unlink(TQFile::encodeName(m_ocrResultImage)); + m_ocrResultImage = TQString(); } if( ! m_ocrImagePBM.isEmpty()) { kdDebug(28000) << "Unlinking OCR PBM file!" << endl; - unlink( QFile::encodeName(m_ocrImagePBM)); - m_ocrImagePBM = QString(); + unlink( TQFile::encodeName(m_ocrImagePBM)); + m_ocrImagePBM = TQString(); } if( ! m_tmpOrfName.isEmpty() ) { if( m_unlinkORF ) { - unlink(QFile::encodeName(m_tmpOrfName)); - m_tmpOrfName = QString(); + unlink(TQFile::encodeName(m_tmpOrfName)); + m_tmpOrfName = TQString(); } else { @@ -1053,7 +1053,7 @@ void KSANEOCR::cleanUpFiles( void ) void KSANEOCR::gocrStdErr(KProcess*, char* buffer, int buflen) { - QString errorBuffer = QString::fromLocal8Bit(buffer, buflen); + TQString errorBuffer = TQString::fromLocal8Bit(buffer, buflen); kdDebug(28000) << "gocr says: " << errorBuffer << endl; } @@ -1061,9 +1061,9 @@ void KSANEOCR::gocrStdErr(KProcess*, char* buffer, int buflen) void KSANEOCR::gocrStdIn(KProcess*, char* buffer, int buflen) { - QString aux = QString::fromLocal8Bit(buffer, buflen); + TQString aux = TQString::fromLocal8Bit(buffer, buflen); - QRegExp rx( "^\\s*\\d+\\s+\\d+"); + TQRegExp rx( "^\\s*\\d+\\s+\\d+"); if( rx.search( aux ) > -1 ) { /* calculate ocr progress for gocr */ @@ -1084,18 +1084,18 @@ void KSANEOCR::gocrStdIn(KProcess*, char* buffer, int buflen) /* * Assemble the result text */ -QString KSANEOCR::ocrResultText() +TQString KSANEOCR::ocrResultText() { - QString res; - const QString space(" "); + TQString res; + const TQString space(" "); /* start from the back and search the original word to replace it */ - QValueVector::iterator pageIt; + TQValueVector::iterator pageIt; for( pageIt = m_ocrPage.begin(); pageIt != m_ocrPage.end(); ++pageIt ) { /* thats goes over all lines */ - QValueList::iterator lineIt; + TQValueList::iterator lineIt; for( lineIt = (*pageIt).begin(); lineIt != (*pageIt).end(); ++lineIt ) { res += space + *lineIt; @@ -1119,15 +1119,15 @@ void KSANEOCR::setImageCanvas( ImageCanvas *canvas ) } -bool KSANEOCR::eventFilter( QObject *object, QEvent *event ) +bool KSANEOCR::eventFilter( TQObject *object, TQEvent *event ) { - QWidget *w = (QWidget*) object; + TQWidget *w = (TQWidget*) object; if( m_applyFilter && m_imgCanvas && w == m_imgCanvas ) { - if( event->type() == QEvent::MouseButtonDblClick ) + if( event->type() == TQEvent::MouseButtonDblClick ) { - QMouseEvent *mev = static_cast(event); + TQMouseEvent *mev = static_cast(event); int x = mev->x(); int y = mev->y(); @@ -1145,7 +1145,7 @@ bool KSANEOCR::eventFilter( QObject *object, QEvent *event ) x = int(double(x)*100/scale); } /* now search the word that was clicked on */ - QValueVector::iterator pageIt; + TQValueVector::iterator pageIt; int line = 0; bool valid = false; @@ -1153,7 +1153,7 @@ bool KSANEOCR::eventFilter( QObject *object, QEvent *event ) for( pageIt = m_ocrPage.begin(); pageIt != m_ocrPage.end(); ++pageIt ) { - QRect r = (*pageIt).wordListRect(); + TQRect r = (*pageIt).wordListRect(); if( y > r.top() && y < r.bottom() ) { @@ -1178,7 +1178,7 @@ bool KSANEOCR::eventFilter( QObject *object, QEvent *event ) for( wordIt = words.begin(); wordIt != words.end() && !valid; ++wordIt ) { - QRect r = (*wordIt).rect(); + TQRect r = (*wordIt).rect(); if( x > r.left() && x < r.right() ) { wordToFind = *wordIt; @@ -1215,8 +1215,8 @@ bool KSANEOCR::eventFilter( QObject *object, QEvent *event ) * KSpell detects the correction by itself and delivers it in newword here. * To see all alternatives KSpell proposes, slMissspelling must be used. */ -void KSANEOCR::slSpellCorrected( const QString& originalword, - const QString& newword, +void KSANEOCR::slSpellCorrected( const TQString& originalword, + const TQString& newword, unsigned int pos ) { kdDebug(28000) << "Corrected: Original Word " << originalword << " was corrected to " @@ -1240,7 +1240,7 @@ void KSANEOCR::slSpellCorrected( const QString& originalword, } -void KSANEOCR::slSpellIgnoreWord( const QString& word ) +void KSANEOCR::slSpellIgnoreWord( const TQString& word ) { ocrWord ignoreOCRWord; @@ -1254,9 +1254,9 @@ void KSANEOCR::slSpellIgnoreWord( const QString& word ) m_imgCanvas->removeHighlight( m_currHighlight ); /* create a new highlight. That will never be removed */ - QBrush brush; - QPen pen( gray, 1 ); - QRect r = ignoreOCRWord.rect(); + TQBrush brush; + TQPen pen( gray, 1 ); + TQRect r = ignoreOCRWord.rect(); r.moveBy(0,2); // a bit offset to the top if( m_applyFilter ) @@ -1265,7 +1265,7 @@ void KSANEOCR::slSpellIgnoreWord( const QString& word ) } } -ocrWord KSANEOCR::ocrWordFromKSpellWord( int line, const QString& word ) +ocrWord KSANEOCR::ocrWordFromKSpellWord( int line, const TQString& word ) { ocrWord resWord; if( lineValid(line) ) @@ -1289,7 +1289,7 @@ bool KSANEOCR::lineValid( int line ) return ret; } -void KSANEOCR::slMisspelling( const QString& originalword, const QStringList& suggestions, +void KSANEOCR::slMisspelling( const TQString& originalword, const TQStringList& suggestions, unsigned int pos ) { /* for the first try, use the first suggestion */ @@ -1311,11 +1311,11 @@ void KSANEOCR::slMisspelling( const QString& originalword, const QStringList& su if( ! resWord.isEmpty() ) { - QBrush brush; - brush.setColor( QColor(red)); // , "Dense4Pattern" ); + TQBrush brush; + brush.setColor( TQColor(red)); // , "Dense4Pattern" ); brush.setStyle( Qt::Dense4Pattern ); - QPen pen( red, 2 ); - QRect r = resWord.rect(); + TQPen pen( red, 2 ); + TQRect r = resWord.rect(); r.moveBy(0,2); // a bit offset to the top @@ -1347,18 +1347,18 @@ void KSANEOCR::slMisspelling( const QString& originalword, const QStringList& su void KSANEOCR::slSpellReady( KSpell *spell ) { m_spell = spell; - connect ( m_spell, SIGNAL( misspelling( const QString&, const QStringList&, + connect ( m_spell, TQT_SIGNAL( misspelling( const TQString&, const TQStringList&, unsigned int )), - this, SLOT( slMisspelling(const QString& , - const QStringList& , + this, TQT_SLOT( slMisspelling(const TQString& , + const TQStringList& , unsigned int ))); - connect( m_spell, SIGNAL( corrected ( const QString&, const QString&, unsigned int )), - this, SLOT( slSpellCorrected( const QString&, const QString&, unsigned int ))); + connect( m_spell, TQT_SIGNAL( corrected ( const TQString&, const TQString&, unsigned int )), + this, TQT_SLOT( slSpellCorrected( const TQString&, const TQString&, unsigned int ))); - connect( m_spell, SIGNAL( ignoreword( const QString& )), - this, SLOT( slSpellIgnoreWord( const QString& ))); + connect( m_spell, TQT_SIGNAL( ignoreword( const TQString& )), + this, TQT_SLOT( slSpellIgnoreWord( const TQString& ))); - connect( m_spell, SIGNAL( done(bool)), this, SLOT(slCheckListDone(bool))); + connect( m_spell, TQT_SIGNAL( done(bool)), this, TQT_SLOT(slCheckListDone(bool))); kdDebug(28000) << "Spellcheck available" << endl; @@ -1460,8 +1460,8 @@ void KSANEOCR::slCheckListDone(bool) * The original word was origWord. This slot is called from slSpellCorrected * */ -bool KSANEOCR::slUpdateWord( int line, int spellWordIndx, const QString& origWord, - const QString& newWord ) +bool KSANEOCR::slUpdateWord( int line, int spellWordIndx, const TQString& origWord, + const TQString& newWord ) { bool result = false; diff --git a/kooka/ksaneocr.h b/kooka/ksaneocr.h index 425718dc..fabb25e8 100644 --- a/kooka/ksaneocr.h +++ b/kooka/ksaneocr.h @@ -26,8 +26,8 @@ #ifndef KSANEOCR_H #define KSANEOCR_H -#include -#include +#include +#include #include "ocrword.h" @@ -53,9 +53,9 @@ class KOCRBase; class KookaImage; class KTempFile; class KProcess; -class QRect; -class QPixmap; -class QStringList; +class TQRect; +class TQPixmap; +class TQStringList; class KSpell; class KSpellConfig; class ImageCanvas; @@ -78,10 +78,10 @@ class KSANEOCR : public QObject public: enum OCREngines{ GOCR, OCRAD, KADMOS }; - KSANEOCR( QWidget*, KConfig *); + KSANEOCR( TQWidget*, KConfig *); ~KSANEOCR(); - bool startOCRVisible( QWidget* parent=0); + bool startOCRVisible( TQWidget* parent=0); void finishedOCRVisible( bool ); @@ -98,7 +98,7 @@ public: * return the final ocr result */ - QString ocrResultText(); + TQString ocrResultText(); /** * @return the current spell config. @@ -116,9 +116,9 @@ public: void setImageCanvas( ImageCanvas* canvas ); signals: - void newOCRResultText( const QString& ); + void newOCRResultText( const TQString& ); void clearOCRResultText(); - void newOCRResultPixmap( const QPixmap& ); + void newOCRResultPixmap( const TQPixmap& ); /** * progress of the ocr process. The first integer is the main progress, @@ -144,7 +144,7 @@ signals: * @param wordFrom the original word * @param wordTo the new word(s). */ - void updateWord( int line, const QString& wordFrom, const QString& wordTo ); + void updateWord( int line, const TQString& wordFrom, const TQString& wordTo ); /** * signal to indicate that word word was ignored by the user. This should result @@ -166,14 +166,14 @@ signals: /** * indicates that the text editor holding the text that came through * newOCRResultText should be set to readonly or not. Can be connected - * to QTextEdit::setReadOnly directly. + * to TQTextEdit::setReadOnly directly. */ void readOnlyEditor( bool ); public slots: void slSetImage( KookaImage* ); - void slLineBox( const QRect& ); + void slLineBox( const TQRect& ); protected: /** @@ -181,13 +181,13 @@ protected: * This method starts the spell checking. **/ void startLineSpellCheck(); - ocrWord ocrWordFromKSpellWord( int line, const QString& word ); + ocrWord ocrWordFromKSpellWord( int line, const TQString& word ); /** * Eventhandler to handle the mouse events to the image viewer showing the * ocr result image */ - bool eventFilter( QObject *object, QEvent *event ); + bool eventFilter( TQObject *object, TQEvent *event ); void startOCRAD(); protected slots: @@ -202,20 +202,20 @@ protected slots: */ // void gotOCRLine( int line ); - void slMisspelling( const QString& originalword, - const QStringList& suggestions, + void slMisspelling( const TQString& originalword, + const TQStringList& suggestions, unsigned int pos ); - void slSpellCorrected( const QString& originalword, - const QString& newword, + void slSpellCorrected( const TQString& originalword, + const TQString& newword, unsigned int pos ); - void slSpellIgnoreWord( const QString& word ); + void slSpellIgnoreWord( const TQString& word ); void slCheckListDone( bool ); bool slUpdateWord( int line, int spellWordIndx, - const QString& origWord, - const QString& newWord ); + const TQString& origWord, + const TQString& newWord ); private slots: @@ -233,7 +233,7 @@ private slots: * reads orf files from a file and fills the result structures * accordingly. */ - bool readORF( const QString&, QString& ); + bool readORF( const TQString&, TQString& ); private: void cleanUpFiles( void ); @@ -245,15 +245,15 @@ private: KTempFile *m_tmpFile; KookaImage *m_img; - QString m_ocrResultText; - QString m_ocrResultImage; - QString m_ocrImagePBM; - QString m_tmpOrfName; - QImage *m_resultImage; + TQString m_ocrResultText; + TQString m_ocrResultImage; + TQString m_ocrImagePBM; + TQString m_tmpOrfName; + TQImage *m_resultImage; OCREngines m_ocrEngine; - QPixmap m_resPixmap; - QPixmap m_storePixmap; + TQPixmap m_resPixmap; + TQPixmap m_storePixmap; ImageCanvas *m_imgCanvas; @@ -265,10 +265,10 @@ private: /* ValueVector of wordLists for every line of ocr results */ ocrBlock m_ocrPage; /* one block contains all lines of the page */ - QWidget *m_parent; + TQWidget *m_parent; /* current processed line to speed kspell correction */ unsigned m_ocrCurrLine; - QStringList m_checkStrings; + TQStringList m_checkStrings; int m_currHighlight; bool m_applyFilter; diff --git a/kooka/main.cpp b/kooka/main.cpp index 086d3ddf..67f014c9 100644 --- a/kooka/main.cpp +++ b/kooka/main.cpp @@ -26,8 +26,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -90,7 +90,7 @@ int main( int argc, char *argv[] ) KIconLoader *loader = KGlobal::iconLoader(); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QCString devToUse = args->getOption( "d" ); + TQCString devToUse = args->getOption( "d" ); if( args->isSet("g") ) { devToUse = "gallery"; diff --git a/kooka/ocrresedit.cpp b/kooka/ocrresedit.cpp index a289a079..a8d842a1 100644 --- a/kooka/ocrresedit.cpp +++ b/kooka/ocrresedit.cpp @@ -23,7 +23,7 @@ * without including the source code for Qt in the source distribution. * * * ***************************************************************************/ -#include +#include #include "ocrresedit.h" #include "ocrword.h" @@ -31,13 +31,13 @@ #include #include -#include -#include +#include +#include /* -------------------- ocrResEdit -------------------- */ -ocrResEdit::ocrResEdit( QWidget *parent ) - : QTextEdit(parent) +ocrResEdit::ocrResEdit( TQWidget *parent ) + : TQTextEdit(parent) { m_updateColor.setNamedColor( "SeaGreen"); m_ignoreColor.setNamedColor( "CadetBlue4" ); @@ -52,8 +52,8 @@ void ocrResEdit::slMarkWordWrong( int line, const ocrWord& word ) } -void ocrResEdit::slUpdateOCRResult( int line, const QString& wordFrom, - const QString& wordTo ) +void ocrResEdit::slUpdateOCRResult( int line, const TQString& wordFrom, + const TQString& wordTo ) { /* the index is quite useless here, since the text could have had been * changed by corrections before. Thus better search the word and update @@ -74,7 +74,7 @@ void ocrResEdit::slSelectWord( int line, const ocrWord& word ) { if( line < paragraphs() ) { - QString editLine = text(line); + TQString editLine = text(line); int cnt = editLine.contains( word); if( cnt > 0 ) @@ -86,8 +86,8 @@ void ocrResEdit::slSelectWord( int line, const ocrWord& word ) } } -void ocrResEdit::slReplaceWord( int line, const QString& wordFrom, - const QString& wordTo, const QColor& color ) +void ocrResEdit::slReplaceWord( int line, const TQString& wordFrom, + const TQString& wordTo, const TQColor& color ) { kdDebug(28000) << "Updating word " << wordFrom << " in line " << line << endl; @@ -95,7 +95,7 @@ void ocrResEdit::slReplaceWord( int line, const QString& wordFrom, if( line < paragraphs() ) { - QString editLine = text(line); + TQString editLine = text(line); int cnt = editLine.contains( wordFrom ); if( cnt > 0 ) @@ -103,7 +103,7 @@ void ocrResEdit::slReplaceWord( int line, const QString& wordFrom, int pos = editLine.find(wordFrom); setSelection( line, pos, line, pos+wordFrom.length()); - QColor saveCol = this->color(); + TQColor saveCol = this->color(); setColor( color ); if( isRO ) { setReadOnly(false); @@ -129,16 +129,16 @@ void ocrResEdit::slReplaceWord( int line, const QString& wordFrom, void ocrResEdit::slSaveText() { - QString fileName = KFileDialog::getSaveFileName( (QDir::home()).path(), + TQString fileName = KFileDialog::getSaveFileName( (TQDir::home()).path(), "*.txt", this, i18n("Save OCR Result Text") ); if( fileName.isEmpty() ) return; - QFile file( fileName ); + TQFile file( fileName ); if ( file.open( IO_WriteOnly ) ) { - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << text(); file.close(); } diff --git a/kooka/ocrresedit.h b/kooka/ocrresedit.h index 6c483db4..19191266 100644 --- a/kooka/ocrresedit.h +++ b/kooka/ocrresedit.h @@ -27,21 +27,21 @@ #ifndef _OCR_RESEDIT_ #define _OCR_RESEDIT_ -#include +#include -class QString; -class QColor; +class TQString; +class TQColor; class ocrWord; class ocrResEdit : public QTextEdit { Q_OBJECT public: - ocrResEdit( QWidget *parent ); + ocrResEdit( TQWidget *parent ); public slots: - void slUpdateOCRResult( int line, const QString& wordFrom, - const QString& wordTo ); + void slUpdateOCRResult( int line, const TQString& wordFrom, + const TQString& wordTo ); void slMarkWordWrong( int line, const ocrWord& word ); @@ -52,13 +52,13 @@ public slots: void slSaveText(); protected slots: - void slReplaceWord( int line, const QString& wordFrom, - const QString& wordTo, const QColor& color ); + void slReplaceWord( int line, const TQString& wordFrom, + const TQString& wordTo, const TQColor& color ); private: - QColor m_updateColor; - QColor m_ignoreColor; - QColor m_wrnColor; + TQColor m_updateColor; + TQColor m_ignoreColor; + TQColor m_wrnColor; }; diff --git a/kooka/ocrword.cpp b/kooka/ocrword.cpp index 1bd29f3e..4b04ea6e 100644 --- a/kooka/ocrword.cpp +++ b/kooka/ocrword.cpp @@ -24,29 +24,29 @@ * * ***************************************************************************/ -#include +#include #include "ocrword.h" -#include -#include +#include +#include #include -#include +#include /* -------------------- ocrWord -------------------- */ -ocrWord::ocrWord( const QString& s ) - : QString(s) +ocrWord::ocrWord( const TQString& s ) + : TQString(s) { } -ocrWord::ocrWord() : QString() +ocrWord::ocrWord() : TQString() { } #if 0 -QRect ocrWord::boundingRect() +TQRect ocrWord::boundingRect() { - QRect r; + TQRect r; return r; } @@ -54,16 +54,16 @@ QRect ocrWord::boundingRect() /* -------------------- CocrWordList ------------------ */ ocrWordList::ocrWordList() - :QValueList(), + :TQValueList(), m_block(0) { // setAutoDelete( true ); } -QStringList ocrWordList::stringList() +TQStringList ocrWordList::stringList() { - QStringList res; - QRegExp rx("[,\\.-]"); + TQStringList res; + TQRegExp rx("[,\\.-]"); ocrWordList::iterator it; for ( it = begin(); it != end(); ++it ) @@ -77,7 +77,7 @@ QStringList ocrWordList::stringList() * We live with the problem here that dashes bring confusion ;-) */ if( (*it).contains( rx ) ) - res += QStringList::split( rx, (*it) ); + res += TQStringList::split( rx, (*it) ); else #endif res << *it; @@ -86,14 +86,14 @@ QStringList ocrWordList::stringList() } -bool ocrWordList::updateOCRWord( const QString& from, const QString& to ) +bool ocrWordList::updateOCRWord( const TQString& from, const TQString& to ) { ocrWordList::iterator it; bool res = false; for( it = begin(); it != end(); ++it ) { - QString word = (*it); + TQString word = (*it); kdDebug(28000) << "updateOCRWord in list: Comparing word " << word << endl; if( word.contains( from, true ) ) // case sensitive search { @@ -106,9 +106,9 @@ bool ocrWordList::updateOCRWord( const QString& from, const QString& to ) return res; } -QRect ocrWordList::wordListRect() +TQRect ocrWordList::wordListRect() { - QRect rect; + TQRect rect; ocrWordList::iterator it; @@ -126,15 +126,15 @@ QRect ocrWordList::wordListRect() * This search goes through the wordlist and tries to find the words without caring * for special chars. It simply removes all chars from the words that are not alphanumeric. */ -bool ocrWordList::findFuzzyIndex( const QString& word, ocrWord& resWord ) +bool ocrWordList::findFuzzyIndex( const TQString& word, ocrWord& resWord ) { ocrWordList::iterator it; bool res = false; for( it = begin(); it != end() && !res; ++it ) { - QString fuzzyword = (*it); - fuzzyword.remove( QRegExp( "\\W" )); // Remove all non-word characters. + TQString fuzzyword = (*it); + fuzzyword.remove( TQRegExp( "\\W" )); // Remove all non-word characters. fuzzyword.remove( '_' ); // kdDebug(28000) << "findFuzzy: Comparing word " << fuzzyword << " which was " diff --git a/kooka/ocrword.h b/kooka/ocrword.h index 606acb9f..fd906367 100644 --- a/kooka/ocrword.h +++ b/kooka/ocrword.h @@ -27,28 +27,28 @@ #ifndef _OCR_WORD_ #define _OCR_WORD_ -#include -#include -#include -#include +#include +#include +#include +#include -class QString; -class QRect; +class TQString; +class TQRect; /* ==== ocrWord ====================================== */ class ocrWord : public QString { public: - ocrWord(const QString& s); + ocrWord(const TQString& s); ocrWord(); - QStringList getAlternatives() + TQStringList getAlternatives() { return m_alternatives; } - void setAlternatives( const QString& s ) + void setAlternatives( const TQString& s ) { m_alternatives.append(s); } - // QRect boundingRect(); + // TQRect boundingRect(); void setKnode( int k ) { m_startKnode = k; } @@ -58,16 +58,16 @@ public: int getLine() const { return m_line; } int getKnode() const { return m_startKnode; } - void setRect( const QRect& r ) + void setRect( const TQRect& r ) { m_position = r; } - QRect rect() + TQRect rect() { return m_position; } private: - QStringList m_alternatives; + TQStringList m_alternatives; int m_startKnode; int m_line; - QRect m_position; + TQRect m_position; }; /* ==== ocrWordList ====================================== */ @@ -75,17 +75,17 @@ private: /** * This represents a line of words in an ocr'ed document */ -class ocrWordList : public QValueList +class ocrWordList : public TQValueList { public: ocrWordList(); - QStringList stringList(); + TQStringList stringList(); - bool updateOCRWord( const QString& from, const QString& to ); + bool updateOCRWord( const TQString& from, const TQString& to ); - bool findFuzzyIndex( const QString& word, ocrWord& resWord ); + bool findFuzzyIndex( const TQString& word, ocrWord& resWord ); - QRect wordListRect( ); + TQRect wordListRect( ); void setBlock( int b ); int block() const { return m_block; } @@ -98,14 +98,14 @@ private: * All lines of a block: A value vector containing as much as entries * as lines are available in a block. Needs to be resized acordingly. */ -typedef QValueVector ocrBlock; +typedef TQValueVector ocrBlock; /** * Blocks taken together form the page. * Attention: Needs to be resized to the amount of blocks !! */ -typedef QValueVector ocrBlockPage; +typedef TQValueVector ocrBlockPage; -typedef QValueVector rectList; +typedef TQValueVector rectList; #endif diff --git a/kooka/scanpackager.cpp b/kooka/scanpackager.cpp index 7af7f151..2dd3096b 100644 --- a/kooka/scanpackager.cpp +++ b/kooka/scanpackager.cpp @@ -34,16 +34,16 @@ #include "previewer.h" #include "devselector.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include @@ -71,11 +71,11 @@ /* ----------------------------------------------------------------------- */ /* Constructor Scan Packager */ -ScanPackager::ScanPackager( QWidget *parent ) : KFileTreeView( parent ) +ScanPackager::ScanPackager( TQWidget *parent ) : KFileTreeView( parent ) { // TODO: setItemsRenameable (true ); - setDefaultRenameAction( QListView::Reject ); + setDefaultRenameAction( TQListView::Reject ); addColumn( i18n("Image Name" )); setColumnAlignment( 0, AlignLeft ); @@ -90,8 +90,8 @@ ScanPackager::ScanPackager( QWidget *parent ) : KFileTreeView( parent ) setDropVisualizer(true); setAcceptDrops(true); - connect( this, SIGNAL(dropped( QWidget*, QDropEvent*, KURL::List&, KURL& )), - this, SLOT( slotUrlsDropped( QWidget*, QDropEvent*, KURL::List&, KURL& ))); + connect( this, TQT_SIGNAL(dropped( TQWidget*, TQDropEvent*, KURL::List&, KURL& )), + this, TQT_SLOT( slotUrlsDropped( TQWidget*, TQDropEvent*, KURL::List&, KURL& ))); kdDebug(28000) << "connected Drop-Signal" << endl; setRenameable ( 0, true ); @@ -101,19 +101,19 @@ ScanPackager::ScanPackager( QWidget *parent ) : KFileTreeView( parent ) setRootIsDecorated( false ); - connect( this, SIGNAL( clicked( QListViewItem*)), - SLOT( slClicked(QListViewItem*))); + connect( this, TQT_SIGNAL( clicked( TQListViewItem*)), + TQT_SLOT( slClicked(TQListViewItem*))); - connect( this, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int )), - SLOT( slShowContextMenue(QListViewItem *, const QPoint &, int ))); + connect( this, TQT_SIGNAL( rightButtonPressed( TQListViewItem *, const TQPoint &, int )), + TQT_SLOT( slShowContextMenue(TQListViewItem *, const TQPoint &, int ))); - connect( this, SIGNAL(itemRenamed (QListViewItem*, const QString &, int ) ), this, - SLOT(slFileRename( QListViewItem*, const QString&, int))); + connect( this, TQT_SIGNAL(itemRenamed (TQListViewItem*, const TQString &, int ) ), this, + TQT_SLOT(slFileRename( TQListViewItem*, const TQString&, int))); img_counter = 1; /* Set the current export dir to home */ - m_currCopyDir = QDir::home().absPath(); + m_currCopyDir = TQDir::home().absPath(); m_currImportDir = m_currCopyDir; /* Preload frequently used icons */ @@ -158,17 +158,17 @@ KFileTreeBranch* ScanPackager::openRoot( const KURL& root, bool ) setDirOnlyMode( m_defaultBranch, false ); m_defaultBranch->setShowExtensions( true ); // false ); - connect( m_defaultBranch, SIGNAL( newTreeViewItems( KFileTreeBranch*, const KFileTreeViewItemList& )), - this, SLOT( slotDecorate(KFileTreeBranch*, const KFileTreeViewItemList& ))); + connect( m_defaultBranch, TQT_SIGNAL( newTreeViewItems( KFileTreeBranch*, const KFileTreeViewItemList& )), + this, TQT_SLOT( slotDecorate(KFileTreeBranch*, const KFileTreeViewItemList& ))); - connect( m_defaultBranch, SIGNAL( directoryChildCount( KFileTreeViewItem* , int )), - this, SLOT( slotDirCount( KFileTreeViewItem *, int ))); + connect( m_defaultBranch, TQT_SIGNAL( directoryChildCount( KFileTreeViewItem* , int )), + this, TQT_SLOT( slotDirCount( KFileTreeViewItem *, int ))); - connect( m_defaultBranch, SIGNAL( deleteItem( KFileItem* )), - this, SLOT( slotDeleteFromBranch(KFileItem*))); + connect( m_defaultBranch, TQT_SIGNAL( deleteItem( KFileItem* )), + this, TQT_SLOT( slotDeleteFromBranch(KFileItem*))); - connect( m_defaultBranch, SIGNAL( populateFinished( KFileTreeViewItem * )), - this, SLOT( slotStartupFinished( KFileTreeViewItem * ))); + connect( m_defaultBranch, TQT_SIGNAL( populateFinished( KFileTreeViewItem * )), + this, TQT_SLOT( slotStartupFinished( KFileTreeViewItem * ))); return( m_defaultBranch ); @@ -194,7 +194,7 @@ void ScanPackager::slotDirCount( KFileTreeViewItem* item, int cnt ) { if( item && item->isDir() ) { - QString cc = i18n( "one item", "%n items", cnt); + TQString cc = i18n( "one item", "%n items", cnt); item->setText( 1, cc ); } else @@ -245,7 +245,7 @@ void ScanPackager::slotDecorate( KFileTreeViewItem* item ) } /* set image size in pixels */ - QString t = i18n( "%1 x %2" ).arg( img->width()).arg(img->height()); + TQString t = i18n( "%1 x %2" ).arg( img->width()).arg(img->height()); item->setText( 1, t ); kdDebug( 28000) << "Image loaded and decorated!" << endl; } @@ -260,7 +260,7 @@ void ScanPackager::slotDecorate( KFileTreeViewItem* item ) } /* Image format */ - QString format = getImgFormat( item ); + TQString format = getImgFormat( item ); item->setText( 2, format ); } @@ -299,7 +299,7 @@ void ScanPackager::slotDecorate( KFileTreeBranch* branch, const KFileTreeViewIte -void ScanPackager::slFileRename( QListViewItem* it, const QString& newStr, int ) +void ScanPackager::slFileRename( TQListViewItem* it, const TQString& newStr, int ) { bool success = true; @@ -368,18 +368,18 @@ void ScanPackager::slFileRename( QListViewItem* it, const QString& newStr, int ) * Method that checks if the new filename a user enters while renaming an image is valid. * It checks for a proper extension. */ -QString ScanPackager::buildNewFilename( QString cmplFilename, QString currFormat ) const +TQString ScanPackager::buildNewFilename( TQString cmplFilename, TQString currFormat ) const { /* cmplFilename = new name the user wishes. * currFormat = the current format of the image. * if the new filename has a valid extension, which is the same as the * format of the current, fine. A ''-String has to be returned. */ - QFileInfo fiNew( cmplFilename ); - QString base = fiNew.baseName(); - QString newExt = fiNew.extension( false ).lower(); - QString nowExt = currFormat.lower(); - QString ext = ""; + TQFileInfo fiNew( cmplFilename ); + TQString base = fiNew.baseName(); + TQString newExt = fiNew.extension( false ).lower(); + TQString nowExt = currFormat.lower(); + TQString ext = ""; kdDebug(28000) << "Filename wanted: "<< cmplFilename << " <"< <" << nowExt<<">" <url()).prettyURL(); + TQString relativUrl= (item->url()).prettyURL(); if( ! item->isDir() ) { @@ -435,7 +435,7 @@ QString ScanPackager::itemDirectory( const KFileTreeViewItem* item, bool relativ if( branch ) { kdDebug(28000) << "Relativ URL of the file " << relativUrl << endl; - QString rootUrl = (branch->rootUrl()).prettyURL(); // directory of branch root + TQString rootUrl = (branch->rootUrl()).prettyURL(); // directory of branch root if( relativUrl.startsWith( rootUrl )) { @@ -459,18 +459,18 @@ QString ScanPackager::itemDirectory( const KFileTreeViewItem* item, bool relativ * call slClicked with it. */ -void ScanPackager::slotSelectDirectory( const QString & dirString ) +void ScanPackager::slotSelectDirectory( const TQString & dirString ) { kdDebug(28000) << "Trying to decode directory string " << dirString << endl; - QString searchFor = QString::fromLatin1(" - "); + TQString searchFor = TQString::fromLatin1(" - "); int pos = dirString.find( searchFor ); if( pos > -1 ) { /* Splitting up the string coming in */ - QString branchName = dirString.left( pos ); - QString relPath( dirString ); + TQString branchName = dirString.left( pos ); + TQString relPath( dirString ); relPath = relPath.remove( 0, pos + searchFor.length()); @@ -490,7 +490,7 @@ void ScanPackager::slotSelectDirectory( const QString & dirString ) /* ----------------------------------------------------------------------- */ /* This slot is called when clicking on an item. */ -void ScanPackager::slClicked( QListViewItem *newItem ) +void ScanPackager::slClicked( TQListViewItem *newItem ) { KFileTreeViewItem *item = static_cast(newItem); @@ -508,19 +508,19 @@ void ScanPackager::slClicked( QListViewItem *newItem ) { /* if not a dir, load the image if necessary. This is done by loadImageForItem, * which is async( TODO ). The image finally arrives in slotImageArrived */ - QApplication::setOverrideCursor(waitCursor); + TQApplication::setOverrideCursor(waitCursor); emit( aboutToShowImage( item->url())); loadImageForItem( item ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } /* emit a signal indicating the new directory if there is a new one */ - QString wholeDir = itemDirectory( item, false ); /* not relativ to root */ + TQString wholeDir = itemDirectory( item, false ); /* not relativ to root */ if( currSelectedDir != wholeDir ) { currSelectedDir = wholeDir; - QString relativUrl = itemDirectory( item, true ); + TQString relativUrl = itemDirectory( item, true ); kdDebug(28000) << "Emitting " << relativUrl << " as new relative Url" << endl; /* Emit the signal with branch and the relative path */ emit( galleryPathSelected( item->branch(), relativUrl )); @@ -663,9 +663,9 @@ KookaImage* ScanPackager::getCurrImage() const } -QString ScanPackager::getCurrImageFileName( bool withPath = true ) const +TQString ScanPackager::getCurrImageFileName( bool withPath = true ) const { - QString result = ""; + TQString result = ""; KFileTreeViewItem *curr = currentKFileTreeViewItem(); if( ! curr ) @@ -689,33 +689,33 @@ QString ScanPackager::getCurrImageFileName( bool withPath = true ) const } /* ----------------------------------------------------------------------- */ -QCString ScanPackager::getImgFormat( KFileTreeViewItem* item ) const +TQCString ScanPackager::getImgFormat( KFileTreeViewItem* item ) const { - QCString cstr; + TQCString cstr; if( !item ) return( cstr ); #if 0 KFileItem *kfi = item->fileItem(); - QString mime = kfi->mimetype(); + TQString mime = kfi->mimetype(); #endif // TODO find the real extension for use with the filename ! // temporarely: - QString f = localFileName( item ); + TQString f = localFileName( item ); - return( QImage::imageFormat( f )); + return( TQImage::imageFormat( f )); } -QString ScanPackager::localFileName( KFileTreeViewItem *it ) const +TQString ScanPackager::localFileName( KFileTreeViewItem *it ) const { - if( ! it ) return( QString::null ); + if( ! it ) return( TQString::null ); KURL url = it->url(); - QString res; + TQString res; if( url.isLocalFile()) { @@ -726,7 +726,7 @@ QString ScanPackager::localFileName( KFileTreeViewItem *it ) const } /* Called if the image exists but was changed by image manipulation func */ -void ScanPackager::slotCurrentImageChanged( QImage *img ) +void ScanPackager::slotCurrentImageChanged( TQImage *img ) { KFileTreeViewItem *curr = currentKFileTreeViewItem(); if( ! curr ) @@ -741,8 +741,8 @@ void ScanPackager::slotCurrentImageChanged( QImage *img ) /* unload image and free memory */ slotUnloadItem( curr ); - const QString filename = localFileName( curr ); - const QCString format = getImgFormat( curr ); + const TQString filename = localFileName( curr ); + const TQCString format = getImgFormat( curr ); ImgSaver saver( this ); ImgSaveStat is_stat = ISS_OK; is_stat = saver.saveImage( img, filename, format ); @@ -783,7 +783,7 @@ void ScanPackager::slotCurrentImageChanged( QImage *img ) /* This slot takes a new scanned Picture and saves it. * It urgently needs to make a deep copy of the image ! */ -void ScanPackager::slAddImage( QImage *img, KookaImageMeta* ) +void ScanPackager::slAddImage( TQImage *img, KookaImageMeta* ) { ImgSaveStat is_stat = ISS_OK; /* Save the image with the help of the ImgSaver */ @@ -844,17 +844,17 @@ void ScanPackager::slAddImage( QImage *img, KookaImageMeta* ) KFileTreeBranchList branchlist = branches(); KFileTreeBranch *kookaBranch = branchlist.at(0); - QString strdir = itemDirectory(curr); - if(strdir.endsWith(QString("/"))) strdir.truncate( strdir.length() - 1 ); + TQString strdir = itemDirectory(curr); + if(strdir.endsWith(TQString("/"))) strdir.truncate( strdir.length() - 1 ); kdDebug(28000) << "Updating directory with " << strdir << endl; if( kookaBranch ) kookaBranch->updateDirectory( KURL(strdir) ); slotSetNextUrlToSelect( lurl ); m_nextUrlToShow = lurl; - QString s; + TQString s; /* Count amount of children of the father */ - QListViewItem *paps = curr->parent(); + TQListViewItem *paps = curr->parent(); if( curr->isDir() ) /* take only father if the is no directory */ paps = curr; @@ -888,7 +888,7 @@ void ScanPackager::slSelectImage( const KURL& name ) } -KFileTreeViewItem *ScanPackager::spFindItem( SearchType type, const QString name, const KFileTreeBranch *branch ) +KFileTreeViewItem *ScanPackager::spFindItem( SearchType type, const TQString name, const KFileTreeBranch *branch ) { /* Prepare a list of branches to go through. If the parameter branch is set, search * only in the parameter branch. If it is zero, search all branches returned by @@ -944,7 +944,7 @@ KFileTreeViewItem *ScanPackager::spFindItem( SearchType type, const QString name } /* ----------------------------------------------------------------------- */ -void ScanPackager::slShowContextMenue(QListViewItem *lvi, const QPoint &p, int col ) +void ScanPackager::slShowContextMenue(TQListViewItem *lvi, const TQPoint &p, int col ) { kdDebug(28000) << "Showing Context Menue" << endl; (void) col; @@ -979,11 +979,11 @@ void ScanPackager::slotExportFile( ) else { KURL fromUrl( curr->url()); - QString filter = "*." + getImgFormat(curr).lower(); + TQString filter = "*." + getImgFormat(curr).lower(); filter += "\n*|" + i18n( "All Files" ); // initial += fromUrl.filename(false); - QString initial = m_currCopyDir + "/"; + TQString initial = m_currCopyDir + "/"; initial += fromUrl.filename(false); KURL fileName = KFileDialog::getSaveURL ( initial, filter, this ); @@ -996,7 +996,7 @@ void ScanPackager::slotExportFile( ) ImgSaver::copyImage( fromUrl, fileName ); /* remember the filename for the next export */ - fileName.setFileName( QString()); + fileName.setFileName( TQString()); m_currCopyDir = fileName.url( ); } } @@ -1030,13 +1030,13 @@ void ScanPackager::slotImportFile() -void ScanPackager::slotUrlsDropped( QWidget*, QDropEvent* ev, KURL::List& urls, KURL& copyTo ) +void ScanPackager::slotUrlsDropped( TQWidget*, TQDropEvent* ev, KURL::List& urls, KURL& copyTo ) { if( !urls.isEmpty() ) { kdDebug(28000) << "Kooka drop event!" << endl; // kdDebug(28000) << "Kooka drop event. First src url=" << urls.first() << " copyTo=" << copyTo - // << " move=" << ( ev->action() == QDropEvent::Move ) << endl; + // << " move=" << ( ev->action() == TQDropEvent::Move ) << endl; /* first make the last url to copy to the one to select next */ if( ! urls.empty() ) @@ -1049,7 +1049,7 @@ void ScanPackager::slotUrlsDropped( QWidget*, QDropEvent* ev, KURL::List& urls, // slotSetNextUrlToSelect( nextSel ); } - if ( ev->action() == QDropEvent::Move ) + if ( ev->action() == TQDropEvent::Move ) copyjob = KIO::move( urls, copyTo, true ); else copyjob = KIO::copy( urls, copyTo, true ); @@ -1122,7 +1122,7 @@ void ScanPackager::slotDeleteItems( ) if( ! curr ) return; KURL urlToDel = curr->url(); - QListViewItem *nextToSelect = curr->nextSibling(); + TQListViewItem *nextToSelect = curr->nextSibling(); kdDebug(28000) << "Deleting: " << urlToDel.prettyURL() << endl; bool ask = true; /* for later use */ @@ -1132,7 +1132,7 @@ void ScanPackager::slotDeleteItems( ) KFileItem *item = curr->fileItem(); if( ask ) { - QString s; + TQString s; s = i18n("Do you really want to delete this image?\nIt cannot be restored!" ); if( item->isDir() ) { @@ -1167,8 +1167,8 @@ void ScanPackager::slotDeleteItems( ) void ScanPackager::slotCreateFolder( ) { bool ok; - QString folder = KInputDialog::getText( i18n( "New Folder" ), - i18n( "Please enter a name for the new folder:" ), QString::null, + TQString folder = KInputDialog::getText( i18n( "New Folder" ), + i18n( "Please enter a name for the new folder:" ), TQString::null, &ok, this ); if( ok ) @@ -1209,9 +1209,9 @@ void ScanPackager::slotCreateFolder( ) /* ----------------------------------------------------------------------- */ -QString ScanPackager::getImgName( QString name_on_disk ) +TQString ScanPackager::getImgName( TQString name_on_disk ) { - QString s; + TQString s; (void) name_on_disk; s = i18n("image %1").arg(img_counter++); @@ -1230,7 +1230,7 @@ void ScanPackager::slotDeleteFromBranch( KFileItem* kfi ) emit fileDeleted( kfi ); } -void ScanPackager::contentsDragMoveEvent( QDragMoveEvent *e ) +void ScanPackager::contentsDragMoveEvent( TQDragMoveEvent *e ) { if( ! acceptDrag( e ) ) { @@ -1238,13 +1238,13 @@ void ScanPackager::contentsDragMoveEvent( QDragMoveEvent *e ) return; } - QListViewItem *afterme = 0; - QListViewItem *parent = 0; + TQListViewItem *afterme = 0; + TQListViewItem *parent = 0; findDrop( e->pos(), parent, afterme ); // "afterme" is 0 when aiming at a directory itself - QListViewItem *item = afterme ? afterme : parent; + TQListViewItem *item = afterme ? afterme : parent; if( item ) { diff --git a/kooka/scanpackager.h b/kooka/scanpackager.h index 13173050..496d6dee 100644 --- a/kooka/scanpackager.h +++ b/kooka/scanpackager.h @@ -28,11 +28,11 @@ #ifndef SCANPACKAGER_H #define SCANPACKAGER_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -45,7 +45,7 @@ */ class KURL; -class QPopupMenu; +class TQPopupMenu; class KFileTreeViewItem; class KookaImage; class KookaImageMeta; @@ -75,39 +75,39 @@ class ScanPackager : public KFileTreeView { Q_OBJECT public: - ScanPackager( QWidget *parent); + ScanPackager( TQWidget *parent); ~ScanPackager(); - virtual QString getImgName( QString name_on_disk ); + virtual TQString getImgName( TQString name_on_disk ); - QString getCurrImageFileName( bool ) const; + TQString getCurrImageFileName( bool ) const; KookaImage* getCurrImage() const; KFileTreeBranch* openRoot( const KURL&, bool open=false ); - QPopupMenu *contextMenu() const { return m_contextMenu; } + TQPopupMenu *contextMenu() const { return m_contextMenu; } void openRoots(); public slots: void slSelectImage( const KURL& ); - void slAddImage( QImage *img, KookaImageMeta* meta = 0 ); - void slShowContextMenue(QListViewItem *, const QPoint &, int ); + void slAddImage( TQImage *img, KookaImageMeta* meta = 0 ); + void slShowContextMenue(TQListViewItem *, const TQPoint &, int ); void slotExportFile( ); void slotImportFile(); void slotCanceled(KIO::Job*); - void slotCurrentImageChanged( QImage* ); + void slotCurrentImageChanged( TQImage* ); void slotDecorate( KFileTreeViewItem* ); void slotDecorate( KFileTreeBranch*, const KFileTreeViewItemList& ); - void slotSelectDirectory( const QString& ); + void slotSelectDirectory( const TQString& ); protected: - virtual void contentsDragMoveEvent( QDragMoveEvent *e ); + virtual void contentsDragMoveEvent( TQDragMoveEvent *e ); protected slots: - void slClicked( QListViewItem * ); - void slFileRename( QListViewItem*, const QString&, int ); + void slClicked( TQListViewItem * ); + void slFileRename( TQListViewItem*, const TQString&, int ); // void slFilenameChanged( KFileTreeViewItem*, const KURL & ); void slImageArrived( KFileTreeViewItem *item, KookaImage* image ); void slotCreateFolder( ); @@ -115,15 +115,15 @@ protected slots: void slotUnloadItems( ); void slotUnloadItem( KFileTreeViewItem *curr ); void slotDirCount( KFileTreeViewItem *item, int cnt ); - void slotUrlsDropped( QWidget*, QDropEvent*, KURL::List& urls, KURL& copyTo ); + void slotUrlsDropped( TQWidget*, TQDropEvent*, KURL::List& urls, KURL& copyTo ); void slotDeleteFromBranch( KFileItem* ); void slotStartupFinished( KFileTreeViewItem * ); signals: void showImage ( KookaImage* ); void deleteImage( KookaImage* ); void unloadImage( KookaImage* ); - void galleryPathSelected( KFileTreeBranch* branch, const QString& relativPath ); - void directoryToRemove( KFileTreeBranch *branch, const QString& relativPath ); + void galleryPathSelected( KFileTreeBranch* branch, const TQString& relativPath ); + void directoryToRemove( KFileTreeBranch *branch, const TQString& relativPath ); void showThumbnails( KFileTreeViewItem* ); void aboutToShowImage( const KURL& ); /* starting to load image */ @@ -134,31 +134,31 @@ signals: void fileRenamed( KFileItem*, const KURL& ); private: - QString localFileName( KFileTreeViewItem* it ) const; + TQString localFileName( KFileTreeViewItem* it ) const; void loadImageForItem( KFileTreeViewItem* item ); - QCString getImgFormat( KFileTreeViewItem* item ) const; + TQCString getImgFormat( KFileTreeViewItem* item ) const; - QString buildNewFilename( QString cmplFilename, QString currFormat ) const; - KFileTreeViewItem *spFindItem( SearchType type, const QString name, const KFileTreeBranch* branch = 0 ); - QString itemDirectory( const KFileTreeViewItem*, bool relativ = false ) const; + TQString buildNewFilename( TQString cmplFilename, TQString currFormat ) const; + KFileTreeViewItem *spFindItem( SearchType type, const TQString name, const KFileTreeBranch* branch = 0 ); + TQString itemDirectory( const KFileTreeViewItem*, bool relativ = false ) const; - // int readDir( QListViewItem *parent, QString dir_to_read ); - void showContextMenu( QPoint p, bool show_folder = true ); + // int readDir( TQListViewItem *parent, TQString dir_to_read ); + void showContextMenu( TQPoint p, bool show_folder = true ); - QString m_currImportDir; - QString m_currCopyDir; - QString currSelectedDir; + TQString m_currImportDir; + TQString m_currCopyDir; + TQString currSelectedDir; KIO::Job *copyjob; int img_counter; - QPopupMenu *m_contextMenu; + TQPopupMenu *m_contextMenu; // like m_nextUrlToSelect in KFileTreeView but for our own purposes (showing the image) KURL m_nextUrlToShow; - QPixmap m_floppyPixmap; - QPixmap m_grayPixmap; - QPixmap m_bwPixmap; - QPixmap m_colorPixmap; + TQPixmap m_floppyPixmap; + TQPixmap m_grayPixmap; + TQPixmap m_bwPixmap; + TQPixmap m_colorPixmap; KFileTreeBranch *m_defaultBranch; bool m_startup; diff --git a/kooka/thumbview.cpp b/kooka/thumbview.cpp index 5dfa93b6..b085e197 100644 --- a/kooka/thumbview.cpp +++ b/kooka/thumbview.cpp @@ -27,8 +27,8 @@ * * ***************************************************************************/ -#include -#include +#include +#include #include #include @@ -47,8 +47,8 @@ -ThumbView::ThumbView( QWidget *parent, const char *name ) - : QVBox( parent ), +ThumbView::ThumbView( TQWidget *parent, const char *name ) + : TQVBox( parent ), m_iconView(0), m_job(0) { @@ -65,7 +65,7 @@ ThumbView::ThumbView( QWidget *parent, const char *name ) readSettings(); - m_basePix.resize( QSize( m_pixWidth, m_pixHeight ) ); + m_basePix.resize( TQSize( m_pixWidth, m_pixHeight ) ); m_basePix.fill(); // fills white per default TODO @@ -73,8 +73,8 @@ ThumbView::ThumbView( QWidget *parent, const char *name ) slSetBackGround(); - connect( m_iconView, SIGNAL( executed( QIconViewItem* )), - this, SLOT( slDoubleClicked( QIconViewItem* ))); + connect( m_iconView, TQT_SIGNAL( executed( TQIconViewItem* )), + this, TQT_SLOT( slDoubleClicked( TQIconViewItem* ))); m_pendingJobs.setAutoDelete(false); } @@ -90,7 +90,7 @@ bool ThumbView::readSettings() cfg->setGroup( THUMB_GROUP ); bool dirty = false; - QColor color; + TQColor color; color = cfg->readColorEntry( MARGIN_COLOR1, &(colorGroup().base())); if( color != m_marginColor1 ) { @@ -138,7 +138,7 @@ bool ThumbView::readSettings() } KStandardDirs stdDir; - QString newBgImg = cfg->readEntry( BG_WALLPAPER, stdDir.findResource( "data", STD_TILE_IMG ) ); + TQString newBgImg = cfg->readEntry( BG_WALLPAPER, stdDir.findResource( "data", STD_TILE_IMG ) ); if( m_bgImg != newBgImg ) { @@ -149,7 +149,7 @@ bool ThumbView::readSettings() return (sizeDirty || dirty); } -void ThumbView::slDoubleClicked( QIconViewItem *qIt ) +void ThumbView::slDoubleClicked( TQIconViewItem *qIt ) { ThumbViewItem *it = static_cast( qIt ); @@ -163,11 +163,11 @@ void ThumbView::slDoubleClicked( QIconViewItem *qIt ) void ThumbView::slSetBackGround( ) { - QPixmap bgPix; + TQPixmap bgPix; if( m_bgImg.isEmpty()) { - bgPix.resize( QSize(16, 16)); - bgPix.fill( QPixmap::blue ); + bgPix.resize( TQSize(16, 16)); + bgPix.fill( TQPixmap::blue ); } else { @@ -188,7 +188,7 @@ void ThumbView::slImageChanged( KFileItem *kfit ) KURL itemUrl = kfit->url(); /* delete filename */ - itemUrl.setFileName( QString()); + itemUrl.setFileName( TQString()); if( !itemUrl.equals( thumbDir, true )) { // kdDebug(28000) << "returning, because directory does not match: " << itemUrl.prettyURL() << endl; @@ -214,7 +214,7 @@ void ThumbView::slImageRenamed( KFileItem *kfit, const KURL& newUrl ) clear(); } - for ( QIconViewItem *item = m_iconView->firstItem(); item; item = item->nextItem() ) + for ( TQIconViewItem *item = m_iconView->firstItem(); item; item = item->nextItem() ) { ThumbViewItem *it=static_cast( item ); @@ -239,7 +239,7 @@ void ThumbView::slCheckForUpdate( KFileItem *kfit ) /* iterate over all icon items and compare urls. * TODO: Check the parent url to avoid iteration over all */ - for ( QIconViewItem *item = m_iconView->firstItem(); item && !haveItem; + for ( TQIconViewItem *item = m_iconView->firstItem(); item && !haveItem; item = item->nextItem() ) { if( searchUrl == static_cast(item)->itemUrl() ) @@ -270,7 +270,7 @@ bool ThumbView::deleteImage( KFileItem *kfit ) /* iterate over all icon items and compare urls. * TODO: Check the parent url to avoid iteration over all */ - for ( QIconViewItem *item = m_iconView->firstItem(); item && !haveItem; item = item->nextItem() ) + for ( TQIconViewItem *item = m_iconView->firstItem(); item && !haveItem; item = item->nextItem() ) { if( searchUrl == static_cast(item)->itemUrl() ) { @@ -323,19 +323,19 @@ void ThumbView::slNewFileItems( const KFileItemList& items ) KFileItem *item = 0; for ( ; (item = it.current()); ++it ) { - QString filename = item->url().prettyURL(); + TQString filename = item->url().prettyURL(); if( item->isDir() ) { /* create a dir pixmap */ } else { - QPixmap p(m_basePix) ; - QPixmap mime( item->pixmap(0) ); + TQPixmap p(m_basePix) ; + TQPixmap mime( item->pixmap(0) ); if( p.width() > mime.width() && p.height() > mime.height() ) { - QPainter paint( &p ); + TQPainter paint( &p ); paint.drawPixmap( (p.width()-mime.width())/2, (p.height()-mime.height())/2, mime ); @@ -389,18 +389,18 @@ void ThumbView::slNewFileItems( const KFileItemList& items ) if( m_job ) { - connect( m_job, SIGNAL( result( KIO::Job * )), - this, SLOT( slPreviewResult( KIO::Job * ))); - connect( m_job, SIGNAL( gotPreview( const KFileItem*, const QPixmap& )), - SLOT( slGotPreview( const KFileItem*, const QPixmap& ) )); + connect( m_job, TQT_SIGNAL( result( KIO::Job * )), + this, TQT_SLOT( slPreviewResult( KIO::Job * ))); + connect( m_job, TQT_SIGNAL( gotPreview( const KFileItem*, const TQPixmap& )), + TQT_SLOT( slGotPreview( const KFileItem*, const TQPixmap& ) )); m_pendingJobs.clear(); /* KIO::Jo result is called in any way: Success, Failed, Error, * thus connecting the failed is not really necessary. */ - // connect( job, SIGNAL( failed( const KFileItem* )), - // this, SLOT( slotFailed( const KFileItem* ) )); + // connect( job, TQT_SIGNAL( failed( const KFileItem* )), + // this, TQT_SLOT( slotFailed( const KFileItem* ) )); } } @@ -408,7 +408,7 @@ void ThumbView::slNewFileItems( const KFileItemList& items ) -void ThumbView::slGotPreview( const KFileItem* newFileItem, const QPixmap& newPix ) +void ThumbView::slGotPreview( const KFileItem* newFileItem, const TQPixmap& newPix ) { if( ! newFileItem ) return; KFileIconViewItem *item = static_cast(const_cast(newFileItem->extraData( this ))); @@ -451,17 +451,17 @@ void ThumbView::slPreviewResult( KIO::Job *job ) } -QPixmap ThumbView::createPixmap( const QPixmap& preview ) const +TQPixmap ThumbView::createPixmap( const TQPixmap& preview ) const { - QImage ires = KImageEffect::unbalancedGradient( QSize( 2*m_thumbMargin+ preview.width(), + TQImage ires = KImageEffect::unbalancedGradient( TQSize( 2*m_thumbMargin+ preview.width(), 2*m_thumbMargin+ preview.height()), m_marginColor1, m_marginColor2, KImageEffect::DiagonalGradient ); - QPixmap pixRet; + TQPixmap pixRet; pixRet.convertFromImage( ires ); - QPainter p( &pixRet ); + TQPainter p( &pixRet ); p.drawPixmap( m_thumbMargin, m_thumbMargin, preview ); p.flush(); diff --git a/kooka/thumbview.h b/kooka/thumbview.h index c16afa84..e1bc78cb 100644 --- a/kooka/thumbview.h +++ b/kooka/thumbview.h @@ -29,11 +29,11 @@ #ifndef __THUMBVIEW_H__ #define __THUMBVIEW_H__ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -51,18 +51,18 @@ #define BG_WALLPAPER "BackGroundTile" #define STD_TILE_IMG "kooka/pics/thumbviewtile.png" -class QPixmap; -class QListViewItem; +class TQPixmap; +class TQListViewItem; class KProgress; class KIO::PreviewJob; -class ThumbView: public QVBox /* KIconView */ +class ThumbView: public TQVBox /* KIconView */ { Q_OBJECT public: - ThumbView( QWidget *parent, const char *name=0 ); + ThumbView( TQWidget *parent, const char *name=0 ); ~ThumbView(); void setCurrentDir( const KURL& s) @@ -70,9 +70,9 @@ public: KURL currentDir( ) const { return m_currentDir; } - QSize tumbSize( ) const + TQSize tumbSize( ) const { - return( QSize( m_pixWidth, m_pixHeight )); + return( TQSize( m_pixWidth, m_pixHeight )); } int thumbMargin() const @@ -85,7 +85,7 @@ public slots: m_pixWidth = w; m_pixHeight = h; } - void slSetThumbSize( const QSize& s ) + void slSetThumbSize( const TQSize& s ) { m_pixWidth = s.width(); m_pixHeight = s.height(); @@ -97,14 +97,14 @@ public slots: } void slNewFileItems( const KFileItemList& ); - void slGotPreview( const KFileItem*, const QPixmap& ); + void slGotPreview( const KFileItem*, const TQPixmap& ); void slPreviewResult( KIO::Job* ); /** * This connects to the IconView's executed signal and tells the packager * to select the image */ - void slDoubleClicked( QIconViewItem* ); + void slDoubleClicked( TQIconViewItem* ); /** * indication that a image changed, needs to be reloaded. @@ -124,26 +124,26 @@ protected: signals: /** - * selects a QListViewItem from the thumbnail. This signal only makes + * selects a TQListViewItem from the thumbnail. This signal only makes * sense if connected to a ScanPackager. */ void selectFromThumbnail( const KURL& ); private: - QPixmap createPixmap( const QPixmap& ) const; + TQPixmap createPixmap( const TQPixmap& ) const; bool deleteImage( KFileItem* ); KIconView *m_iconView; KProgress *m_progress; KURL m_currentDir; - QPixmap m_basePix; + TQPixmap m_basePix; int m_pixWidth; int m_pixHeight; int m_thumbMargin; - QColor m_marginColor1; - QColor m_marginColor2; - QString m_bgImg; + TQColor m_marginColor1; + TQColor m_marginColor2; + TQString m_bgImg; int m_cntJobsStarted; KIO::PreviewJob *m_job; diff --git a/kooka/thumbviewitem.cpp b/kooka/thumbviewitem.cpp index 7f2d01f6..c8f8dab3 100644 --- a/kooka/thumbviewitem.cpp +++ b/kooka/thumbviewitem.cpp @@ -32,8 +32,8 @@ #include "thumbview.h" #include "thumbviewitem.h" -ThumbViewItem::ThumbViewItem(QIconView *parent, const QString &text, - const QPixmap &pixmap, +ThumbViewItem::ThumbViewItem(TQIconView *parent, const TQString &text, + const TQPixmap &pixmap, KFileItem *fi ) :KFileIconViewItem( parent, text, pixmap,fi ) { diff --git a/kooka/thumbviewitem.h b/kooka/thumbviewitem.h index 745c2b25..74dad84b 100644 --- a/kooka/thumbviewitem.h +++ b/kooka/thumbviewitem.h @@ -41,9 +41,9 @@ class KFileTreeViewItem; class ThumbViewItem: public KFileIconViewItem { public: - ThumbViewItem( QIconView *parent, - const QString &text, - const QPixmap &pixmap, + ThumbViewItem( TQIconView *parent, + const TQString &text, + const TQPixmap &pixmap, KFileItem *fi ); void setItemUrl( const KURL& u ); -- cgit v1.2.1